[PR #2342] [MERGED] Fix chat branch display labels #5545

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/issue-2276-branch-labels


📝 Commits (1)

  • 18ae3e9 Fix chat branch display labels

📊 Changes

2 files changed (+75 additions, -6 deletions)

View changed files

📝 src-tauri/src/commands/storage/chats.rs (+72 -4)
📝 src/features/modes/shared/chat-ui/components/ChatBranchSelector.tsx (+3 -2)

📄 Description

Linked issue

Closes #2276

Why this change

Refactor branch creation stored the new branch label by mutating the chat's stable name field to {base_name} Branch, while Manage Chat Files renames and displays branch labels through metadata.branchName. That let newly created and renamed branch labels drift between storage, Manage Chat Files, and the in-chat branch selector.

What changed

  • Preserve the source chat name when creating a branch.
  • Initialize new branches with metadata.branchName: "New Branch" after pruning future summary metadata.
  • Render branch selector labels with getChatDisplayName, matching Manage Chat Files.
  • Add focused Rust storage proof for stable names, branch label metadata, folder carry-over, metadata carry-over, and branch-group list visibility.

Refactor impact

Primary owner:

Rust storage, shared mode UI.

Impact areas reviewed:

  • Chat branch creation in src-tauri/src/commands/storage/chats.rs.
  • Branch group listing data consumed by Manage Chat Files and the branch selector.
  • Shared chat display-name helper used by Manage Chat Files.

Boundary notes:

  • Product storage behavior remains in src-tauri.
  • React UI display behavior remains in src/features/modes/shared/chat-ui.
  • No engine, shared API wrapper, or remote runtime routing changes.

Pressure points touched:

  • Shared mode UI: ChatBranchSelector.
  • Rust storage branch lifecycle: branch_chat.

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

  • cargo test --manifest-path src-tauri/Cargo.toml branch_chat_ passed: 5 tests, including branch_chat_preserves_stable_name_and_sets_branch_display_name.
  • pnpm typecheck passed.
  • pnpm check ran through line endings, scratch, architecture, frontend, Rust, docs, discovery, launcher safety, and unused gates. The session ended immediately after starting the final unused gate, so pnpm check:unused was rerun separately and passed.

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:

This fixes existing branch label parity and 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

Not captured. The UI change routes branch selector text through the same display-name helper already used by Manage Chat Files; storage and typecheck proof are included above.


🔄 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/2342 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/5/2026 **Status:** ✅ Merged **Merged:** 6/5/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/issue-2276-branch-labels` --- ### 📝 Commits (1) - [`18ae3e9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/18ae3e90ecd81bdcab598ff37da01432d9377e67) Fix chat branch display labels ### 📊 Changes **2 files changed** (+75 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/chats.rs` (+72 -4) 📝 `src/features/modes/shared/chat-ui/components/ChatBranchSelector.tsx` (+3 -2) </details> ### 📄 Description ## Linked issue Closes #2276 ## Why this change Refactor branch creation stored the new branch label by mutating the chat's stable `name` field to `{base_name} Branch`, while Manage Chat Files renames and displays branch labels through `metadata.branchName`. That let newly created and renamed branch labels drift between storage, Manage Chat Files, and the in-chat branch selector. ## What changed - Preserve the source chat `name` when creating a branch. - Initialize new branches with `metadata.branchName: "New Branch"` after pruning future summary metadata. - Render branch selector labels with `getChatDisplayName`, matching Manage Chat Files. - Add focused Rust storage proof for stable names, branch label metadata, folder carry-over, metadata carry-over, and branch-group list visibility. ## Refactor impact Primary owner: Rust storage, shared mode UI. Impact areas reviewed: - Chat branch creation in `src-tauri/src/commands/storage/chats.rs`. - Branch group listing data consumed by Manage Chat Files and the branch selector. - Shared chat display-name helper used by Manage Chat Files. Boundary notes: - Product storage behavior remains in `src-tauri`. - React UI display behavior remains in `src/features/modes/shared/chat-ui`. - No engine, shared API wrapper, or remote runtime routing changes. Pressure points touched: - Shared mode UI: `ChatBranchSelector`. - Rust storage branch lifecycle: `branch_chat`. ## 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 - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `cargo test --manifest-path src-tauri/Cargo.toml branch_chat_` passed: 5 tests, including `branch_chat_preserves_stable_name_and_sets_branch_display_name`. - `pnpm typecheck` passed. - `pnpm check` ran through line endings, scratch, architecture, frontend, Rust, docs, discovery, launcher safety, and unused gates. The session ended immediately after starting the final unused gate, so `pnpm check:unused` was rerun separately and passed. ## 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: This fixes existing branch label parity and 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` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence Not captured. The UI change routes branch selector text through the same display-name helper already used by Manage Chat Files; storage and typecheck proof are included above. --- <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:14 +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#5545
No description provided.