[PR #94] [MERGED] feat(chat): Chat-settings presets + quick-start context menu #4460

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/94
Author: @LukaTheHero
Created: 4/17/2026
Status: ✅ Merged
Merged: 4/17/2026
Merged by: @LukaTheHero

Base: main ← Head: feat/chat-settings-presets


📝 Commits (1)

  • a2e638b feat(chat): Chat-settings presets + quick-start context menu

📊 Changes

18 files changed (+1462 additions, -62 deletions)

View changed files

📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+233 -0)
📝 packages/client/src/components/chat/ChatSetupWizard.tsx (+319 -59)
📝 packages/client/src/components/panels/BotBrowserPanel.tsx (+50 -2)
📝 packages/client/src/components/panels/CharactersPanel.tsx (+54 -1)
➕ packages/client/src/components/ui/ContextMenu.tsx (+101 -0)
➕ packages/client/src/hooks/use-chat-presets.ts (+104 -0)
📝 packages/client/src/stores/chat.store.ts (+6 -0)
📝 packages/server/src/db/migrate.ts (+11 -0)
➕ packages/server/src/db/schema/chat-presets.ts (+20 -0)
📝 packages/server/src/db/schema/index.ts (+1 -0)
➕ packages/server/src/routes/chat-presets.routes.ts (+159 -0)
📝 packages/server/src/routes/index.ts (+2 -0)
➕ packages/server/src/services/storage/chat-presets.storage.ts (+306 -0)
📝 packages/shared/src/index.ts (+2 -0)
➕ packages/shared/src/schemas/chat-preset.schema.ts (+30 -0)
➕ packages/shared/src/types/chat-preset.ts (+61 -0)
📝 packages/shared/src/types/chat.ts (+2 -0)
📝 packages/shared/src/types/export.ts (+1 -0)

📄 Description

Summary

Adds a per-mode chat-settings preset system so users don't have to reconfigure every new conversation/roleplay from scratch. A preset bundles a chat's connection, prompt preset, agents, tools, translation, memory recall, advanced parameters, autonomous messaging, and similar reusable settings — and explicitly does not touch characters, persona, lorebooks, sprites, summary, tags, or scene prompt (those stay tied to the chat).

What's new

Preset bar at the top of Chat Settings drawer

  • Dropdown of presets for the current mode (conversation / roleplay).
  • Selecting a preset immediately applies its settings to the current chat. Selecting Default resets preset-controlled fields back to system defaults; chat-specific fields are preserved across switches.
  • One-row of actions: Save, Rename, Save As, Import, Export, Delete.
  • Default preset is auto-seeded per mode and cannot be renamed, deleted, or saved into.
  • Deleting the currently-applied preset auto-applies Default so the chat doesn't silently keep the deleted preset's values.
  • ? HelpTooltip explains what the preset does and doesn't carry.
  • Conversation and roleplay each have their own list of presets (no cross-mode bleed).

Wizard

  • New "Use Settings Presets" button between Skip and Next opens a Quick Setup view (Preset / Persona / Characters) for one-shot configuration of a new roleplay.

Right-click context menu on character rows

  • Characters panel, group members, and the Browser panel all support right-click → "Quick Start Roleplay" / "Quick Start Conversation".
  • Creates the chat with that character pre-added and lands directly on the Quick Setup view via a new shouldOpenWizardInShortcutMode chat-store flag.
  • Suppressed in selection mode and group-assignment mode so it doesn't fight those flows.

New entities

  • chat_presets table (id, name, mode, is_default, is_active, settings JSON, timestamps) — created via the existing idempotent runtime migration in migrate.ts.
  • /api/chat-presets routes: list / get / create / update / delete, PUT /:id/settings (Save), POST /:id/duplicate (Save As), POST /:id/set-active, POST /:id/apply/:chatId, GET /:id/export, POST /import.
  • ChatPreset, ChatPresetSettings shared types + Zod schemas.
  • ContextMenu reusable UI component (portal-rendered, viewport-clamped, closes on outside click / Escape / scroll / resize).

Test plan

  • Open Chat Settings on a roleplay → see preset bar with Default selected, ? tooltip readable.
  • Tweak settings (agents, advanced parameters, etc.) → click Save As → name it → confirm new preset appears in dropdown and is applied.
  • Switch back to Default → confirm preset-controlled settings reset, but characters / persona / lorebooks / sprites / summary unchanged.
  • Switch to the saved preset → confirm settings restored.
  • Save into the preset (overwrite), Rename, Export (downloads .marinara-chat-preset.json), Import (re-uploads it), Delete (with currently-applied preset → confirm settings reset to default).
  • Repeat for a conversation chat — confirm presets are scoped per-mode.
  • Lorebook test: add a lorebook to a chat, switch presets → lorebook stays.
  • New roleplay → wizard appears with "Use Settings Presets" button between Skip and Next; clicking opens Quick Setup with three pickers.
  • Right-click a character in the Characters panel → "Quick Start Roleplay" / "Quick Start Conversation" → new chat opens with character pre-added, directly on Quick Setup view.
  • Right-click a group member → same menu works.
  • Right-click an imported character in the Browser panel → same menu works.
  • pnpm check passes.

🔄 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/94 **Author:** [@LukaTheHero](https://github.com/LukaTheHero) **Created:** 4/17/2026 **Status:** ✅ Merged **Merged:** 4/17/2026 **Merged by:** [@LukaTheHero](https://github.com/LukaTheHero) **Base:** `main` ← **Head:** `feat/chat-settings-presets` --- ### 📝 Commits (1) - [`a2e638b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a2e638b670f6d7027dc15d59a4e017d696872901) feat(chat): Chat-settings presets + quick-start context menu ### 📊 Changes **18 files changed** (+1462 additions, -62 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+233 -0) 📝 `packages/client/src/components/chat/ChatSetupWizard.tsx` (+319 -59) 📝 `packages/client/src/components/panels/BotBrowserPanel.tsx` (+50 -2) 📝 `packages/client/src/components/panels/CharactersPanel.tsx` (+54 -1) ➕ `packages/client/src/components/ui/ContextMenu.tsx` (+101 -0) ➕ `packages/client/src/hooks/use-chat-presets.ts` (+104 -0) 📝 `packages/client/src/stores/chat.store.ts` (+6 -0) 📝 `packages/server/src/db/migrate.ts` (+11 -0) ➕ `packages/server/src/db/schema/chat-presets.ts` (+20 -0) 📝 `packages/server/src/db/schema/index.ts` (+1 -0) ➕ `packages/server/src/routes/chat-presets.routes.ts` (+159 -0) 📝 `packages/server/src/routes/index.ts` (+2 -0) ➕ `packages/server/src/services/storage/chat-presets.storage.ts` (+306 -0) 📝 `packages/shared/src/index.ts` (+2 -0) ➕ `packages/shared/src/schemas/chat-preset.schema.ts` (+30 -0) ➕ `packages/shared/src/types/chat-preset.ts` (+61 -0) 📝 `packages/shared/src/types/chat.ts` (+2 -0) 📝 `packages/shared/src/types/export.ts` (+1 -0) </details> ### 📄 Description ## Summary Adds a per-mode chat-settings preset system so users don't have to reconfigure every new conversation/roleplay from scratch. A preset bundles a chat's connection, prompt preset, agents, tools, translation, memory recall, advanced parameters, autonomous messaging, and similar reusable settings — and explicitly does **not** touch characters, persona, lorebooks, sprites, summary, tags, or scene prompt (those stay tied to the chat). ## What's new **Preset bar at the top of Chat Settings drawer** - Dropdown of presets for the current mode (conversation / roleplay). - Selecting a preset **immediately applies** its settings to the current chat. Selecting Default resets preset-controlled fields back to system defaults; chat-specific fields are preserved across switches. - One-row of actions: Save, Rename, Save As, Import, Export, Delete. - Default preset is auto-seeded per mode and cannot be renamed, deleted, or saved into. - Deleting the currently-applied preset auto-applies Default so the chat doesn't silently keep the deleted preset's values. - `?` HelpTooltip explains what the preset does and doesn't carry. - Conversation and roleplay each have their own list of presets (no cross-mode bleed). **Wizard** - New "Use Settings Presets" button between Skip and Next opens a Quick Setup view (Preset / Persona / Characters) for one-shot configuration of a new roleplay. **Right-click context menu on character rows** - Characters panel, group members, and the Browser panel all support right-click → "Quick Start Roleplay" / "Quick Start Conversation". - Creates the chat with that character pre-added and lands directly on the Quick Setup view via a new ` shouldOpenWizardInShortcutMode` chat-store flag. - Suppressed in selection mode and group-assignment mode so it doesn't fight those flows. ## New entities - `chat_presets` table (`id`, `name`, `mode`, `is_default`, `is_active`, `settings` JSON, timestamps) — created via the existing idempotent runtime migration in `migrate.ts`. - `/api/chat-presets` routes: list / get / create / update / delete, `PUT /:id/settings` (Save), `POST /:id/duplicate` (Save As), `POST /:id/set-active`, `POST /:id/apply/:chatId`, `GET /:id/export`, `POST /import`. - `ChatPreset`, `ChatPresetSettings` shared types + Zod schemas. - `ContextMenu` reusable UI component (portal-rendered, viewport-clamped, closes on outside click / Escape / scroll / resize). ## Test plan - [x] Open Chat Settings on a roleplay → see preset bar with Default selected, `?` tooltip readable. - [x] Tweak settings (agents, advanced parameters, etc.) → click Save As → name it → confirm new preset appears in dropdown and is applied. - [x] Switch back to Default → confirm preset-controlled settings reset, but characters / persona / lorebooks / sprites / summary unchanged. - [x] Switch to the saved preset → confirm settings restored. - [x] Save into the preset (overwrite), Rename, Export (downloads `.marinara-chat-preset.json`), Import (re-uploads it), Delete (with currently-applied preset → confirm settings reset to default). - [x] Repeat for a conversation chat — confirm presets are scoped per-mode. - [x] Lorebook test: add a lorebook to a chat, switch presets → lorebook stays. - [x] New roleplay → wizard appears with "Use Settings Presets" button between Skip and Next; clicking opens Quick Setup with three pickers. - [x] Right-click a character in the Characters panel → "Quick Start Roleplay" / "Quick Start Conversation" → new chat opens with character pre-added, directly on Quick Setup view. - [x] Right-click a group member → same menu works. - [x] Right-click an imported character in the Browser panel → same menu works. - [x] `pnpm check` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:07:45 +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#4460
No description provided.