[PR #2495] [MERGED] Fix chat setup wizards for new mode chats #5619

Closed
opened 2026-10-22 04:17:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2495
Author: @Xelvanis
Created: 6/6/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Xelvanis

Base: refactor ← Head: fix/chat-mode-setup-wizards-2483


📝 Commits (1)

  • 6a1f97c Fix chat setup wizard intent

📊 Changes

3 files changed (+118 additions, -5 deletions)

View changed files

📝 src/features/modes/shared/chat-ui/hooks/use-chat-overlays.ts (+13 -4)
➕ tests/unit/use-chat-overlays.spec.tsx (+104 -0)
📝 vitest.config.ts (+1 -1)

📄 Description

Linked issue

Closes #2483

Why this change

  • New Conversation, Roleplay, and Game chats were creating records without reliably opening their setup wizards.
  • The targeted setup intent could be consumed before the delayed overlay open actually ran, so cleanup during the route/effect transition could erase the only pending wizard request.

What changed

  • Keep targeted new-chat setup intent in the chat store until the scheduled overlay open callback runs.
  • Clear only local pending overlay state when a scheduled open is canceled.
  • Add a focused StrictMode regression spec for the setup-intent handoff.
  • Update Vitest unit include rules so tests/unit/**/*.spec.tsx files run under pnpm test.

Refactor impact

Primary owner:

  • Shared mode UI overlays.

Impact areas reviewed:

  • Sidebar new-chat creation for Conversation, Roleplay, and Game.
  • Legacy origin/main setup-wizard flow for the expected behavior.
  • Shared chat setup intent handoff through useChatStore and useChatOverlays.
  • Game setup routing, where Game mode uses its own setup wizard after chat creation.

Boundary notes:

  • Feature/shared mode UI only; no engine, shared API, Rust command, storage schema, provider, or remote-runtime boundary changes.

Pressure points touched:

  • Shared mode UI hook: use-chat-overlays.ts.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • pnpm exec vitest run tests/unit/use-chat-overlays.spec.tsx passed.
  • pnpm test passed.
  • pnpm typecheck passed.
  • pnpm check passed.
  • Native Tauri QA before fix: clicked New RP; a New Roleplay chat was created without a setup dialog.
  • Native Tauri QA after fix: New chat showed New Conversation, New RP showed Choose a Connection and Next, and New game showed New Game Setup.
  • Durable test rationale: the regression was a setup intent being consumed before the delayed overlay open survived React StrictMode cleanup. Existing manual proof would not guard that timing invariant. The new spec is narrow: it mounts useChatOverlays with useChatStore under StrictMode and verifies only the targeted wizard intent handoff.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Restores the existing new-chat setup wizard behavior; it does not add a new discoverable feature.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

Native Tauri WebView text checks were performed in-session. No screenshots are attached.


🔄 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/2495 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/6/2026 **Status:** ✅ Merged **Merged:** 6/6/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `fix/chat-mode-setup-wizards-2483` --- ### 📝 Commits (1) - [`6a1f97c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6a1f97c3cd2e1df7d7ec8803a29a0a492c1620f2) Fix chat setup wizard intent ### 📊 Changes **3 files changed** (+118 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/features/modes/shared/chat-ui/hooks/use-chat-overlays.ts` (+13 -4) ➕ `tests/unit/use-chat-overlays.spec.tsx` (+104 -0) 📝 `vitest.config.ts` (+1 -1) </details> ### 📄 Description ## Linked issue Closes #2483 ## Why this change - New Conversation, Roleplay, and Game chats were creating records without reliably opening their setup wizards. - The targeted setup intent could be consumed before the delayed overlay open actually ran, so cleanup during the route/effect transition could erase the only pending wizard request. ## What changed - Keep targeted new-chat setup intent in the chat store until the scheduled overlay open callback runs. - Clear only local pending overlay state when a scheduled open is canceled. - Add a focused StrictMode regression spec for the setup-intent handoff. - Update Vitest unit include rules so `tests/unit/**/*.spec.tsx` files run under `pnpm test`. ## Refactor impact Primary owner: - Shared mode UI overlays. Impact areas reviewed: - Sidebar new-chat creation for Conversation, Roleplay, and Game. - Legacy `origin/main` setup-wizard flow for the expected behavior. - Shared chat setup intent handoff through `useChatStore` and `useChatOverlays`. - Game setup routing, where Game mode uses its own setup wizard after chat creation. Boundary notes: - Feature/shared mode UI only; no engine, shared API, Rust command, storage schema, provider, or remote-runtime boundary changes. Pressure points touched: - Shared mode UI hook: `use-chat-overlays.ts`. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [x] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm exec vitest run tests/unit/use-chat-overlays.spec.tsx` passed. - `pnpm test` passed. - `pnpm typecheck` passed. - `pnpm check` passed. - Native Tauri QA before fix: clicked `New RP`; a `New Roleplay` chat was created without a setup dialog. - Native Tauri QA after fix: `New chat` showed `New Conversation`, `New RP` showed `Choose a Connection` and `Next`, and `New game` showed `New Game Setup`. - Durable test rationale: the regression was a setup intent being consumed before the delayed overlay open survived React StrictMode cleanup. Existing manual proof would not guard that timing invariant. The new spec is narrow: it mounts `useChatOverlays` with `useChatStore` under `StrictMode` and verifies only the targeted wizard intent handoff. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Restores the existing new-chat setup wizard behavior; it does not add a new discoverable feature. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence Native Tauri WebView text checks were performed in-session. No screenshots are attached. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:52 +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#5619
No description provided.