[PR #7778] [MERGED] feat(onboarding): review the persona your answers create before committing #7925

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7778
Author: @ylli-selmani
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/18/2026
Merged by: @ylli-selmani

Base: staging ← Head: feat/onboarding-persona-review


📝 Commits (3)

  • 27afa76 feat(onboarding): review the persona your answers create before committing
  • b6e8ffa fix(onboarding): keep the Name row visible and highlight the answers in the preview
  • e56a0b1 fix(onboarding): only treat an answer as authored text when it is a whole word

📊 Changes

8 files changed (+465 additions, -168 deletions)

View changed files

📝 docs/characters/interactive-onboarding.md (+2 -1)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+1 -40)
📝 packages/client/src/components/characters/CharacterOnboardingModal.tsx (+256 -127)
➕ packages/client/src/components/characters/onboarding-field-copy.ts (+52 -0)
➕ packages/client/src/lib/onboarding-preview-highlight.ts (+83 -0)
📝 packages/client/src/localization/locales/en.json (+7 -0)
➕ scripts/regressions/onboarding-preview-highlight.regression.ts (+63 -0)
📝 scripts/regressions/tsconfig.client-lanes.json (+1 -0)

📄 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 #7777

Why this change

  • Interactive onboarding builds a persona from the card author's five-field template, but the questions window only gave the player the answers to pick. Nothing showed what the template permanently carries (a relationship, a backstory hook, an appearance line) or how the answers read inside it, so the only way to see the persona was to finish setup and open it in the editor afterwards.

What changed

  • A new Review persona button at the bottom of the onboarding questions window, beside Back and Create persona, shown only when a persona is actually being created. It opens a small read-only window with the name and the five Card fields exactly as Create persona will save them, resolved from the current answers. Nothing is written until Create persona; the button changes no behaviour on its own.
  • The parts your answers filled in are highlighted inside each field, with a one-line legend, so the card author's static prose reads differently from the player's own words. A word the card itself writes in that field (for example inside a {{#if}} branch) stays plain: the highlight only ever claims text the answers inserted.
  • The Name row is always listed, even when a card's template does not repeat it with Name: {{player}}, so the persona's own name is visible without reading the description. Before the player types one it reads "Not answered yet." instead of disappearing.
  • The preview calls the same resolveOnboardingPersona the save path calls, so the two cannot drift apart.
  • Field labels are shared: the five field titles move from CharacterEditor.tsx into characters/onboarding-field-copy.ts, so the setup-wizard chunk can reuse them without pulling the lazy-loaded Character Editor into it.
  • Docs: one new step in "Answering the questions as a player" in docs/characters/interactive-onboarding.md.

Design notes

  • A second modal, not an inline panel. The inline option pushed Create persona far below the question list and competed with it. The modal primitive already stacks overlays and gives Escape/back to the topmost one, so closing the preview returns to the questions with every answer intact.
  • Only fields with text are listed. Empty template fields would be saved empty, so listing "nothing" for them would only add noise. The Name is the exception: a persona always has one, so its row is always shown, with a placeholder until the player answers.
  • Partial preview is intentional. The button works before every answer is filled, so a player can see the template early; Create persona stays disabled until the same completeness check as before.
  • Highlighting is value matching, not engine spans. The resolver returns only finished text, so an answer is recognized by its value and only where that value does not also occur in the card's own text for the field. That keeps the highlight from ever marking an author's word; the ceiling (an answer that genuinely repeats within one field is marked at both places) is noted in a ponytail: comment with the upgrade path.
  • Secondary button look follows the State Editor's SECONDARY_BUTTON (bg --secondary, 1px --border ring, --accent hover), adapted to this window's rounded-xl.

Known limitations / follow-ups

  • Highlighting matches answer values in the resolved text, not engine spans; the documented ceiling is that an answer genuinely repeated inside one field is marked at both places.
  • Translated docs: #7781 tracks adding the new guide step to the docs-i18n language packs.

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

Local results (agent-run):

  • pnpm check: exit 0 (one pre-existing HomeProfessorMariChat exhaustive-deps warning, unrelated).
  • pnpm localization:check: exit 0, 6 new canonical keys, no untranslated UI strings.
  • node scripts/run-regressions.mjs --filter onboarding-preview-highlight: 1/1 passed. The regression pins that inserted answers are marked, a word the card also writes in that field is never marked, matches are whole values rather than substrings, the longest value wins, and the segments always rebuild the resolved text.
  • Browser run on a worktree dev server (port 6985) with a demo card carrying persona questions:
    • The questions window's footer shows Review persona on the left and Back / Create persona on the right.
    • The preview lists Name plus the populated Description, Personality, Backstory, Appearance and Scenario, with {{#if}} branches resolved from the answers.
    • The answer words are <mark>-highlighted in every field where the card only inserts them, and the fields where the card writes the same word itself stay plain; the legend line is present.
    • Created the persona through Create persona; the saved persona matched the preview word for word (name, all five fields).
    • Repeated the preview in dark and light theme, and with the name still empty (Name row reads "Not answered yet.").
    • Clicked Close in the preview and confirmed the questions window kept its answers.

To verify by hand:

  • Manually verify: start a Roleplay chat, pick a card with onboarding, choose Create your persona, answer a couple of questions, then click Review persona and check the text matches the card's template with the answers filled in.
  • Manually verify: in the preview, the words you typed or picked are highlighted, while the card's own sentences are not.
  • Manually verify: change an answer (for example a {{#if}} condition) and re-open the preview; the affected field should change.
  • Manually verify: on a narrow/mobile window the three footer buttons wrap without overlapping.
  • Manually verify: a card that only has Character Questions shows no Review persona button.

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)

UI evidence (if applicable)

The questions footer with the new button, and the preview in dark and light theme (demo card: Seraphine; answers: Ylli, ranger, Crown, dragons, knows Seraphine, tall and sharp-featured, stolen ledger). The player's words carry a soft accent wash.

Questions window footer: Review persona on the left, then Back and Create persona Review persona window in dark mode: name and five resolved fields, with the player's words highlighted Review persona window in light mode: highlighted answer words inside the fields

🤖 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/7778 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/18/2026 **Merged by:** [@ylli-selmani](https://github.com/ylli-selmani) **Base:** `staging` ← **Head:** `feat/onboarding-persona-review` --- ### 📝 Commits (3) - [`27afa76`](https://github.com/Pasta-Devs/Marinara-Engine/commit/27afa76cdadc4da4d7088a5126c52ca24499d56d) feat(onboarding): review the persona your answers create before committing - [`b6e8ffa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b6e8ffa22099eab0193ce65d924268f9594ed620) fix(onboarding): keep the Name row visible and highlight the answers in the preview - [`e56a0b1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e56a0b1ea65c67c8003e2ec18ed000d0c6b4364f) fix(onboarding): only treat an answer as authored text when it is a whole word ### 📊 Changes **8 files changed** (+465 additions, -168 deletions) <details> <summary>View changed files</summary> 📝 `docs/characters/interactive-onboarding.md` (+2 -1) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+1 -40) 📝 `packages/client/src/components/characters/CharacterOnboardingModal.tsx` (+256 -127) ➕ `packages/client/src/components/characters/onboarding-field-copy.ts` (+52 -0) ➕ `packages/client/src/lib/onboarding-preview-highlight.ts` (+83 -0) 📝 `packages/client/src/localization/locales/en.json` (+7 -0) ➕ `scripts/regressions/onboarding-preview-highlight.regression.ts` (+63 -0) 📝 `scripts/regressions/tsconfig.client-lanes.json` (+1 -0) </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 #7777 ## Why this change - Interactive onboarding builds a persona from the card author's five-field template, but the questions window only gave the player the answers to pick. Nothing showed what the template permanently carries (a relationship, a backstory hook, an appearance line) or how the answers read inside it, so the only way to see the persona was to finish setup and open it in the editor afterwards. ## What changed - **A new Review persona button at the bottom of the onboarding questions window**, beside Back and Create persona, shown only when a persona is actually being created. It opens a small read-only window with the name and the five Card fields exactly as Create persona will save them, resolved from the current answers. Nothing is written until Create persona; the button changes no behaviour on its own. - **The parts your answers filled in are highlighted** inside each field, with a one-line legend, so the card author's static prose reads differently from the player's own words. A word the card itself writes in that field (for example inside a `{{#if}}` branch) stays plain: the highlight only ever claims text the answers inserted. - **The Name row is always listed**, even when a card's template does not repeat it with `Name: {{player}}`, so the persona's own name is visible without reading the description. Before the player types one it reads "Not answered yet." instead of disappearing. - The preview calls the same `resolveOnboardingPersona` the save path calls, so the two cannot drift apart. - **Field labels are shared:** the five field titles move from `CharacterEditor.tsx` into `characters/onboarding-field-copy.ts`, so the setup-wizard chunk can reuse them without pulling the lazy-loaded Character Editor into it. - **Docs:** one new step in "Answering the questions as a player" in `docs/characters/interactive-onboarding.md`. ### Design notes - **A second modal, not an inline panel.** The inline option pushed Create persona far below the question list and competed with it. The modal primitive already stacks overlays and gives Escape/back to the topmost one, so closing the preview returns to the questions with every answer intact. - **Only fields with text are listed.** Empty template fields would be saved empty, so listing "nothing" for them would only add noise. The Name is the exception: a persona always has one, so its row is always shown, with a placeholder until the player answers. - **Partial preview is intentional.** The button works before every answer is filled, so a player can see the template early; Create persona stays disabled until the same completeness check as before. - **Highlighting is value matching, not engine spans.** The resolver returns only finished text, so an answer is recognized by its value and only where that value does not also occur in the card's own text for the field. That keeps the highlight from ever marking an author's word; the ceiling (an answer that genuinely repeats within one field is marked at both places) is noted in a `ponytail:` comment with the upgrade path. - **Secondary button look** follows the State Editor's `SECONDARY_BUTTON` (bg `--secondary`, 1px `--border` ring, `--accent` hover), adapted to this window's `rounded-xl`. ### Known limitations / follow-ups - Highlighting matches answer values in the resolved text, not engine spans; the documented ceiling is that an answer genuinely repeated inside one field is marked at both places. - Translated docs: #7781 tracks adding the new guide step to the `docs-i18n` language packs. ## 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 Local results (agent-run): - `pnpm check`: exit 0 (one pre-existing `HomeProfessorMariChat` exhaustive-deps warning, unrelated). - `pnpm localization:check`: exit 0, 6 new canonical keys, no untranslated UI strings. - `node scripts/run-regressions.mjs --filter onboarding-preview-highlight`: 1/1 passed. The regression pins that inserted answers are marked, a word the card also writes in that field is never marked, matches are whole values rather than substrings, the longest value wins, and the segments always rebuild the resolved text. - Browser run on a worktree dev server (port 6985) with a demo card carrying persona questions: - The questions window's footer shows **Review persona** on the left and Back / Create persona on the right. - The preview lists Name plus the populated Description, Personality, Backstory, Appearance and Scenario, with `{{#if}}` branches resolved from the answers. - The answer words are `<mark>`-highlighted in every field where the card only inserts them, and the fields where the card writes the same word itself stay plain; the legend line is present. - Created the persona through **Create persona**; the saved persona matched the preview word for word (name, all five fields). - Repeated the preview in dark and light theme, and with the name still empty (Name row reads "Not answered yet."). - Clicked **Close** in the preview and confirmed the questions window kept its answers. To verify by hand: - Manually verify: start a Roleplay chat, pick a card with onboarding, choose **Create your persona**, answer a couple of questions, then click **Review persona** and check the text matches the card's template with the answers filled in. - Manually verify: in the preview, the words you typed or picked are highlighted, while the card's own sentences are not. - Manually verify: change an answer (for example a `{{#if}}` condition) and re-open the preview; the affected field should change. - Manually verify: on a narrow/mobile window the three footer buttons wrap without overlapping. - Manually verify: a card that only has Character Questions shows no Review persona button. ## 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) ## UI evidence (if applicable) The questions footer with the new button, and the preview in dark and light theme (demo card: Seraphine; answers: Ylli, ranger, Crown, dragons, knows Seraphine, tall and sharp-featured, stolen ledger). The player's words carry a soft accent wash. <img src="https://raw.githubusercontent.com/ylli-selmani/Marinara-Engine-Ylli-Edits/pr-assets/pr-assets/onboarding-persona-review/footer-dark.png" width="720" alt="Questions window footer: Review persona on the left, then Back and Create persona"> <img src="https://raw.githubusercontent.com/ylli-selmani/Marinara-Engine-Ylli-Edits/pr-assets/pr-assets/onboarding-persona-review/review-dark.png" width="720" alt="Review persona window in dark mode: name and five resolved fields, with the player's words highlighted"> <img src="https://raw.githubusercontent.com/ylli-selmani/Marinara-Engine-Ylli-Edits/pr-assets/pr-assets/onboarding-persona-review/review-light.png" width="720" alt="Review persona window in light mode: highlighted answer words inside the fields"> 🤖 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 2026-10-24 04:08:53 +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#7925
No description provided.