[PR #8961] [MERGED] fix(chat-profiles): Saved Settings drop the Author's Note and keep preset variables #8916

Closed
opened 2026-11-08 03:53:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/saved-settings-scope


📝 Commits (3)

  • dd017d5 fix(chat-profiles): keep Author's Notes out of Saved Settings and save preset variables
  • 80ef876 fix(chat-profiles): keep saved preset choices in the wizard, wizard defaults and exports in scope
  • 792a178 fix(scene): plan a scene with the profile's choices for its own preset

📊 Changes

14 files changed (+429 additions, -25 deletions)

View changed files

📝 docs/chats/settings-profiles.md (+5 -4)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+4 -0)
📝 packages/client/src/components/chat/ChatSetupWizard.tsx (+2 -0)
📝 packages/client/src/lib/chat-setup-draft.ts (+3 -0)
📝 packages/client/src/lib/chat-wizard-defaults.ts (+11 -1)
📝 packages/server/src/routes/chat-presets.routes.ts (+3 -2)
📝 packages/server/src/routes/scene.routes.ts (+14 -5)
📝 packages/server/src/services/storage/chat-presets.storage.ts (+33 -3)
📝 packages/shared/src/schemas/chat-preset.schema.ts (+8 -0)
📝 packages/shared/src/types/chat-preset.ts (+27 -3)
📝 scripts/regressions/chat-profile-followers.regression.ts (+4 -3)
➕ scripts/regressions/chat-profile-saved-scope.regression.ts (+241 -0)
📝 scripts/regressions/chat-wizard-defaults.regression.ts (+7 -0)
📝 scripts/regressions/scene-participants.regression.ts (+67 -4)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8957

Why this change

Saved Settings (chat profiles) captured the chat's Author's Note, which belongs to the chat, so applying a profile carried one chat's note into another. They also dropped the preset variable choices, which are part of the prompt setup a profile is meant to keep, so a profile came back with the preset's defaults. The maintainer confirmed both: "1. Not intended. Good catch. 2. We can do that."

What changed

  • Saved Settings no longer copy a chat's Author's Note. Applying a profile keeps the chat's own note. Profiles saved before this change still hold their note, but it is no longer shown, exported or applied.
  • Saved Settings now keep your preset variable choices. Choices you set in Configure Preset Variables are saved with the profile and come back when you apply it, as long as the chat ends up on the same preset.

In detail:

  • Author's Notes. authorNotes and authorNotesDepth are on CHAT_PRESET_EXCLUDED_METADATA_KEYS (chat-preset.ts). Profiles are cleaned when read (rowToPreset), so no migration is needed. Applying a profile, a follower update and the new-chat wizard's copy all keep the chat's own note.
  • Preset variables. These are saved in a new settings.presetVariables: { presetId, choices } field, filled from the chat's prompt preset in the drawer.
    • The server keeps them only while presetId matches the profile's prompt preset (sanitizePresetVariables). Malformed choices are dropped instead of failing the save.
    • chatPresetVariablesFor decides when they apply:
      • When the profile is applied by hand.
      • In a follower update, when the follower already uses the same preset.
      • In a scene, when the scene's preset is the profile's preset.
    • Otherwise, and for older profiles, the chat keeps its own choices.
  • Scene route. applyToChat gains a promptPresetId option, so a scene with its own preset gets that preset in one step and never the profile's choices for a different preset. With no preset picked for the scene, the scene planner uses the profile's saved choices.
  • New-chat wizard. The wizard's copy of an automatic profile apply includes the same choices, so an untouched new chat still counts as empty. The wizard's variable picker now opens on the chat's current choices instead of the preset defaults. This one-line change is outside the literal ask, but without it, clicking Confirm in a new chat from a starred profile overwrote the profile's saved choices. It can be split out if you'd prefer.
  • Wizard defaults unchanged. "Save as defaults for new chats" still keeps the Author's Note, as before. It shared the exclusion list, so both note keys are on its keep-list.
  • Exports. Exported profile files leave out presetVariables, like the persona and lorebook picks. Prompt preset ids are per install, and the released v2.5.2 schema is strict, so it would refuse a file carrying the new field.
  • Docs. docs/chats/settings-profiles.md describes both behaviours. The translated copies are tracked in #8960.

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

Agent runs, for the record (not a substitute for the boxes above):

  • pnpm check exited 0.
  • Regressions passed:
    • New chat-profile-saved-scope (fails on staging at "the profile leaves out the Author's Notes").
    • Updated chat-profile-followers, chat-wizard-defaults and scene-participants.
    • chat-profile-starting-picks, scene- (6/6), profile- (10/10), prompt.regression (9/9), empty-home-chat-setup, chat-local-destination-security and related suites.

Manual verification notes

  • Manually verify: in a Roleplay chat, write an Author's Note and use "Save current chat settings into this profile". Apply that profile to another chat that has a different note, and confirm the second chat's note is unchanged.
  • Manually verify: pick a preset with variables and set choices in "Configure Preset Variables". Save into a profile, apply it to a chat on another preset, then reopen "Edit preset variables" and confirm the saved choices show.
  • Manually verify: "Save and update N other chats" gives the choices to a follower on the same preset, and leaves a follower on a different preset unchanged.
  • Manually verify: in the profile builder (Edit), switch the Prompt preset slot, save and apply. The old preset's choices should not appear on the chat.
  • Manually verify: a profile saved before this change still applies normally and no longer brings its old Author's Note.
  • Manually verify: make a Roleplay profile the default, with a saved choice that isn't the preset's default. Create a new Roleplay chat and click Next at the wizard's preset step. The picker should show the saved choice, and Confirm Choices should keep it.
  • Manually verify: save wizard defaults from a chat with an Author's Note. A new chat should still get the note, and resetting the defaults should remove it.
  • Manually verify: start a scene with Prompt preset set to None while a starred profile with saved choices is active. The scene chat should use the profile's preset and choices. With a different preset picked for the scene, it should not get them.
  • Manually verify: export a profile saved from a chat with a prompt preset. The JSON has no presetVariables, and v2.5.2 imports it.

Docs and release impact

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

docs/chats/settings-profiles.md changed. The translation follow-up is #8960.

UI evidence (if applicable)

No visual change: one picker now opens on the chat's current choices.

🤖 Generated with Claude Code


🔄 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/8961 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/7/2026 **Status:** ✅ Merged **Merged:** 11/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/saved-settings-scope` --- ### 📝 Commits (3) - [`dd017d5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dd017d57bd4b24d148e6939e91d8f19f8f1e3943) fix(chat-profiles): keep Author's Notes out of Saved Settings and save preset variables - [`80ef876`](https://github.com/Pasta-Devs/Marinara-Engine/commit/80ef87683b63cc50d2722532e0405f81f85162f1) fix(chat-profiles): keep saved preset choices in the wizard, wizard defaults and exports in scope - [`792a178`](https://github.com/Pasta-Devs/Marinara-Engine/commit/792a1784a92343b754620e212287f4d06d6784c6) fix(scene): plan a scene with the profile's choices for its own preset ### 📊 Changes **14 files changed** (+429 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `docs/chats/settings-profiles.md` (+5 -4) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+4 -0) 📝 `packages/client/src/components/chat/ChatSetupWizard.tsx` (+2 -0) 📝 `packages/client/src/lib/chat-setup-draft.ts` (+3 -0) 📝 `packages/client/src/lib/chat-wizard-defaults.ts` (+11 -1) 📝 `packages/server/src/routes/chat-presets.routes.ts` (+3 -2) 📝 `packages/server/src/routes/scene.routes.ts` (+14 -5) 📝 `packages/server/src/services/storage/chat-presets.storage.ts` (+33 -3) 📝 `packages/shared/src/schemas/chat-preset.schema.ts` (+8 -0) 📝 `packages/shared/src/types/chat-preset.ts` (+27 -3) 📝 `scripts/regressions/chat-profile-followers.regression.ts` (+4 -3) ➕ `scripts/regressions/chat-profile-saved-scope.regression.ts` (+241 -0) 📝 `scripts/regressions/chat-wizard-defaults.regression.ts` (+7 -0) 📝 `scripts/regressions/scene-participants.regression.ts` (+67 -4) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #8957 ## Why this change Saved Settings (chat profiles) captured the chat's Author's Note, which belongs to the chat, so applying a profile carried one chat's note into another. They also dropped the preset variable choices, which are part of the prompt setup a profile is meant to keep, so a profile came back with the preset's defaults. The maintainer confirmed both: "1. Not intended. Good catch. 2. We can do that." ## What changed - **Saved Settings no longer copy a chat's Author's Note.** Applying a profile keeps the chat's own note. Profiles saved before this change still hold their note, but it is no longer shown, exported or applied. - **Saved Settings now keep your preset variable choices.** Choices you set in **Configure Preset Variables** are saved with the profile and come back when you apply it, as long as the chat ends up on the same preset. In detail: - **Author's Notes.** `authorNotes` and `authorNotesDepth` are on `CHAT_PRESET_EXCLUDED_METADATA_KEYS` (`chat-preset.ts`). Profiles are cleaned when read (`rowToPreset`), so no migration is needed. Applying a profile, a follower update and the new-chat wizard's copy all keep the chat's own note. - **Preset variables.** These are saved in a new `settings.presetVariables: { presetId, choices }` field, filled from the chat's prompt preset in the drawer. - The server keeps them only while `presetId` matches the profile's prompt preset (`sanitizePresetVariables`). Malformed choices are dropped instead of failing the save. - `chatPresetVariablesFor` decides when they apply: - When the profile is applied by hand. - In a follower update, when the follower already uses the same preset. - In a scene, when the scene's preset is the profile's preset. - Otherwise, and for older profiles, the chat keeps its own choices. - **Scene route.** `applyToChat` gains a `promptPresetId` option, so a scene with its own preset gets that preset in one step and never the profile's choices for a different preset. With no preset picked for the scene, the scene planner uses the profile's saved choices. - **New-chat wizard.** The wizard's copy of an automatic profile apply includes the same choices, so an untouched new chat still counts as empty. The wizard's variable picker now opens on the chat's current choices instead of the preset defaults. This one-line change is outside the literal ask, but without it, clicking Confirm in a new chat from a starred profile overwrote the profile's saved choices. It can be split out if you'd prefer. - **Wizard defaults unchanged.** "Save as defaults for new chats" still keeps the Author's Note, as before. It shared the exclusion list, so both note keys are on its keep-list. - **Exports.** Exported profile files leave out `presetVariables`, like the persona and lorebook picks. Prompt preset ids are per install, and the released v2.5.2 schema is strict, so it would refuse a file carrying the new field. - **Docs.** `docs/chats/settings-profiles.md` describes both behaviours. The translated copies are tracked in #8960. ## 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` Agent runs, for the record (not a substitute for the boxes above): - `pnpm check` exited 0. - Regressions passed: - New `chat-profile-saved-scope` (fails on staging at "the profile leaves out the Author's Notes"). - Updated `chat-profile-followers`, `chat-wizard-defaults` and `scene-participants`. - `chat-profile-starting-picks`, `scene-` (6/6), `profile-` (10/10), `prompt.regression` (9/9), `empty-home-chat-setup`, `chat-local-destination-security` and related suites. ### Manual verification notes - Manually verify: in a Roleplay chat, write an Author's Note and use "Save current chat settings into this profile". Apply that profile to another chat that has a different note, and confirm the second chat's note is unchanged. - Manually verify: pick a preset with variables and set choices in "Configure Preset Variables". Save into a profile, apply it to a chat on another preset, then reopen "Edit preset variables" and confirm the saved choices show. - Manually verify: "Save and update N other chats" gives the choices to a follower on the same preset, and leaves a follower on a different preset unchanged. - Manually verify: in the profile builder (Edit), switch the Prompt preset slot, save and apply. The old preset's choices should not appear on the chat. - Manually verify: a profile saved before this change still applies normally and no longer brings its old Author's Note. - Manually verify: make a Roleplay profile the default, with a saved choice that isn't the preset's default. Create a new Roleplay chat and click Next at the wizard's preset step. The picker should show the saved choice, and Confirm Choices should keep it. - Manually verify: save wizard defaults from a chat with an Author's Note. A new chat should still get the note, and resetting the defaults should remove it. - Manually verify: start a scene with **Prompt preset** set to **None** while a starred profile with saved choices is active. The scene chat should use the profile's preset and choices. With a different preset picked for the scene, it should not get them. - Manually verify: export a profile saved from a chat with a prompt preset. The JSON has no `presetVariables`, and v2.5.2 imports it. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) `docs/chats/settings-profiles.md` changed. The translation follow-up is #8960. ## UI evidence (if applicable) No visual change: one picker now opens on the chat's current choices. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi changed title from [PR #8961] fix(chat-profiles): Saved Settings drop the Author's Note and keep preset variables to [PR #8961] [MERGED] fix(chat-profiles): Saved Settings drop the Author's Note and keep preset variables 2026-11-08 04:56:05 +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#8916
No description provided.