[PR #4049] [MERGED] fix(chat-settings): keep drawer open behind macro modals + match preset field styling #6220

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

📋 Pull Request Information

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

Base: staging ← Head: fix/chat-settings-macro-modal-and-field-styling


📝 Commits (1)

  • 979f8df fix(chat-settings): keep drawer open behind macro modals; match preset field styling

📊 Changes

4 files changed (+33 additions, -22 deletions)

View changed files

📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+4 -0)
📝 packages/client/src/components/ui/MacroTextarea.tsx (+3 -0)
📝 packages/client/src/features/chat-settings/sections/ConversationPromptSection.tsx (+13 -11)
📝 packages/client/src/features/chat-settings/sections/GameExtraPromptSection.tsx (+13 -11)

📄 Description

Why

Two follow-ups to the merged #4046 (Chat Settings prompt-preset UX), from maintainer feedback:

  1. Opening Edit Conversation/Game Prompt (the expanded editor) or the Macros window from a Prompt Preset section, then closing it, also closed the whole Chat Settings drawer.
  2. The Conversation/Game prompt fields didn't match the Roleplay preset-section fields — they showed a dark blue (--secondary) background instead of the neutral chat-chrome field surface.

Root causes

  1. MacroTextarea's expanded editor and macro reference render in a portal on document.body, outside the Chat Settings panel. The drawer closes on any pointerdown outside its panel, so clicking inside those windows (including their backdrop/close button) triggered the drawer's outside-close.
  2. The Roleplay preset editor renders inside the mari-quick-preset-editor scope, whose .mari-editor-field rule swaps the field background to the neutral chat-chrome input surface. The Conversation/Game MacroTextarea wasn't in that scope, so mari-editor-field fell back to the dark --secondary.

What changed

  • MacroTextarea.tsx: tag both portal overlays (expanded editor + macro reference) with data-macro-modal.
  • ChatSettingsDrawer.tsx: the outside-pointerdown close now ignores targets inside [data-macro-modal], so only the windows' own close controls dismiss them — the drawer stays open.
  • ConversationPromptSection.tsx / GameExtraPromptSection.tsx: wrap the prompt MacroTextarea in the mari-quick-preset-editor scope so its field matches the Roleplay preset-section styling.

Test plan

  • In Conversation and Game chat settings, open the prompt's expanded editor; close it (X, backdrop, Escape) and confirm Chat Settings stays open.
  • Open the Macros window from the prompt field; close it and confirm Chat Settings stays open.
  • Confirm clicking genuinely outside the drawer (not on a macro window) still closes Chat Settings.
  • Confirm the Conversation/Game prompt fields now use the same neutral field surface as the Roleplay preset-section editor (no dark blue background), in light and dark themes.
  • pnpm check passes. (Passed in the authoring session; re-verify locally.)

Follow-up to #4046. No linked issue — direct maintainer change request.

Summary by CodeRabbit

  • Bug Fixes
    • Prevented the chat settings drawer from closing when interacting with expanded prompt or macro editors.
    • Improved the stability of prompt editing in conversation and game settings.

🔄 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/4049 **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:** `fix/chat-settings-macro-modal-and-field-styling` --- ### 📝 Commits (1) - [`979f8df`](https://github.com/Pasta-Devs/Marinara-Engine/commit/979f8df3e67fdb123e193f0648ebb0984c97376a) fix(chat-settings): keep drawer open behind macro modals; match preset field styling ### 📊 Changes **4 files changed** (+33 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+4 -0) 📝 `packages/client/src/components/ui/MacroTextarea.tsx` (+3 -0) 📝 `packages/client/src/features/chat-settings/sections/ConversationPromptSection.tsx` (+13 -11) 📝 `packages/client/src/features/chat-settings/sections/GameExtraPromptSection.tsx` (+13 -11) </details> ### 📄 Description ## Why Two follow-ups to the merged #4046 (Chat Settings prompt-preset UX), from maintainer feedback: 1. Opening **Edit Conversation/Game Prompt** (the expanded editor) or the **Macros** window from a Prompt Preset section, then closing it, also closed the whole Chat Settings drawer. 2. The Conversation/Game prompt fields didn't match the Roleplay preset-section fields — they showed a dark blue (`--secondary`) background instead of the neutral chat-chrome field surface. ## Root causes 1. `MacroTextarea`'s expanded editor and macro reference render in a portal on `document.body`, outside the Chat Settings panel. The drawer closes on any `pointerdown` outside its panel, so clicking inside those windows (including their backdrop/close button) triggered the drawer's outside-close. 2. The Roleplay preset editor renders inside the `mari-quick-preset-editor` scope, whose `.mari-editor-field` rule swaps the field background to the neutral chat-chrome input surface. The Conversation/Game `MacroTextarea` wasn't in that scope, so `mari-editor-field` fell back to the dark `--secondary`. ## What changed - `MacroTextarea.tsx`: tag both portal overlays (expanded editor + macro reference) with `data-macro-modal`. - `ChatSettingsDrawer.tsx`: the outside-pointerdown close now ignores targets inside `[data-macro-modal]`, so only the windows' own close controls dismiss them — the drawer stays open. - `ConversationPromptSection.tsx` / `GameExtraPromptSection.tsx`: wrap the prompt `MacroTextarea` in the `mari-quick-preset-editor` scope so its field matches the Roleplay preset-section styling. ## Test plan - [ ] In Conversation and Game chat settings, open the prompt's expanded editor; close it (X, backdrop, Escape) and confirm Chat Settings stays open. - [ ] Open the Macros window from the prompt field; close it and confirm Chat Settings stays open. - [ ] Confirm clicking genuinely outside the drawer (not on a macro window) still closes Chat Settings. - [ ] Confirm the Conversation/Game prompt fields now use the same neutral field surface as the Roleplay preset-section editor (no dark blue background), in light and dark themes. - [ ] `pnpm check` passes. (Passed in the authoring session; re-verify locally.) Follow-up to #4046. No linked issue — direct maintainer change request. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Prevented the chat settings drawer from closing when interacting with expanded prompt or macro editors. * Improved the stability of prompt editing in conversation and game settings. <!-- 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:17 +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#6220
No description provided.