[PR #2103] [MERGED] Fix empty new chat setup cleanup #5439

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2101-empty-conversations


📝 Commits (5)

  • 8137e66 Fix empty new chat setup cleanup
  • def0eef Record issue 2101 PR proof metadata
  • c1877f7 Tighten empty setup cleanup identity
  • 8f2c305 Preserve setup identity through legacy open
  • 8a4643a Merge remote-tracking branch 'upstream/refactor' into fix/issue-2101-empty-conversations

📊 Changes

7 files changed (+263 additions, -3 deletions)

View changed files

➕ scratch/issue-2101-bugfix-verification.json (+98 -0)
📝 src/features/modes/conversation/components/ConversationModeRoute.tsx (+26 -1)
📝 src/features/modes/roleplay/components/RoleplayModeRoute.tsx (+39 -1)
📝 src/features/modes/shared/chat-ui/hooks/use-chat-overlays.ts (+12 -1)
📝 src/features/modes/shared/chat-ui/index.ts (+1 -0)
➕ src/features/modes/shared/chat-ui/lib/empty-new-chat.test.ts (+65 -0)
➕ src/features/modes/shared/chat-ui/lib/empty-new-chat.ts (+22 -0)

📄 Description

Linked issue

Closes #2101

Why this change

  • New Conversation/New Chat setup created a persisted placeholder chat before the user had supplied meaningful setup data. If the user used Skip, the wizard finished normally and kept a completely empty chat in history.

What changed

  • Added a shared isEmptyNewChatSetup helper for detecting setup placeholders with no selected characters and zero messages.
  • Conversation setup now deletes the placeholder instead of finishing setup when Skip is used on an empty setup.
  • Roleplay setup now applies the same cleanup for the shell New Chat path.
  • Added focused regression coverage for the empty/configured/messaged/unloaded rows.

Refactor impact

Primary owner:

chat mode / roleplay mode

Impact areas reviewed:

  • New chat creation from src/app/shell/useStartNewChat.ts
  • Quick start creation from src/features/modes/router/components/ModeHomeSurface.tsx
  • Gated setup creation from src/features/modes/shared/chat-ui/components/NewChatConnectionGate.tsx
  • Conversation and roleplay setup finish handlers

Boundary notes:

  • Kept the fix in React feature/shared mode UI. No engine, shared API, Rust storage, schema, dependency, or prompt-pipeline changes.

Pressure points touched:

  • ConversationModeRoute
  • RoleplayModeRoute
  • shared mode chat-ui public export surface

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

  • Codex ran pnpm test -- src/features/modes/shared/chat-ui/lib/empty-new-chat.test.ts (4 tests passed).
  • Codex ran pnpm typecheck (passed).
  • Codex ran node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json (passed).
  • Codex ran pnpm check (passed).
  • Manual Tauri-shell click-through is still recommended before ready: create a New Conversation/New Chat, choose Skip without characters/messages, and confirm no empty chat remains in the list.

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:

  • Bugfix only; it does not add a 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

  • No screenshot attached yet. The core persisted-state flow needs the Tauri shell/runtime to manually verify the chat list after skipping setup, so this should remain draft until that click-through is done.

🔄 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/2103 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-2101-empty-conversations` --- ### 📝 Commits (5) - [`8137e66`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8137e665fcd42367afbc41db8d7900f6776438b5) Fix empty new chat setup cleanup - [`def0eef`](https://github.com/Pasta-Devs/Marinara-Engine/commit/def0eef335003a56874de8cca31ab3e3eccffba4) Record issue 2101 PR proof metadata - [`c1877f7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c1877f7a23ff6b7ffcdb58f81772227492a7b51c) Tighten empty setup cleanup identity - [`8f2c305`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8f2c305bc7a7856d5f0631d1a054d20c08c0b91f) Preserve setup identity through legacy open - [`8a4643a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8a4643af0c576f5986e7c43a8010728e88296867) Merge remote-tracking branch 'upstream/refactor' into fix/issue-2101-empty-conversations ### 📊 Changes **7 files changed** (+263 additions, -3 deletions) <details> <summary>View changed files</summary> ➕ `scratch/issue-2101-bugfix-verification.json` (+98 -0) 📝 `src/features/modes/conversation/components/ConversationModeRoute.tsx` (+26 -1) 📝 `src/features/modes/roleplay/components/RoleplayModeRoute.tsx` (+39 -1) 📝 `src/features/modes/shared/chat-ui/hooks/use-chat-overlays.ts` (+12 -1) 📝 `src/features/modes/shared/chat-ui/index.ts` (+1 -0) ➕ `src/features/modes/shared/chat-ui/lib/empty-new-chat.test.ts` (+65 -0) ➕ `src/features/modes/shared/chat-ui/lib/empty-new-chat.ts` (+22 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #2101 ## Why this change - New Conversation/New Chat setup created a persisted placeholder chat before the user had supplied meaningful setup data. If the user used `Skip`, the wizard finished normally and kept a completely empty chat in history. ## What changed - Added a shared `isEmptyNewChatSetup` helper for detecting setup placeholders with no selected characters and zero messages. - Conversation setup now deletes the placeholder instead of finishing setup when `Skip` is used on an empty setup. - Roleplay setup now applies the same cleanup for the shell New Chat path. - Added focused regression coverage for the empty/configured/messaged/unloaded rows. ## Refactor impact Primary owner: chat mode / roleplay mode Impact areas reviewed: - New chat creation from `src/app/shell/useStartNewChat.ts` - Quick start creation from `src/features/modes/router/components/ModeHomeSurface.tsx` - Gated setup creation from `src/features/modes/shared/chat-ui/components/NewChatConnectionGate.tsx` - Conversation and roleplay setup finish handlers Boundary notes: - Kept the fix in React feature/shared mode UI. No engine, shared API, Rust storage, schema, dependency, or prompt-pipeline changes. Pressure points touched: - `ConversationModeRoute` - `RoleplayModeRoute` - shared mode chat-ui public export surface ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] 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 - Codex ran `pnpm test -- src/features/modes/shared/chat-ui/lib/empty-new-chat.test.ts` (4 tests passed). - Codex ran `pnpm typecheck` (passed). - Codex ran `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` (passed). - Codex ran `pnpm check` (passed). - Manual Tauri-shell click-through is still recommended before ready: create a New Conversation/New Chat, choose `Skip` without characters/messages, and confirm no empty chat remains in the list. ## 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: - Bugfix only; it does not add a 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 - No screenshot attached yet. The core persisted-state flow needs the Tauri shell/runtime to manually verify the chat list after skipping setup, so this should remain draft until that click-through is done. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:19 +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#5439
No description provided.