[PR #8509] [MERGED] Ask a card's questions before its greeting, and let greetings use the answers #8643

Closed
opened 2026-11-07 16:46:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/greeting-flow


📝 Commits (7)

  • 0575d3f feat(onboarding): show chat variables in chat messages
  • 3956221 fix(onboarding): leave contexts without chat variables as they were
  • 644855b feat(onboarding): ask a card's questions before its greeting
  • 2c1dcf1 feat(onboarding): fill a card's greetings from the persona answers
  • f8fa656 docs(onboarding): shorten the greeting warning and docs copy
  • ba0e32e feat(characters): offer both question groups as chips on greetings
  • a655016 fix(chat): keep the created persona when Back reopens the card questions

📊 Changes

18 files changed (+1123 additions, -274 deletions)

View changed files

📝 docs/characters/interactive-onboarding.md (+5 -1)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+128 -45)
📝 packages/client/src/components/characters/CharacterOnboardingModal.tsx (+24 -7)
📝 packages/client/src/components/chat/ChatCharacterDropOptions.tsx (+199 -120)
📝 packages/client/src/components/chat/ChatMessage.tsx (+76 -23)
📝 packages/client/src/components/chat/ChatResourceDropOverlay.tsx (+9 -1)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+83 -18)
📝 packages/client/src/components/chat/ChatSetupWizard.tsx (+74 -5)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+4 -0)
📝 packages/client/src/lib/chat-macros.ts (+70 -9)
➕ packages/client/src/lib/onboarding-add-card.ts (+34 -0)
📝 packages/client/src/lib/onboarding-preview-highlight.ts (+22 -0)
📝 packages/client/src/localization/locales/en.json (+2 -2)
📝 packages/shared/src/utils/onboarding.ts (+82 -23)
➕ scripts/regressions/onboarding-add-card-flow.regression.ts (+66 -0)
➕ scripts/regressions/onboarding-greeting-bake.regression.ts (+170 -0)
➕ scripts/regressions/onboarding-greeting-display.regression.ts (+75 -0)
📝 scripts/regressions/onboarding-s3.regression.ts (+0 -20)

📄 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 #8505
Closes #8506

Why this change

Both issues are the same moment seen from two sides: a card with questions and a greeting joining a chat.

  • Adding a card with character questions to an existing Roleplay chat never asks them. The greeting dialog opens, or nothing does, and the chat runs on the seeded defaults.
  • A greeting can't use the answers. {{relationshipToUser}} shows as written although the model reads the value, and persona questions like {{class}} reach nothing at all.

Fixing only the first would ask the questions, then show a greeting that ignores the answers.

What changed

Chat variables in messages (slice 1)

  • Messages resolve chat variables at display, after preset variables, the same order as the prompt.
  • Each context gets its own copy, so a {{setvar}} in a message can't change the chat's variables.
  • {{getvar::name}} now reads chat variables only in display when a chat has variables, as it already does in the prompt. A name that exists only as a preset variable returns empty there, where it used to show the preset value.
  • The Character Editor warning that greetings can't read chat variables is gone.

Questions before the greeting (slice 2)

  • Adding a card with character questions to a Roleplay chat opens its questions first, then the greeting dialog if it has greetings. Save and Back both continue. This reuses the questions window the onboarding marker already opens.
  • It covers both ways to add a card to a running chat: Chat Settings and drag and drop.
  • The questions open once the chat object holds the new card, so the window seeds from the current answers and the stale-id effect can't close it.
  • The greeting dialog's preview resolves the answers and marks them with the persona review's highlight. HTML greetings get the resolved text with no highlight.
  • Conversation chats keep skipping greetings, and hosted rooms are untouched.

Persona answers in greetings (slice 3)

  • When the player creates a persona in the new chat wizard, the same process that fills in the persona fills in the greeting. Ah, so you are a {{class}} is saved as Ah, so you are a Ranger, and alternate greetings become swipes as they do today.
  • This applies only to the card that owns the template, only while the chat's persona is still that persona, and only to greetings that mention one of its persona names. Every other greeting is written untouched.
  • {{user}} and {{char}} stay live. Persona answers are not saved as chat variables, so they can't drift from the persona.
  • With an existing persona or Quick Start the tag shows as written. The Character Editor warns authors about this.
  • First Message and alternate greetings list both question groups under Available variables, split by label, since a greeting resolves both. Card fields and persona fields keep their own single list, and all three now share one chip component.

Accepted costs

  • A greeting that uses a persona question is resolved once, so {{random}} and {{time}} in it freeze when the chat starts, as they do in a persona.
  • {{player}} counts as a persona name for that check.
  • The preview doesn't read preset variables.

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

Not yet clicked through in a browser. The checks to run:

  • A greeting using a character question's {{name}} shows the answer, and updates after changing the answer in Chat Settings.
  • Adding a card from Chat Settings and by drag and drop, with and without a greeting, using Save and Back.
  • The greeting preview resolves and highlights answers.
  • A persona created in the wizard fills the greeting and its swipes. Picking another persona afterwards leaves them raw, and Quick Start stays raw.
  • Reloading mid-wizard, the editor warning, and Conversation, Game and hosted chats staying unchanged, in both themes.

Regressions run locally: --filter onboarding (11/11), --filter prompt.regression (8/8).

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/characters/interactive-onboarding.md changed.

UI evidence (if applicable)

🤖 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/8509 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ylli-selmani](https://github.com/ylli-selmani) **Base:** `staging` ← **Head:** `fix/greeting-flow` --- ### 📝 Commits (7) - [`0575d3f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0575d3f3c8d0dfffe2e586695edfd653494d8dbe) feat(onboarding): show chat variables in chat messages - [`3956221`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3956221e6674d6ccaedf9d1c58b8de39e0708341) fix(onboarding): leave contexts without chat variables as they were - [`644855b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/644855b45e46bc5749b2e3201992fe806280412f) feat(onboarding): ask a card's questions before its greeting - [`2c1dcf1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2c1dcf1fbff006ceee0eeb2736abf2ede63a7195) feat(onboarding): fill a card's greetings from the persona answers - [`f8fa656`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f8fa656f5dfa602b468adf53d37563add94c2538) docs(onboarding): shorten the greeting warning and docs copy - [`ba0e32e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ba0e32e7f1fb035efbdef6c0af54f4b4caa88582) feat(characters): offer both question groups as chips on greetings - [`a655016`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a65501679de3ed747f253e89222d527a03a4f328) fix(chat): keep the created persona when Back reopens the card questions ### 📊 Changes **18 files changed** (+1123 additions, -274 deletions) <details> <summary>View changed files</summary> 📝 `docs/characters/interactive-onboarding.md` (+5 -1) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+128 -45) 📝 `packages/client/src/components/characters/CharacterOnboardingModal.tsx` (+24 -7) 📝 `packages/client/src/components/chat/ChatCharacterDropOptions.tsx` (+199 -120) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+76 -23) 📝 `packages/client/src/components/chat/ChatResourceDropOverlay.tsx` (+9 -1) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+83 -18) 📝 `packages/client/src/components/chat/ChatSetupWizard.tsx` (+74 -5) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+4 -0) 📝 `packages/client/src/lib/chat-macros.ts` (+70 -9) ➕ `packages/client/src/lib/onboarding-add-card.ts` (+34 -0) 📝 `packages/client/src/lib/onboarding-preview-highlight.ts` (+22 -0) 📝 `packages/client/src/localization/locales/en.json` (+2 -2) 📝 `packages/shared/src/utils/onboarding.ts` (+82 -23) ➕ `scripts/regressions/onboarding-add-card-flow.regression.ts` (+66 -0) ➕ `scripts/regressions/onboarding-greeting-bake.regression.ts` (+170 -0) ➕ `scripts/regressions/onboarding-greeting-display.regression.ts` (+75 -0) 📝 `scripts/regressions/onboarding-s3.regression.ts` (+0 -20) </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 #8505 Closes #8506 ## Why this change Both issues are the same moment seen from two sides: a card with questions and a greeting joining a chat. - Adding a card with character questions to an existing Roleplay chat never asks them. The greeting dialog opens, or nothing does, and the chat runs on the seeded defaults. - A greeting can't use the answers. `{{relationshipToUser}}` shows as written although the model reads the value, and persona questions like `{{class}}` reach nothing at all. Fixing only the first would ask the questions, then show a greeting that ignores the answers. ## What changed **Chat variables in messages (slice 1)** - Messages resolve chat variables at display, after preset variables, the same order as the prompt. - Each context gets its own copy, so a `{{setvar}}` in a message can't change the chat's variables. - `{{getvar::name}}` now reads chat variables only in display when a chat has variables, as it already does in the prompt. A name that exists only as a preset variable returns empty there, where it used to show the preset value. - The Character Editor warning that greetings can't read chat variables is gone. **Questions before the greeting (slice 2)** - Adding a card with character questions to a Roleplay chat opens its questions first, then the greeting dialog if it has greetings. Save and Back both continue. This reuses the questions window the onboarding marker already opens. - It covers both ways to add a card to a running chat: **Chat Settings** and drag and drop. - The questions open once the chat object holds the new card, so the window seeds from the current answers and the stale-id effect can't close it. - The greeting dialog's preview resolves the answers and marks them with the persona review's highlight. HTML greetings get the resolved text with no highlight. - Conversation chats keep skipping greetings, and hosted rooms are untouched. **Persona answers in greetings (slice 3)** - When the player creates a persona in the new chat wizard, the same process that fills in the persona fills in the greeting. `Ah, so you are a {{class}}` is saved as `Ah, so you are a Ranger`, and alternate greetings become swipes as they do today. - This applies only to the card that owns the template, only while the chat's persona is still that persona, and only to greetings that mention one of its persona names. Every other greeting is written untouched. - `{{user}}` and `{{char}}` stay live. Persona answers are not saved as chat variables, so they can't drift from the persona. - With an existing persona or Quick Start the tag shows as written. The Character Editor warns authors about this. - First Message and alternate greetings list both question groups under **Available variables**, split by label, since a greeting resolves both. Card fields and persona fields keep their own single list, and all three now share one chip component. **Accepted costs** - A greeting that uses a persona question is resolved once, so `{{random}}` and `{{time}}` in it freeze when the chat starts, as they do in a persona. - `{{player}}` counts as a persona name for that check. - The preview doesn't read preset variables. ## 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 Not yet clicked through in a browser. The checks to run: - A greeting using a character question's `{{name}}` shows the answer, and updates after changing the answer in Chat Settings. - Adding a card from Chat Settings and by drag and drop, with and without a greeting, using Save and Back. - The greeting preview resolves and highlights answers. - A persona created in the wizard fills the greeting and its swipes. Picking another persona afterwards leaves them raw, and Quick Start stays raw. - Reloading mid-wizard, the editor warning, and Conversation, Game and hosted chats staying unchanged, in both themes. Regressions run locally: `--filter onboarding` (11/11), `--filter prompt.regression` (8/8). ## 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/characters/interactive-onboarding.md` changed. ## UI evidence (if applicable) 🤖 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-11-07 16:46:11 +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#8643
No description provided.