[PR #2273] [MERGED] Apply active chat presets on new chat starts #5525

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2273
Author: @Xelvanis
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/5/2026
Merged by: @Xelvanis

Base: refactor ← Head: fix/chat-preset-runtime-apply-2265


📝 Commits (1)

  • b7f12e4 chat-presets: apply active preset on new chat starts

📊 Changes

4 files changed (+49 additions, -42 deletions)

View changed files

📝 src/app/shell/useStartNewChat.ts (+7 -22)
📝 src/features/catalog/chat-presets/hooks/use-chat-presets.ts (+23 -3)
📝 src/features/modes/router/components/ModeHomeSurface.tsx (+13 -5)
📝 src/features/modes/shared/chat-ui/components/NewChatConnectionGate.tsx (+6 -12)

📄 Description

Linked issue

Closes #2265

Why this change

  • Active/starred chat-settings presets were not applied consistently when starting new chats. The shared shell and connection-gate paths skipped game, and the mode-home quick-start path bypassed chat preset application entirely.

What changed

  • Added a shared chat-preset hook that resolves the active user preset by exact chat mode and applies it to a newly created chat.
  • Updated the app shell new-chat path and shared connection gate to use the shared helper, including game mode.
  • Updated mode-home quick start so conversation, roleplay, and game starts use the same active/starred preset apply behavior.
  • Removed now-unused chat-preset exports caught by the full repo gate.

Refactor impact

Primary owner:

  • App shell, catalog chat-presets, shared mode UI, and mode router quick-start UI.

Impact areas reviewed:

  • Conversation, roleplay, and game new-chat entrypoints.
  • Chat preset selection and apply contract.
  • Existing character-start path, which remains conversation/roleplay only.

Boundary notes:

  • Feature code continues to use catalog hooks and shared storage API wrappers.
  • No engine, shared API adapter, Rust, or remote-runtime command boundary changes.

Pressure points touched:

  • Shared mode UI: NewChatConnectionGate.
  • Mode router home surface quick-start flow.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • pnpm typecheck passed.
  • pnpm check:architecture passed.
  • pnpm build passed.
  • pnpm check passed after removing unused chat-preset exports.
  • Manual Tauri click-through for conversation, roleplay, game, and quick-start paths was not run.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Restores existing preset-apply behavior on new-chat start paths; no new discoverable surface was added.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

No screenshots or recordings. This is storage-apply wiring for new-chat start paths; manual Tauri proof remains the visible behavior follow-up.

Summary by CodeRabbit

  • Refactor
    • Unified chat preset application by consolidating duplicate logic into a centralized, reusable hook
    • Ensures user's starred presets are automatically applied consistently across all chat creation flows
    • Simplified preset lookup and application workflow by centralizing previously scattered implementation details across multiple components

🔄 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/2273 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/5/2026 **Status:** ✅ Merged **Merged:** 6/5/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `fix/chat-preset-runtime-apply-2265` --- ### 📝 Commits (1) - [`b7f12e4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b7f12e470448e912cff975a6dd7356b5e980edd5) chat-presets: apply active preset on new chat starts ### 📊 Changes **4 files changed** (+49 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `src/app/shell/useStartNewChat.ts` (+7 -22) 📝 `src/features/catalog/chat-presets/hooks/use-chat-presets.ts` (+23 -3) 📝 `src/features/modes/router/components/ModeHomeSurface.tsx` (+13 -5) 📝 `src/features/modes/shared/chat-ui/components/NewChatConnectionGate.tsx` (+6 -12) </details> ### 📄 Description ## Linked issue Closes #2265 ## Why this change - Active/starred chat-settings presets were not applied consistently when starting new chats. The shared shell and connection-gate paths skipped `game`, and the mode-home quick-start path bypassed chat preset application entirely. ## What changed - Added a shared chat-preset hook that resolves the active user preset by exact chat mode and applies it to a newly created chat. - Updated the app shell new-chat path and shared connection gate to use the shared helper, including `game` mode. - Updated mode-home quick start so conversation, roleplay, and game starts use the same active/starred preset apply behavior. - Removed now-unused chat-preset exports caught by the full repo gate. ## Refactor impact Primary owner: - App shell, catalog chat-presets, shared mode UI, and mode router quick-start UI. Impact areas reviewed: - Conversation, roleplay, and game new-chat entrypoints. - Chat preset selection and apply contract. - Existing character-start path, which remains conversation/roleplay only. Boundary notes: - Feature code continues to use catalog hooks and shared storage API wrappers. - No engine, shared API adapter, Rust, or remote-runtime command boundary changes. Pressure points touched: - Shared mode UI: `NewChatConnectionGate`. - Mode router home surface quick-start flow. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [x] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm typecheck` passed. - `pnpm check:architecture` passed. - `pnpm build` passed. - `pnpm check` passed after removing unused chat-preset exports. - Manual Tauri click-through for conversation, roleplay, game, and quick-start paths was not run. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Restores existing preset-apply behavior on new-chat start paths; no new discoverable surface was added. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence No screenshots or recordings. This is storage-apply wiring for new-chat start paths; manual Tauri proof remains the visible behavior follow-up. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Unified chat preset application by consolidating duplicate logic into a centralized, reusable hook * Ensures user's starred presets are automatically applied consistently across all chat creation flows * Simplified preset lookup and application workflow by centralizing previously scattered implementation details across multiple components <!-- 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:17:04 +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#5525
No description provided.