mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7799] [MERGED] feat(onboarding): Chat Settings persona and question paths, and drop a removed card's variables #7929
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7929
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7799
Author: @ylli-selmani
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/onboarding-followups📝 Commits (8)
5b32735fix(onboarding): drop a removed card's chat variables (#7795)2adcfaafeat(onboarding): create a persona from the Chat Settings picker (#7796)0465bf1feat(onboarding): answer one card's character questions from Chat Settings (#7797)0797d85fix(onboarding): open the questions window on the chat's saved answers (#7797)387d531docs(onboarding): a shared name is one value, even after setup (#7797)4dc545ffix(onboarding): keep the questions window on a failed save, and re-check the roster before dropping835b7c8fix(onboarding): keep a re-added card's answers when the removal cleanup runsa9d63d3test(onboarding): pin the wizard's shared parse instead of its old private one📊 Changes
10 files changed (+771 additions, -54 deletions)
View changed files
📝
docs/characters/choosing-your-persona.md(+3 -1)📝
docs/characters/interactive-onboarding.md(+7 -1)📝
packages/client/src/components/characters/CharacterOnboardingModal.tsx(+30 -1)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+247 -0)📝
packages/client/src/components/chat/ChatSetupWizard.tsx(+8 -37)📝
packages/client/src/localization/locales/en.json(+1 -0)📝
packages/server/src/routes/chats.routes.ts(+83 -13)📝
packages/shared/src/utils/onboarding.ts(+174 -0)➕
scripts/regressions/onboarding-followups.regression.ts(+206 -0)📝
scripts/regressions/onboarding-s1.regression.ts(+12 -1)📄 Description
Linked issue
Closes #7795
Closes #7796
Closes #7797
Why this change
What changed
PATCH /chats/:iddrops the chat variables that the leaving card's enabled character questions declare, unless another character still in the chat declares the same name (a shared name keeps its value, because the remaining card reads it). A card whose onboarding is switched off owns nothing; a remaining card's declaration protects a name even if that block is switched off, since its card fields can still read it. This is the requested cleanup: a removed card's answers no longer survive by accident.canBuildPersonarule, as the wizard. Picking one opens the existing questions window with persona questions only, so it can never replace character-question answers with first-option defaults. Create persona saves the persona and sets it on this chat.readCardOnboarding(shared) now reads a card's onboarding block, unique ids and the five card fields for the server seeding, the server removal, the wizard and the drawer, so the four surfaces cannot drift. The route returns the patched row, because the client caches the response.answersFromStoredValues(shared) rebuilds a card's answers from the chat's variables — a choice by option value, or by its label when the value is blank, free text as typed, a multi-select split by its separator — so the window opens on them instead of on every question's first option. A stored value the current options cannot express renders unselected and is not written, so an untouched save cannot replace it; the route merges chat variables per name (null deletes), so nothing else on the chat is lost either.scripts/regressions/onboarding-followups.regression.tspins the card parse (both storage shapes, unique ids, unreadable data) and the removal rule (shared name kept, disabled leaver owns nothing, disabled stayer still protects, duplicates, unstorable names).Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run on this branch's own worktree (dev stack on port 6993; UI reached through the Vite dev server). The boxes above are still a to-do list for a human.
pnpm check— exit 0 (impeccable, localization 14,788 keys, format, lint, type checks, full build).node ./scripts/run-regressions.mjs --filter onboarding-followups— 1/1 passed.bond+rank, and a second card declaring onlyrank):rank = scoutandbond = an old friendbefore any question was saved — the reported starting point.bondand keptrank(the remaining card declares it). Re-adding seededbondagain. Removing every declarer leftmacroVariables = {}.personaIdpoints at it. Its description and personality match the template exactly (Name: Lollipop Man,Role: ranger,A ranger of the guild.).h-5 w-5, same hover treatment), but nobody clicked them on a phone.Review rounds
Local CodeRabbit (CLI 0.8.2), two runs inside the free hourly quota:
--committed --base origin/staging) — 1 major: the questions window started every question on its first option, andmergeCardVariableswrites every name the window asked, so saving one edited answer rewrote the ones nobody touched. Verified real; fixed in0797d8594(answersFromStoredValues, plus the "open, save, nothing changed" round trip in the regression).--committed --base 0465bf1d1) — 1 major, 1 minor:useUpdateChatMetadata/PATCH /chats/:id/metadatareplacesmacroVariables. The route merges per name ({ ...saved, ...changedValues },nullremoves one name) and returns the patched row, so other cards' variables and any value this window did not write are retained. No change made.387d531e7.GitHub CodeRabbit on the first push (2 actionable comments, both verified and fixed in
4dc545fbc):PATCHdiscarded the answers the player had just typed. The write now happens first; on failure the toast shows and the window stays open with its edits for a retry. Nothing is created on that path, so a retry is safe (unlike the persona path, which closes first on purpose).PATCHcould add a card declaring one of them in between and lose that card's answer. The decision now happens inside the chat's metadata queue, from the roster read there; a card added after that read is still safe because its own seeding patch is queued behind the cleanup. The rule itself is unchanged and remains pinned by the regression — this is about when it runs, and the guarantee is the per-chat serializationchats.storage.tsdocuments.Second GitHub round, on that fix (1 actionable comment, fixed in
835b7c81c):PATCHwas skipped and its saved answers deleted. The live roster already is the remaining set, so the filter is gone; a re-added card protects the names it declares, and in the ordinary case the removed card is not in that roster anyway.Third GitHub round, on
835b7c81c: no actionable comments (its two replies on the earlier threads only acknowledge the fixes). A fourth, on the regression-pin commit, also reported none.CI caught one stale proof:
complete-node-regressionsfailed ononboarding-s1, whose last assertion matched the wizard callingwithUniqueOnboardingIds(parsed.data…)itself — exactly the private parse this PR replaced with sharedreadCardOnboarding. 920/921 passed with that as the only failure; the pin now follows the shared parse (a9d63d3d0), and the uniqueness half stays pinned where the parse lives.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Extended the open
[docs-i18n]issue #7781 with every doc change from this PR (no new issue).UI evidence (if applicable)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.