[PR #4211] [MERGED] Add saved Impersonate prompt templates #6284

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

📋 Pull Request Information

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

Base: staging ← Head: feat/impersonate-prompt-templates


📝 Commits (4)

  • ab60582 Improve Impersonate drawer navigation
  • 9f9536e Add server-backed Impersonate prompt templates
  • 687899a Address prompt template review feedback
  • c6f5ce0 Merge branch 'staging' into feat/impersonate-prompt-templates

📊 Changes

14 files changed (+643 additions, -66 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+15 -2)
📝 packages/client/src/components/panels/settings/SettingControls.tsx (+4 -1)
📝 packages/client/src/components/ui/ExpandedTextarea.tsx (+5 -1)
📝 packages/client/src/features/chat-settings/ChatSettingsSection.tsx (+3 -1)
➕ packages/client/src/features/chat-settings/sections/ImpersonatePromptTemplateField.tsx (+352 -0)
📝 packages/client/src/features/chat-settings/sections/ImpersonateSection.tsx (+49 -58)
➕ packages/client/src/hooks/use-impersonate-prompt-templates.ts (+74 -0)
📝 packages/client/src/hooks/use-settings-sync.ts (+7 -1)
📝 packages/client/src/localization/locales/en.json (+32 -1)
📝 packages/client/src/stores/ui.store.ts (+18 -1)
📝 packages/server/src/routes/app-settings.routes.ts (+21 -0)
📝 packages/shared/src/index.ts (+1 -0)
➕ packages/shared/src/schemas/impersonate-prompt-templates.schema.ts (+61 -0)

📄 Description

Linked issue

Closes #4210

Why this change

Impersonate supports one working prompt, which makes switching between reusable character-writing instructions awkward. Saved templates should follow the user across browsers while the selected template and unfinished draft stay local to the current browser.

What changed

  • Added a validated, server-backed catalog for named Impersonate prompt templates.
  • Added Built-in default, standalone draft, Save As, update, reset, delete, retry, and full-screen editing flows.
  • Kept the active selection and working prompt browser-local instead of coupling them to generic synced settings or profile import logic.
  • Added same-browser mutation guards so closing and reopening Chat Settings cannot enable overlapping catalog saves or allow stale reads to replace a successful save.
  • Added a direct Quick Replies settings link and updated the changelog.

The catalog deliberately uses whole-catalog last-write-wins behavior across separate browsers. Simultaneous multi-browser editing is outside the intended single-user workflow.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • pnpm check passed locally. It reported one existing React Hooks warning in NoodleHome.tsx and no errors.
  • pnpm regression:prompt passed.
  • Targeted shared, client, and server TypeScript checks passed.
  • Localization validation passed.
  • The contributor exercised catalog loading and saving in the development app; the stored catalog was verified as strict version-1 data.
  • pnpm smoke:ui did not reach its tests because the isolated Playwright web server exceeded its configured 180-second startup timeout. No Playwright feature assertion ran or failed.
  • Light theme, mobile viewport, container build, and comprehensive error-path verification remain manual follow-ups.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

CHANGELOG.md is updated. No version, installation, launcher, platform, or translated-guide changes are required.

UI evidence (if applicable)

image

Summary by CodeRabbit

  • New Features
    • Added server-backed Impersonate prompt templates shared across browsers.
    • Users can select, edit, save, duplicate, reset, and delete templates.
    • Built-in defaults can be previewed read-only and copied for editing.
    • Added validation, loading states, error recovery, and confirmation prompts.
    • Added a shortcut from Impersonate settings to Quick Replies settings.
  • Improvements
    • Enhanced settings navigation to jump directly to Quick Replies.
    • Improved help tooltip placement within settings controls.

🔄 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/4211 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 7/28/2026 **Status:** ✅ Merged **Merged:** 7/28/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/impersonate-prompt-templates` --- ### 📝 Commits (4) - [`ab60582`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ab60582a70897d13fe7e6c5ffd0a7f007ecb2cd8) Improve Impersonate drawer navigation - [`9f9536e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9f9536e8e333e92c4e265faa0644b35e9559cdb8) Add server-backed Impersonate prompt templates - [`687899a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/687899a75553d7b982f0ff5a8fe4c1aa6a003d79) Address prompt template review feedback - [`c6f5ce0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c6f5ce028da6f9c9a909bd263a7c209360d9e981) Merge branch 'staging' into feat/impersonate-prompt-templates ### 📊 Changes **14 files changed** (+643 additions, -66 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+15 -2) 📝 `packages/client/src/components/panels/settings/SettingControls.tsx` (+4 -1) 📝 `packages/client/src/components/ui/ExpandedTextarea.tsx` (+5 -1) 📝 `packages/client/src/features/chat-settings/ChatSettingsSection.tsx` (+3 -1) ➕ `packages/client/src/features/chat-settings/sections/ImpersonatePromptTemplateField.tsx` (+352 -0) 📝 `packages/client/src/features/chat-settings/sections/ImpersonateSection.tsx` (+49 -58) ➕ `packages/client/src/hooks/use-impersonate-prompt-templates.ts` (+74 -0) 📝 `packages/client/src/hooks/use-settings-sync.ts` (+7 -1) 📝 `packages/client/src/localization/locales/en.json` (+32 -1) 📝 `packages/client/src/stores/ui.store.ts` (+18 -1) 📝 `packages/server/src/routes/app-settings.routes.ts` (+21 -0) 📝 `packages/shared/src/index.ts` (+1 -0) ➕ `packages/shared/src/schemas/impersonate-prompt-templates.schema.ts` (+61 -0) </details> ### 📄 Description ## Linked issue Closes #4210 ## Why this change Impersonate supports one working prompt, which makes switching between reusable character-writing instructions awkward. Saved templates should follow the user across browsers while the selected template and unfinished draft stay local to the current browser. ## What changed - Added a validated, server-backed catalog for named Impersonate prompt templates. - Added Built-in default, standalone draft, Save As, update, reset, delete, retry, and full-screen editing flows. - Kept the active selection and working prompt browser-local instead of coupling them to generic synced settings or profile import logic. - Added same-browser mutation guards so closing and reopening Chat Settings cannot enable overlapping catalog saves or allow stale reads to replace a successful save. - Added a direct Quick Replies settings link and updated the changelog. The catalog deliberately uses whole-catalog last-write-wins behavior across separate browsers. Simultaneous multi-browser editing is outside the intended single-user workflow. ## Validation - [x] pnpm check passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [x] Read and followed CONTRIBUTING.md ### Manual verification notes - pnpm check passed locally. It reported one existing React Hooks warning in NoodleHome.tsx and no errors. - pnpm regression:prompt passed. - Targeted shared, client, and server TypeScript checks passed. - Localization validation passed. - The contributor exercised catalog loading and saving in the development app; the stored catalog was verified as strict version-1 data. - pnpm smoke:ui did not reach its tests because the isolated Playwright web server exceeded its configured 180-second startup timeout. No Playwright feature assertion ran or failed. - Light theme, mobile viewport, container build, and comprehensive error-path verification remain manual follow-ups. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) CHANGELOG.md is updated. No version, installation, launcher, platform, or translated-guide changes are required. ## UI evidence (if applicable) <img width="842" height="688" alt="image" src="https://github.com/user-attachments/assets/2bfa3ef7-20db-4159-8fc2-c36cb42e31c4" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added server-backed Impersonate prompt templates shared across browsers. * Users can select, edit, save, duplicate, reset, and delete templates. * Built-in defaults can be previewed read-only and copied for editing. * Added validation, loading states, error recovery, and confirmation prompts. * Added a shortcut from Impersonate settings to Quick Replies settings. * **Improvements** * Enhanced settings navigation to jump directly to Quick Replies. * Improved help tooltip placement within settings controls. <!-- 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:56 +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#6284
No description provided.