[PR #8012] [MERGED] fix(chat): the setup wizard starts from the starred profile and stays above popped-out settings #8054

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8012
Author: @JamesMowery
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/setup-wizard-waits-for-profile


📝 Commits (6)

  • c4a90a7 fix(chat): start the setup wizard from the starred profile
  • b425c4a fix(chat): keep popped-out Chat Settings sections behind the setup wizard
  • 1d81a2d fix(chat): the wizard's loading spinner respects reduced motion; the regression uses the wizard's cache key
  • 41cdf9b fix(chat): only the apply the wizard opened with holds it back
  • 21c6cc6 Merge remote-tracking branch 'origin/staging' into fix/setup-wizard-waits-for-profile
  • 7c1dd5a refactor(chat): the wizard's apply hold starts empty instead of repeating the next line

📊 Changes

5 files changed (+138 additions, -21 deletions)

View changed files

📝 packages/client/src/components/chat/ChatCommonOverlays.tsx (+2 -1)
📝 packages/client/src/components/chat/ChatSetupWizard.tsx (+39 -19)
📝 packages/client/src/hooks/use-chat-presets.ts (+8 -1)
➕ packages/client/src/lib/chat-preset-apply.ts (+27 -0)
➕ scripts/regressions/setup-wizard-waits-for-profile.regression.ts (+62 -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 #8011
@SpicyMarinara

Why this change

  • A new chat opens its setup wizard in the same step that applies the starred settings profile, without waiting for the apply. The wizard reads its starting choices once, so it could read the blank chat, and finishing setup wrote those choices back over the profile's: the Conversation command toggles and the Commands switch.
  • A profile saved with a Chat Settings section popped out showed that floating window over the wizard.

What changed

  • useApplyChatPreset has a mutation key, and useIsApplyingChatPreset(chatId) (through chatPresetApplyFilters, matched by the key and the chat id) says when a profile is being applied to this chat.
  • ChatSetupWizard shows its loading state while that apply is pending, then starts from the cached chat (chatKeys.detail), which holds the applied profile by then. The loading state is one shared WizardLoading (its spinner only spins under motion-safe).
  • Only an apply already running when the wizard first shows for the chat holds it (nextWizardApplyHold); once that ends or fails, a profile picked inside the wizard (its profile shortcut) doesn't unmount it or apply saved wizard defaults again.
  • An applied profile counts like saved wizard defaults when deciding whether Conversation commands start on, so the profile's Commands switch is kept.
  • Popped-out Chat Settings sections stay unmounted while the wizard is open and come back when it closes (ChatCommonOverlays.tsx). The window store and the chat's saved layout are untouched; only rendering waits.

Open question for the maintainers: when you also have saved wizard defaults (Save as my defaults in the wizard), the wizard now applies them after the profile, so they win over it, and Reset returns to the profile's settings. Before this change the two writes raced. If the starred profile should win over saved wizard defaults instead, that is a one-line change in SavedChatSetupWizard's first apply.

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

Automated runs on 2026-10-21 on staging 5e7468ab4, Node 24.21.0:

  • pnpm check: passes. Its one lint warning, in HomeProfessorMariChat.tsx, is not from this PR.
  • pnpm localization:check: passes.
  • setup-wizard-waits-for-profile (new): the wait starts with the apply, ends only after the applied chat is cached under the wizard's own cache key, and ignores applies to other chats. It fails when the apply is not keyed.
  • Full pnpm regression on b425c4a7b: 961/961 pass. On 1d81a2dea: client type check, ESLint on the wizard, and setup-wizard-waits-for-profile pass.
  • Local CodeRabbit (CLI) on the branch: 4 findings.
    • Fixed in 1d81a2dea: the loading spinner under reduced motion; the regression now uses the key the wizard reads (["chats", "detail", id], mirrored because use-chats.ts can't load in a Node regression).
    • Declined: rendering the wizard in the regression (the Node regressions have no DOM; the hook and filter it depends on are what the test pins). Raised as the open question above rather than changed: saved wizard defaults applying over the profile.
    • A review of 1d81a2dea: 0 findings.
  • Not run: pnpm smoke:ui and pnpm regression:ui.

Manual verification notes

  • Manually verify a new Conversation chat from a starred profile with Videos on and another command off: click through the wizard without changes, then check Chat Settings keeps the profile's commands and Commands switch.
  • Manually verify the same for a new Roleplay chat.
  • Manually verify a profile saved with Agents popped out: the wizard shows on its own, and the Agents window appears once the wizard closes.
  • Manually verify the wizard's loading state appears only briefly while the profile applies, in light and dark mode and at phone width.

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/chat-settings.md already says a new chat gets the starred profile; this makes it true when the wizard finishes too.

UI evidence (if applicable)

The only visible change is the wizard's existing loading state showing while a profile applies, and a popped-out window waiting for the wizard.

🤖 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/8012 **Author:** [@JamesMowery](https://github.com/JamesMowery) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/setup-wizard-waits-for-profile` --- ### 📝 Commits (6) - [`c4a90a7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c4a90a70852c93f56cbfc384158eff357cfe28a2) fix(chat): start the setup wizard from the starred profile - [`b425c4a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b425c4a7b609d465c547995145234e8779f2407e) fix(chat): keep popped-out Chat Settings sections behind the setup wizard - [`1d81a2d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1d81a2dea9560fde8aaa4177e9b66ba18c25c284) fix(chat): the wizard's loading spinner respects reduced motion; the regression uses the wizard's cache key - [`41cdf9b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/41cdf9b2e3ada1aa1a00c838c956b4b90adfcc2f) fix(chat): only the apply the wizard opened with holds it back - [`21c6cc6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/21c6cc6fd7c68b914cee269e41d512df1e7bd0f4) Merge remote-tracking branch 'origin/staging' into fix/setup-wizard-waits-for-profile - [`7c1dd5a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7c1dd5a8d34e2697d00e14317f44bfdb18f2dc35) refactor(chat): the wizard's apply hold starts empty instead of repeating the next line ### 📊 Changes **5 files changed** (+138 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatCommonOverlays.tsx` (+2 -1) 📝 `packages/client/src/components/chat/ChatSetupWizard.tsx` (+39 -19) 📝 `packages/client/src/hooks/use-chat-presets.ts` (+8 -1) ➕ `packages/client/src/lib/chat-preset-apply.ts` (+27 -0) ➕ `scripts/regressions/setup-wizard-waits-for-profile.regression.ts` (+62 -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 #8011 @SpicyMarinara ## Why this change - A new chat opens its setup wizard in the same step that applies the starred settings profile, without waiting for the apply. The wizard reads its starting choices once, so it could read the blank chat, and finishing setup wrote those choices back over the profile's: the Conversation command toggles and the **Commands** switch. - A profile saved with a Chat Settings section popped out showed that floating window over the wizard. ## What changed - `useApplyChatPreset` has a mutation key, and `useIsApplyingChatPreset(chatId)` (through `chatPresetApplyFilters`, matched by the key and the chat id) says when a profile is being applied to this chat. - `ChatSetupWizard` shows its loading state while that apply is pending, then starts from the cached chat (`chatKeys.detail`), which holds the applied profile by then. The loading state is one shared `WizardLoading` (its spinner only spins under `motion-safe`). - Only an apply already running when the wizard first shows for the chat holds it (`nextWizardApplyHold`); once that ends or fails, a profile picked inside the wizard (its profile shortcut) doesn't unmount it or apply saved wizard defaults again. - An applied profile counts like saved wizard defaults when deciding whether Conversation commands start on, so the profile's **Commands** switch is kept. - Popped-out Chat Settings sections stay unmounted while the wizard is open and come back when it closes (`ChatCommonOverlays.tsx`). The window store and the chat's saved layout are untouched; only rendering waits. **Open question for the maintainers:** when you also have saved wizard defaults (**Save as my defaults** in the wizard), the wizard now applies them after the profile, so they win over it, and **Reset** returns to the profile's settings. Before this change the two writes raced. If the starred profile should win over saved wizard defaults instead, that is a one-line change in `SavedChatSetupWizard`'s first apply. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` Automated runs on 2026-10-21 on `staging` `5e7468ab4`, Node 24.21.0: - `pnpm check`: passes. Its one lint warning, in `HomeProfessorMariChat.tsx`, is not from this PR. - `pnpm localization:check`: passes. - `setup-wizard-waits-for-profile` (new): the wait starts with the apply, ends only after the applied chat is cached under the wizard's own cache key, and ignores applies to other chats. It fails when the apply is not keyed. - Full `pnpm regression` on `b425c4a7b`: 961/961 pass. On `1d81a2dea`: client type check, ESLint on the wizard, and `setup-wizard-waits-for-profile` pass. - Local CodeRabbit (CLI) on the branch: 4 findings. - Fixed in `1d81a2dea`: the loading spinner under reduced motion; the regression now uses the key the wizard reads (`["chats", "detail", id]`, mirrored because `use-chats.ts` can't load in a Node regression). - Declined: rendering the wizard in the regression (the Node regressions have no DOM; the hook and filter it depends on are what the test pins). Raised as the open question above rather than changed: saved wizard defaults applying over the profile. - A review of `1d81a2dea`: 0 findings. - Not run: `pnpm smoke:ui` and `pnpm regression:ui`. ### Manual verification notes - Manually verify a new Conversation chat from a starred profile with **Videos** on and another command off: click through the wizard without changes, then check Chat Settings keeps the profile's commands and **Commands** switch. - Manually verify the same for a new Roleplay chat. - Manually verify a profile saved with **Agents** popped out: the wizard shows on its own, and the Agents window appears once the wizard closes. - Manually verify the wizard's loading state appears only briefly while the profile applies, in light and dark mode and at phone width. ## Docs and release impact - [x] 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/chat-settings.md` already says a new chat gets the starred profile; this makes it true when the wizard finishes too. ## UI evidence (if applicable) The only visible change is the wizard's existing loading state showing while a profile applies, and a popped-out window waiting for the wizard. 🤖 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:10:01 +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#8054
No description provided.