[PR #1621] [MERGED] Fix legacy chat branch group roots #5153

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1621
Author: @Promansis
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @Promansis

Base: refactor ← Head: fix/issue-1522-branch-group-copy-migration


📝 Commits (1)

  • 0f646fe Fix legacy chat branch group roots

📊 Changes

3 files changed (+129 additions, -10 deletions)

View changed files

📝 src-tauri/src/state.rs (+119 -0)
📝 src/app/shell/ChatSidebar.tsx (+5 -5)
📝 src/features/modes/shared/chat-ui/components/ChatFilesDrawer.tsx (+5 -5)

📄 Description

Linked issue

Closes #1522

Why this change

  • Branch group delete actions intentionally delete every chat in the group, including the original/root chat, but the UI still described the root-inclusive count as branches.
  • Existing profiles could still have legacy branch groups where child chats point at the root chat id while the root chat keeps groupId: null, leaving Manage Chat Files unable to find the group from the root.

What changed

  • Reworded the app sidebar delete dialog and Manage Chat Files delete action to say group/chats instead of implying the original chat survives as a non-branch.
  • Added a startup storage migration that enrolls legacy ungrouped root chats when another chat already references the root id as groupId.
  • Added a startup migration test covering the positive root repair and negative controls for unrelated null roots and already-grouped roots.

Refactor impact

Primary owner:

Rust storage startup migration; app shell chat sidebar; shared mode chat UI.

Impact areas reviewed:

  • Chat/roleplay/conversation branch group listing and deletion labels.
  • Startup storage migration path for existing user chat rows.
  • Delete semantics in delete_chat_group were reviewed and intentionally left unchanged.

Boundary notes:

  • Product deletion behavior remains in existing chat storage commands.
  • React changes are copy-only and continue using existing hooks/API wrappers.
  • No engine, raw Tauri invoke, remote runtime, or HTTP dispatch changes.

Pressure points touched:

  • src-tauri/src/state.rs startup migration.
  • src/app/shell/ChatSidebar.tsx delete dialog copy.
  • src/features/modes/shared/chat-ui/components/ChatFilesDrawer.tsx delete group copy.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

  • cargo test --manifest-path src-tauri/Cargo.toml app_state_startup_enrolls_legacy_ungrouped_chat_roots
  • cargo check --manifest-path src-tauri/Cargo.toml
  • pnpm typecheck
  • pnpm check:architecture
  • git diff --check
  • Browser/Tauri manual UI verification was not run; UI changes are copy-only.

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

Not added. The UI changes are wording-only in existing delete dialogs/buttons.


🔄 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/1621 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 5/30/2026 **Status:** ✅ Merged **Merged:** 5/30/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/issue-1522-branch-group-copy-migration` --- ### 📝 Commits (1) - [`0f646fe`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0f646fea600f6dd5e42e3ba179991186b50aa0a5) Fix legacy chat branch group roots ### 📊 Changes **3 files changed** (+129 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/state.rs` (+119 -0) 📝 `src/app/shell/ChatSidebar.tsx` (+5 -5) 📝 `src/features/modes/shared/chat-ui/components/ChatFilesDrawer.tsx` (+5 -5) </details> ### 📄 Description ## Linked issue Closes #1522 ## Why this change - Branch group delete actions intentionally delete every chat in the group, including the original/root chat, but the UI still described the root-inclusive count as branches. - Existing profiles could still have legacy branch groups where child chats point at the root chat id while the root chat keeps `groupId: null`, leaving Manage Chat Files unable to find the group from the root. ## What changed - Reworded the app sidebar delete dialog and Manage Chat Files delete action to say group/chats instead of implying the original chat survives as a non-branch. - Added a startup storage migration that enrolls legacy ungrouped root chats when another chat already references the root id as `groupId`. - Added a startup migration test covering the positive root repair and negative controls for unrelated null roots and already-grouped roots. ## Refactor impact Primary owner: Rust storage startup migration; app shell chat sidebar; shared mode chat UI. Impact areas reviewed: - Chat/roleplay/conversation branch group listing and deletion labels. - Startup storage migration path for existing user chat rows. - Delete semantics in `delete_chat_group` were reviewed and intentionally left unchanged. Boundary notes: - Product deletion behavior remains in existing chat storage commands. - React changes are copy-only and continue using existing hooks/API wrappers. - No engine, raw Tauri invoke, remote runtime, or HTTP dispatch changes. Pressure points touched: - `src-tauri/src/state.rs` startup migration. - `src/app/shell/ChatSidebar.tsx` delete dialog copy. - `src/features/modes/shared/chat-ui/components/ChatFilesDrawer.tsx` delete group copy. ## Validation - [ ] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [x] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [x] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - `cargo test --manifest-path src-tauri/Cargo.toml app_state_startup_enrolls_legacy_ungrouped_chat_roots` - `cargo check --manifest-path src-tauri/Cargo.toml` - `pnpm typecheck` - `pnpm check:architecture` - `git diff --check` - Browser/Tauri manual UI verification was not run; UI changes are copy-only. ## 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 Not added. The UI changes are wording-only in existing delete dialogs/buttons. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:13:46 +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#5153
No description provided.