mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7308] [MERGED] feat: interactive onboarding - character cards can build the player's persona from questions #7675
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#7675
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/7308
Author: @ylli-selmani
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/interactive-onboarding📝 Commits (10+)
73f9b1ffeat(characters): store an onboarding block on character cards4f22328feat(shared): resolve onboarding answers into a persona0fa796arefactor(presets): move the variables editor into its own fileb66692drefactor(presets): drive the variables editor through callbacksa1ba2abfix(shared): flag unknown onboarding names, accept {{else if}}2170232feat(characters): author onboarding in the character editor0ca7afarefactor(presets): share the choice options fielde044e85feat(chat): run a character's onboarding during roleplay setup1c25a49feat(onboarding): pick the onboarding as a persona instead of always asking11d56bbfeat(onboarding): option help text and the variable name in the questions📊 Changes
25 files changed (+3805 additions, -1406 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/characters/choosing-your-persona.md(+3 -0)📝
docs/characters/creating-and-editing-characters.md(+3 -1)📝
docs/characters/import-export.md(+2 -0)➕
docs/characters/interactive-onboarding.md(+83 -0)📝
packages/client/src/components/characters/CharacterEditor.tsx(+443 -2)➕
packages/client/src/components/characters/CharacterOnboardingModal.tsx(+223 -0)📝
packages/client/src/components/chat/ChatSetupWizard.tsx(+183 -11)➕
packages/client/src/components/presets/ChoiceOptionsField.tsx(+210 -0)📝
packages/client/src/components/presets/ChoiceSelectionModal.tsx(+9 -180)📝
packages/client/src/components/presets/PresetEditor.tsx(+17 -1200)➕
packages/client/src/components/presets/PresetVariablesEditor.tsx(+1342 -0)📝
packages/client/src/localization/locales/en.json(+48 -0)📝
packages/server/src/routes/characters.routes.ts(+13 -2)📝
packages/server/src/routes/chats.routes.ts(+2 -1)📝
packages/server/src/services/chat-user-identity.ts(+2 -1)📝
packages/server/src/services/import/marinara.importer.ts(+14 -1)📝
packages/server/src/services/import/st-character.importer.ts(+15 -2)📝
packages/shared/src/index.ts(+1 -0)📝
packages/shared/src/schemas/character.schema.ts(+44 -0)...and 5 more files
📄 Description
Linked issue
Closes #7307
Why this change
What changed
Card data: optional
extensions.onboarding(no DB column, no storage-format change). Marinara Native and Compatible PNG exports keep it; Compatible JSON drops it so it stays a clean V2 card.Shared logic (
packages/shared/src/utils/onboarding.ts): resolves the five fields once with the existing macro engine ({{user}}/{{char}}stay live). Asks only the questions the answers make relevant (a question inside an{{#if}}branch the answers rule out is not asked). Validates names (empty, invalid, duplicate, built-in macro, unused, unknown,{{if}}without#).Character Editor → new Onboarding tab: switch, short tutorial, questions (reusing the preset variable editor, moved verbatim into
PresetVariablesEditor), the five persona fields with "Available variables" chips that insert at the caret, inline warnings, and a rendered preview with example answers. A blank option value uses its label, and options can carry help text for players.Roleplay new chat wizard: cards with onboarding are marked in the character list. Each chosen one adds a Create your persona row to the persona picker. Only picking that row asks the questions (a modal reusing the preset choice field, extracted as
ChoiceOptionsField), then creates and selects a normal persona. Questions resolve earlier answers live ("What does Mari look like?").Docs: new
docs/characters/interactive-onboarding.md, linked from the character, persona and import/export guides. CHANGELOG entry.Regressions:
onboarding-s1(schema, export policy),onboarding-s2(resolver, relevance, validator, question text).Preset choice window (shared
ChoiceOptionsField), two small improvements for presets too: an option's value is hidden when it only repeats the label (case-insensitive), and a dropdown shows a blank row instead of the first option when nothing in the list is selected. The calmer warning style (accent icon,role="status", no Accent Pulse) in the sharedPresetVariablesEditorapplies to the preset editor too.Question cap: a card can have up to 100 questions. The editor disables Add Question at the cap, and imports keep the first 100. Questions also resolve in one shared pass (10,000 in ~170 ms), so the Character Editor and the questions window stay responsive (#7308 review).
Not in this PR (documented as "not yet"): Quick Start, the Conversation wizard, and starting a chat straight from a character card.
Reviewing the diff: about 1,380 of the ~1,400 deleted lines are moves, not removals. The preset variable editor moved verbatim from
PresetEditor.tsx(−1200) intoPresetVariablesEditor.tsx(refactor commit0fa796ac0; the onboarding variant comes in a later commit). The choice options field moved fromChoiceSelectionModal.tsx(−180) intoChoiceOptionsField.tsx(0ca7afa8a). Reviewing commit by commit, or withgit diff --color-moved, shows the moves as moves. The preset editor behaves as before; the preset choice window only gains the two improvements listed above.Local results (agent run, for reference — the checkboxes below are still yours)
pnpm check: passed.stagingd63d559fd.onboarding.c6ba778ed, checked in the browser).{{name}}/{{#if name}}references and counts option values too (33c81f64a, regression added).ca7309905, editor re-probed).type="button"(ca7309905).currentOptsfalls back to stale props when the option ref is empty" in the moved preset editor. That only happens if the ref is empty while props still hold options. Presets can't delete their last option, and onboarding re-renders with[]before any further click, so the fallback never returns stale data.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Please verify in a browser:
{{name}}in a field (click a chip under the focused field to insert it). Check that the warnings and the rendered preview update.{{user}}/{{char}}stay as macros, and the greeting shows the new name.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
I took a ton of screenshots, so I'll try and order them nicely.
Card-Author-Facing Side
collapsed when off
Expanded when on - Visible Questions Editor - Tutorial
Expanded Questions Variable Editor - Visible Inputs
Questions Variable Editor - Two Guards - One for built in macros, another for not used in chat yet
Available Variables Helper - Inspired from Prompt Override Editor
Warning for missing or misspelled variables
Nested Questions with if macros
User-Facing Side
New Button when Onboarding Card is selected - Marker on Cards with it enabled
Questions Modal on following step (re-used from preset config) - Different Ways to Answer
Sub Question, which popped up after selecting 'Yes'
New Persona Created based on template - Question Variables resolved and saved as plain text - rest stayed as it
Light Mode and Mobile
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.