[PR #216] [CLOSED] feat: Option to guide generations from chat input textarea #4510

Closed
opened 2026-10-22 04:08:16 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/216
Author: @mm14141
Created: 4/24/2026
Status: ❌ Closed

Base: main ← Head: feat/guide-generations


📝 Commits (4)

  • 16e136b feat: add current input to chat store
  • 6154e9a feat: implement option to guide generations with chat input
  • 58da0d7 fix: fix input unmount race conditions
  • 89ae1f0 docs: update FRONTEND.md with new store values

📊 Changes

14 files changed (+109 additions, -39 deletions)

View changed files

📝 docs/FRONTEND.md (+2 -1)
📝 packages/client/src/components/chat/ChatArea.tsx (+9 -2)
📝 packages/client/src/components/chat/ChatInput.tsx (+24 -14)
📝 packages/client/src/components/chat/ChatMessage.tsx (+7 -2)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+1 -0)
📝 packages/client/src/components/chat/ConversationInput.tsx (+24 -17)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+7 -2)
📝 packages/client/src/components/chat/ConversationView.tsx (+1 -1)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+8 -0)
📝 packages/client/src/hooks/use-generate.ts (+1 -0)
📝 packages/client/src/stores/chat.store.ts (+7 -0)
📝 packages/client/src/stores/ui.store.ts (+6 -0)
📝 packages/server/src/routes/generate.routes.ts (+11 -0)
📝 packages/shared/src/schemas/chat.schema.ts (+1 -0)

📄 Description

Why this change

This feature provides a more seamless way to guide the AI's responses, allowing users to quickly direct it through the chat input textarea, without needing to send an OOC message or edit the Author's Notes.

What changed

  • There is now an option under Advanced Settings to enable "Guide generations using chat input" which sets in the persisted UI store.
  • This option allows regenerations and "Trigger Character" responses to be guided directly from the chat input, similar to the Guided Generations extension on SillyTavern.
  • When activated, generate.routes.ts will inject this instruction: "Take the following into special consideration for your next message: [chat input content]"
  • Also fixed race conditions related to chat input drafts that were causing issues with this feature.

Validation

  • pnpm check
  • Manual verification completed (describe below)

Manual verification notes

  • Verified that the guide instruction is applied when and only when the option is enabled and there is text in the chat input.
  • Verified that input drafts stay in their respective chats

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

AdvancedSettingsScreenshot

Summary by CodeRabbit

  • New Features

    • Added "Guide Generations" toggle in Advanced Settings to let current chat input guide regenerations and manual generation.
    • Typed chat input is tracked globally so it can be included when generating or regenerating messages.
    • Switching chats now fully resets/remounts the input so each chat has a fresh input state.
    • Regenerate tooltips and trigger behavior now indicate guided vs non-guided actions.
  • Documentation

    • Frontend docs updated to document the new UI setting and the tracked current chat input.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/216 **Author:** [@mm14141](https://github.com/mm14141) **Created:** 4/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/guide-generations` --- ### 📝 Commits (4) - [`16e136b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/16e136b84741383fb2a9081c75e90c6f866cf0f8) feat: add current input to chat store - [`6154e9a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6154e9a2ea86e39dd6a167e245a1ad572185e374) feat: implement option to guide generations with chat input - [`58da0d7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/58da0d7aa3596adddfe60cbfb674bfb534d1c5e0) fix: fix input unmount race conditions - [`89ae1f0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/89ae1f025ab546088d518dfb5cc9c1e56abb14e2) docs: update FRONTEND.md with new store values ### 📊 Changes **14 files changed** (+109 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `docs/FRONTEND.md` (+2 -1) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+9 -2) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+24 -14) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+7 -2) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+1 -0) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+24 -17) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+7 -2) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+1 -1) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+8 -0) 📝 `packages/client/src/hooks/use-generate.ts` (+1 -0) 📝 `packages/client/src/stores/chat.store.ts` (+7 -0) 📝 `packages/client/src/stores/ui.store.ts` (+6 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+11 -0) 📝 `packages/shared/src/schemas/chat.schema.ts` (+1 -0) </details> ### 📄 Description ## Why this change This feature provides a more seamless way to guide the AI's responses, allowing users to quickly direct it through the chat input textarea, without needing to send an OOC message or edit the Author's Notes. ## What changed - There is now an option under Advanced Settings to enable "Guide generations using chat input" which sets in the persisted UI store. - This option allows regenerations and "Trigger Character" responses to be guided directly from the chat input, similar to the Guided Generations extension on SillyTavern. - When activated, `generate.routes.ts` will inject this instruction: "Take the following into special consideration for your next message: [chat input content]" - Also fixed race conditions related to chat input drafts that were causing issues with this feature. ## Validation - [x] `pnpm check` - [x] Manual verification completed (describe below) ### Manual verification notes - Verified that the guide instruction is applied when and only when the option is enabled and there is text in the chat input. - Verified that input drafts stay in their respective chats ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) <img width="789" height="1317" alt="AdvancedSettingsScreenshot" src="https://github.com/user-attachments/assets/240fdf6e-c836-45b5-a508-27f6525a0c83" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added "Guide Generations" toggle in Advanced Settings to let current chat input guide regenerations and manual generation. * Typed chat input is tracked globally so it can be included when generating or regenerating messages. * Switching chats now fully resets/remounts the input so each chat has a fresh input state. * Regenerate tooltips and trigger behavior now indicate guided vs non-guided actions. * **Documentation** * Frontend docs updated to document the new UI setting and the tracked current chat input. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:08:16 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4510
No description provided.