[PR #4046] [MERGED] feat(chat-settings): inline prompt-preset editing + remembered section state #6217

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4046
Author: @SpicyMarinara
Created: 7/24/2026
Status: ✅ Merged
Merged: 7/24/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feature/chat-settings-prompt-preset-ux


📝 Commits (2)

  • efec21a feat(chat-settings): inline prompt-preset editing + remembered section state
  • 23675ff fix(chat-settings): use hardcoded English in Conversation prompt section

📊 Changes

16 files changed (+198 additions, -284 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+0 -26)
📝 packages/client/src/features/chat-settings/ChatSettingsSection.tsx (+16 -4)
📝 packages/client/src/features/chat-settings/sections/ChatNameSection.tsx (+1 -0)
📝 packages/client/src/features/chat-settings/sections/CombatStyleSection.tsx (+1 -0)
📝 packages/client/src/features/chat-settings/sections/ConnectionSection.tsx (+1 -0)
📝 packages/client/src/features/chat-settings/sections/ConversationPromptSection.tsx (+62 -91)
📝 packages/client/src/features/chat-settings/sections/FunctionCallingSection.tsx (+1 -0)
📝 packages/client/src/features/chat-settings/sections/GameExtraPromptSection.tsx (+90 -127)
📝 packages/client/src/features/chat-settings/sections/ImpersonateSection.tsx (+1 -0)
📝 packages/client/src/features/chat-settings/sections/LorebooksSection.tsx (+1 -0)
📝 packages/client/src/features/chat-settings/sections/PromptPresetSection.tsx (+10 -36)
📝 packages/client/src/features/chat-settings/sections/SceneInstructionsSection.tsx (+1 -0)
📝 packages/client/src/features/chat-settings/sections/TranslationSection.tsx (+1 -0)
📝 packages/client/src/localization/locales/en.json (+1 -0)
📝 packages/client/src/stores/ui.store.ts (+10 -0)

📄 Description

Why

Change request for the Chat Settings Prompt Preset area:

  1. Roleplay's "Edit preset sections" was hidden behind a collapsible toggle — it should always be available once a preset is selected.
  2. Conversation/Game show a Conversation/Game prompt derived from the selected preset (or the default when the preset has none), but editing was a separate modal. The prompt should be editable inline, with the option to expand the editor and view macros.
  3. The "open selected preset" shortcut button in Conversation/Game is unnecessary.
  4. Chat Settings should remember which drawer sections were left expanded and restore them on reopen, for easier repeat edits.

What changed

  • PromptPresetSection.tsx (Roleplay) — once a preset is selected, the preset-section editor renders directly (no collapsible toggle). Removed the quickEditorOpen/onQuickEditorToggle props and the drawer's quickPresetEditorOpen state.
  • ConversationPromptSection.tsx / GameExtraPromptSection.tsx — the effective prompt (chat-local edit → preset prompt → built-in default) is now edited inline via MacroTextarea (type directly, expand to a full window, browse the macro reference). Editing saves a chat-local override; clearing back to the base drops it. Removed the modal-only "Edit Prompt" flow and the "open selected preset" (ExternalLink) button, plus the now-unused drawer state/callbacks (gamePromptDraft, gamePromptExpanded, openSelectedModePromptPreset).
  • ChatSettingsSection.tsx + ui.store.ts — each section takes a stable id; expand/collapse is persisted in chatSettingsExpandedSections and restored on reopen. Applied ids to all 11 sections.

Test plan

  • Roleplay with a preset selected: the preset-section editor is visible without any expand toggle; edits autosave.
  • Conversation: pick a preset, confirm its Conversation prompt shows inline and is editable; expand the editor and confirm the macro reference is available; edits persist as a chat-local override; the reset control returns to the preset/default; with no preset it shows/edits the built-in default.
  • Game: same as Conversation for the Game prompt; GM prompt style select and Extra instructions still work.
  • Confirm the "open selected preset" button is gone from Conversation and Game.
  • Expand a couple of Chat Settings sections, collapse others, close and reopen the drawer (and switch chats) — the expanded/collapsed state is remembered.
  • pnpm check passes. (Passed in the authoring session; re-verify locally.)

Note: no linked issue — this is a direct maintainer change request.

Summary by CodeRabbit

  • New Features
    • Prompt presets now display effective prompts in an inline, editable editor for Conversation and Game modes.
    • Roleplay preset editing opens immediately after selection.
    • Added macro browsing, reset-to-default controls, and clearer prompt source indicators.
    • Chat Settings sections now remember their expanded or collapsed state between visits.
  • Documentation
    • Updated release notes to document the Prompt Preset interface changes.

🔄 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/4046 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/24/2026 **Status:** ✅ Merged **Merged:** 7/24/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feature/chat-settings-prompt-preset-ux` --- ### 📝 Commits (2) - [`efec21a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/efec21a4aedcccbdad0f5fe971bd14b08479637f) feat(chat-settings): inline prompt-preset editing + remembered section state - [`23675ff`](https://github.com/Pasta-Devs/Marinara-Engine/commit/23675ff300945527bf242be1408e27c02468d6d2) fix(chat-settings): use hardcoded English in Conversation prompt section ### 📊 Changes **16 files changed** (+198 additions, -284 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+0 -26) 📝 `packages/client/src/features/chat-settings/ChatSettingsSection.tsx` (+16 -4) 📝 `packages/client/src/features/chat-settings/sections/ChatNameSection.tsx` (+1 -0) 📝 `packages/client/src/features/chat-settings/sections/CombatStyleSection.tsx` (+1 -0) 📝 `packages/client/src/features/chat-settings/sections/ConnectionSection.tsx` (+1 -0) 📝 `packages/client/src/features/chat-settings/sections/ConversationPromptSection.tsx` (+62 -91) 📝 `packages/client/src/features/chat-settings/sections/FunctionCallingSection.tsx` (+1 -0) 📝 `packages/client/src/features/chat-settings/sections/GameExtraPromptSection.tsx` (+90 -127) 📝 `packages/client/src/features/chat-settings/sections/ImpersonateSection.tsx` (+1 -0) 📝 `packages/client/src/features/chat-settings/sections/LorebooksSection.tsx` (+1 -0) 📝 `packages/client/src/features/chat-settings/sections/PromptPresetSection.tsx` (+10 -36) 📝 `packages/client/src/features/chat-settings/sections/SceneInstructionsSection.tsx` (+1 -0) 📝 `packages/client/src/features/chat-settings/sections/TranslationSection.tsx` (+1 -0) 📝 `packages/client/src/localization/locales/en.json` (+1 -0) 📝 `packages/client/src/stores/ui.store.ts` (+10 -0) </details> ### 📄 Description ## Why Change request for the Chat Settings **Prompt Preset** area: 1. Roleplay's "Edit preset sections" was hidden behind a collapsible toggle — it should always be available once a preset is selected. 2. Conversation/Game show a Conversation/Game prompt derived from the selected preset (or the default when the preset has none), but editing was a separate modal. The prompt should be editable **inline**, with the option to expand the editor and view macros. 3. The "open selected preset" shortcut button in Conversation/Game is unnecessary. 4. Chat Settings should remember which drawer sections were left expanded and restore them on reopen, for easier repeat edits. ## What changed - **`PromptPresetSection.tsx` (Roleplay)** — once a preset is selected, the preset-section editor renders directly (no collapsible toggle). Removed the `quickEditorOpen`/`onQuickEditorToggle` props and the drawer's `quickPresetEditorOpen` state. - **`ConversationPromptSection.tsx` / `GameExtraPromptSection.tsx`** — the effective prompt (chat-local edit → preset prompt → built-in default) is now edited inline via **`MacroTextarea`** (type directly, expand to a full window, browse the macro reference). Editing saves a chat-local override; clearing back to the base drops it. Removed the modal-only "Edit Prompt" flow and the "open selected preset" (`ExternalLink`) button, plus the now-unused drawer state/callbacks (`gamePromptDraft`, `gamePromptExpanded`, `openSelectedModePromptPreset`). - **`ChatSettingsSection.tsx` + `ui.store.ts`** — each section takes a stable `id`; expand/collapse is persisted in `chatSettingsExpandedSections` and restored on reopen. Applied ids to all 11 sections. ## Test plan - [ ] Roleplay with a preset selected: the preset-section editor is visible without any expand toggle; edits autosave. - [ ] Conversation: pick a preset, confirm its Conversation prompt shows inline and is editable; expand the editor and confirm the macro reference is available; edits persist as a chat-local override; the reset control returns to the preset/default; with no preset it shows/edits the built-in default. - [ ] Game: same as Conversation for the Game prompt; GM prompt style select and Extra instructions still work. - [ ] Confirm the "open selected preset" button is gone from Conversation and Game. - [ ] Expand a couple of Chat Settings sections, collapse others, close and reopen the drawer (and switch chats) — the expanded/collapsed state is remembered. - [ ] `pnpm check` passes. (Passed in the authoring session; re-verify locally.) Note: no linked issue — this is a direct maintainer change request. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Prompt presets now display effective prompts in an inline, editable editor for Conversation and Game modes. * Roleplay preset editing opens immediately after selection. * Added macro browsing, reset-to-default controls, and clearer prompt source indicators. * Chat Settings sections now remember their expanded or collapsed state between visits. * **Documentation** * Updated release notes to document the Prompt Preset interface changes. <!-- 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-23 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#6217
No description provided.