[GH-ISSUE #1469] [Feature]: Split Chat Settings Drawer into focused modules #729

Closed
opened 2026-10-20 17:32:28 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Xelvanis on GitHub (May 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1469

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx has grown into a very large mixed UI file, currently around 6,900 lines. It owns the drawer shell plus many unrelated settings surfaces: chat metadata parsing, character/persona/lorebook selection, agents/tools settings, sprites/selfies, Spotify/haptics/game settings, memory and notes modals, schedule editing, and local UI widgets.

That size makes focused settings changes harder to review and increases the chance that unrelated chat, roleplay, or game settings behavior gets touched while editing one small area.

Proposed behavior

Split the drawer into focused feature-local modules without changing behavior.

A good target shape would keep the public drawer entrypoint stable while moving leaf pieces under src/features/modes/shared/chat-ui/components/settings/, for example:

  • chat-settings-utils.ts for pure normalizers and small helpers.
  • Section.tsx or ChatSettingsSection.tsx for the local collapsible section chrome.
  • MemoryRecallMemoriesModal.tsx.
  • ConversationNotesSection.tsx.
  • AdvancedParametersSection.tsx.
  • ConversationPromptSection.tsx.
  • ImpersonateSettingsContent.tsx.
  • ScheduleEditor.tsx.
  • Sprite/selfie settings controls.
  • Agent/category picker pieces.

After leaf extraction, consider focused hooks for computed state such as active lorebooks, available agents, sprite subjects, and preset actions if that reduces coupling without creating a generic router.

Expected owner or impact area

  • App shell, navigation, startup, or providers
  • Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Refactor branch considerations

Keep the split feature-local unless a piece is truly generic. Generic UI can move to src/shared, but chat/settings-specific components should stay under the chat UI feature package.

Do not turn this into a behavior-changing PR. The first pass should be mechanical extraction with stable props, same imports where possible, and no new cross-mode imports. Avoid widening existing raw runtime/API coupling while splitting; issue #1457 separately tracks migrating remaining raw invokeTauri callers to focused shared API wrappers.

Validation should include at least pnpm typecheck; use pnpm check:architecture if imports or ownership boundaries change.

Alternatives considered

Leaving the drawer as one file preserves local context but keeps the current review and maintenance cost. A single giant cleanup PR would be risky; staged leaf-component extraction is safer and easier to review.

Additional context

There is already precedent in the same folder: components/settings/HapticConnectionPanel.tsx is extracted, and src/shared/components/ui/GenerationParametersEditor.tsx already owns the reusable generation parameter controls.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (May 28, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1469 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? `src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx` has grown into a very large mixed UI file, currently around 6,900 lines. It owns the drawer shell plus many unrelated settings surfaces: chat metadata parsing, character/persona/lorebook selection, agents/tools settings, sprites/selfies, Spotify/haptics/game settings, memory and notes modals, schedule editing, and local UI widgets. That size makes focused settings changes harder to review and increases the chance that unrelated chat, roleplay, or game settings behavior gets touched while editing one small area. ## Proposed behavior Split the drawer into focused feature-local modules without changing behavior. A good target shape would keep the public drawer entrypoint stable while moving leaf pieces under `src/features/modes/shared/chat-ui/components/settings/`, for example: - `chat-settings-utils.ts` for pure normalizers and small helpers. - `Section.tsx` or `ChatSettingsSection.tsx` for the local collapsible section chrome. - `MemoryRecallMemoriesModal.tsx`. - `ConversationNotesSection.tsx`. - `AdvancedParametersSection.tsx`. - `ConversationPromptSection.tsx`. - `ImpersonateSettingsContent.tsx`. - `ScheduleEditor.tsx`. - Sprite/selfie settings controls. - Agent/category picker pieces. After leaf extraction, consider focused hooks for computed state such as active lorebooks, available agents, sprite subjects, and preset actions if that reduces coupling without creating a generic router. ## Expected owner or impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge - [x] Chat mode - [x] Roleplay mode - [x] Game mode - [x] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Refactor branch considerations Keep the split feature-local unless a piece is truly generic. Generic UI can move to `src/shared`, but chat/settings-specific components should stay under the chat UI feature package. Do not turn this into a behavior-changing PR. The first pass should be mechanical extraction with stable props, same imports where possible, and no new cross-mode imports. Avoid widening existing raw runtime/API coupling while splitting; issue #1457 separately tracks migrating remaining raw `invokeTauri` callers to focused shared API wrappers. Validation should include at least `pnpm typecheck`; use `pnpm check:architecture` if imports or ownership boundaries change. ## Alternatives considered Leaving the drawer as one file preserves local context but keeps the current review and maintenance cost. A single giant cleanup PR would be risky; staged leaf-component extraction is safer and easier to review. ## Additional context There is already precedent in the same folder: `components/settings/HapticConnectionPanel.tsx` is extracted, and `src/shared/components/ui/GenerationParametersEditor.tsx` already owns the reusable generation parameter controls. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@SpicyMarinara commented on GitHub (May 28, 2026):

Addressed on refactor in commit 390990ec. Implemented the first focused Chat Settings drawer extraction by moving shared section, picker, and slider primitives into ChatSettingsSections while preserving behavior and visuals.

<!-- gh-comment-id:4568816854 --> @SpicyMarinara commented on GitHub (May 28, 2026): Addressed on refactor in commit 390990ec. Implemented the first focused Chat Settings drawer extraction by moving shared section, picker, and slider primitives into ChatSettingsSections while preserving behavior and visuals.
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#729
No description provided.