[GH-ISSUE #4080] [Issue]: Chat Settings only remembers expanded drawer in Roleplay mode — Conversation & Game sections lack persistence ids #2206

Closed
opened 2026-10-21 05:46:16 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Jul 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4080

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Chat Settings remembers which collapsible drawer/section was left expanded and restores it on reopen — but in practice this only "sticks" for the sections prominent in Roleplay mode. Most Conversation and Game mode sections do not remember their state.

Root cause

Persistence is opt-in via an optional id prop on the shared <Section> collapsible, and only the sections that were extracted into dedicated components were given an id. The 18 remaining inline <Section> calls have no id, so they silently never persist.

The feature was introduced in commit efec21a4a ("feat(chat-settings): inline prompt-preset editing + remembered section state"), whose diff only added id="…" to the extracted section components plus the store plumbing.

What persists vs what doesn't (in ChatSettingsDrawer.tsx)

Persists (id-bearing, extracted components): chat-name, connection, lorebooks, translation, function-calling (all modes); prompt-preset, impersonate (roleplay); conversation-prompt (conversation); game-prompt, combat-style (game).

Does NOT persist (inline <Section>, no id) — includes exactly the Conversation/Game-defining sections: Party, Persona, Characters, Card Theming, Scoped Regex, Group Chat, Autonomous Messaging, Agents / Conversation commands, Connected Chats, Widgets, Memory Recall, Automatic Summarization, Conversation Notes. Lines: 4570, 4868, 5041, 5323, 5378, 5482, 5764, 6026, 6314, 6438, 6529, 6579, 6680, 9113, 9164, 9176, 9290, 11173.

Because Roleplay's prominent collapsibles (Prompt Preset, Lorebooks, Impersonate, Connection) are id-bearing while the Conversation/Game headline sections are inline-without-id, it looks like the feature only works in Roleplay.

Suggested fix

Give every remaining inline <Section …> in ChatSettingsDrawer.tsx a stable, unique id (matching the pattern already used by the extracted section components). No store or per-mode logic changes are needed — the persistence already works for any section that has an id.

Manual verification (for the implementer — leave unchecked)

  • In Conversation mode, expand a section (e.g. Autonomous Messaging / Agents / Memory Recall), close Chat Settings, reopen — it stays expanded
  • In Game mode, expand a section (e.g. Party / Widgets), close and reopen — it stays expanded
  • Roleplay-mode persistence still works (no regression)
  • ids are unique (no collisions sharing state across unrelated sections)
Originally created by @SpicyMarinara on GitHub (Jul 25, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4080 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Chat Settings remembers which collapsible drawer/section was left expanded and restores it on reopen — but in practice this only "sticks" for the sections prominent in **Roleplay** mode. Most **Conversation** and **Game** mode sections do not remember their state. ## Root cause Persistence is opt-in via an optional `id` prop on the shared `<Section>` collapsible, and only the sections that were extracted into dedicated components were given an `id`. The 18 remaining **inline `<Section>` calls have no `id`, so they silently never persist.** - Shared collapsible: [`features/chat-settings/ChatSettingsSection.tsx`](packages/client/src/features/chat-settings/ChatSettingsSection.tsx) — persistence is gated on `id`: - `rememberedOpen` reads the store only when `id` is set ([line 29](packages/client/src/features/chat-settings/ChatSettingsSection.tsx#L29)); - `toggleOpen` writes back only `if (id)` ([lines 36-41](packages/client/src/features/chat-settings/ChatSettingsSection.tsx#L36-L41)). - With no `id`, `rememberedOpen` is always `undefined` and the section always falls back to `initialOpen`. - Store is global and already works for all modes: `chatSettingsExpandedSections` in [`stores/ui.store.ts`](packages/client/src/stores/ui.store.ts) (state [605-606](packages/client/src/stores/ui.store.ts#L605-L606), setter [2051-2054](packages/client/src/stores/ui.store.ts#L2051-L2054), persisted via partialize). - One shared `<ChatSettingsDrawer>` is mounted for every mode via `ChatCommonOverlays` ([ChatCommonOverlays.tsx:327-342](packages/client/src/components/chat/ChatCommonOverlays.tsx#L327-L342)), so the surface wiring is **not** the problem. The feature was introduced in commit `efec21a4a` ("feat(chat-settings): inline prompt-preset editing + remembered section state"), whose diff only added `id="…"` to the extracted section components plus the store plumbing. ### What persists vs what doesn't (in `ChatSettingsDrawer.tsx`) **Persists** (id-bearing, extracted components): chat-name, connection, lorebooks, translation, function-calling (all modes); prompt-preset, impersonate (roleplay); conversation-prompt (conversation); game-prompt, combat-style (game). **Does NOT persist** (inline `<Section>`, no `id`) — includes exactly the Conversation/Game-defining sections: Party, Persona, Characters, Card Theming, Scoped Regex, Group Chat, **Autonomous Messaging**, **Agents / Conversation commands**, Connected Chats, Widgets, **Memory Recall**, Automatic Summarization, Conversation Notes. Lines: 4570, 4868, 5041, 5323, 5378, 5482, 5764, 6026, 6314, 6438, 6529, 6579, 6680, 9113, 9164, 9176, 9290, 11173. Because Roleplay's prominent collapsibles (Prompt Preset, Lorebooks, Impersonate, Connection) are id-bearing while the Conversation/Game headline sections are inline-without-id, it *looks* like the feature only works in Roleplay. ## Suggested fix Give every remaining inline `<Section …>` in [`ChatSettingsDrawer.tsx`](packages/client/src/components/chat/ChatSettingsDrawer.tsx) a stable, unique `id` (matching the pattern already used by the extracted section components). No store or per-mode logic changes are needed — the persistence already works for any section that has an `id`. ## Manual verification (for the implementer — leave unchecked) - [ ] In Conversation mode, expand a section (e.g. Autonomous Messaging / Agents / Memory Recall), close Chat Settings, reopen — it stays expanded - [ ] In Game mode, expand a section (e.g. Party / Widgets), close and reopen — it stays expanded - [ ] Roleplay-mode persistence still works (no regression) - [ ] `id`s are unique (no collisions sharing state across unrelated sections)
bsakaguchi 2026-10-21 05:46:16 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jul 25, 2026):

I’m implementing this as part of the active open-issue sweep in #4077. No competing issue-linked branch or open PR was found before starting.

<!-- gh-comment-id:5077586620 --> @SpicyMarinara commented on GitHub (Jul 25, 2026): I’m implementing this as part of the active open-issue sweep in #4077. No competing issue-linked branch or open PR was found before starting.
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#2206
No description provided.