mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2276] 09-CHAT-STORAGE-branch-group-lifecycle / 09-CHAT-UI-branch-management: branch labels drift from legacy branchName #1114
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1114
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2276
Originally assigned to: @Promansis on GitHub.
Summary
09-CHAT-STORAGE-branch-group-lifecycle/09-CHAT-UI-branch-managementparity gap from #2268 Batch 9: refactor branch creation stores the new branch display label inchat.name({base_name} Branch) instead of preserving the stable chat name and settingmetadata.branchName. The branch selector also renders rawbranch.name, so newly created and renamed branches can display the wrong label compared with legacy Manage Chat Files behavior.Expected behavior
Legacy behavior on
main:nameunchanged.metadata.branchName: "New Branch".getChatDisplayName, so branch rename updatesmetadata.branchNameand the UI shows the per-branch label.Acceptance criteria:
09-CHAT-STORAGE-branch-group-lifecycle: branch creation preserves the source chatnameand initializes the new branch label throughmetadata.branchNamerather than mutatingname.09-CHAT-UI-branch-management: in-chat branch selector and Manage Chat Files show the same branch display label, including freshly created branches and renamed branches.name, expectedmetadata.branchName, and branch selector-compatible display data.Actual behavior
Refactor behavior:
branch_chatreads the sourcenameand writes the new chatnameasformat!("{base_name} Branch").metadata.branchNamefor a normal branch.getChatDisplayNamestill prefersmetadata.branchNamewhen present, and Manage Chat Files rename writesbranchName, butChatBranchSelectordisplaysbranch.namedirectly. That means branch labels can drift between the selector and Manage Chat Files, and new branches do not match legacy label semantics.Steps to reproduce
name/metadata.branchNamefields.Impact area
Environment
refactor@37585ab9Logs, screenshots, or video
Proof from Batch 9 static trace:
Legacy files inspected:
packages/server/src/routes/chats.routes.ts:2235keeps branch chatnamestable.packages/server/src/routes/chats.routes.ts:2257copies metadata minus summaries and setsbranchName: "New Branch".packages/server/src/routes/chats.routes.ts:2263copies messages from the source chat.packages/server/src/routes/chats.routes.ts:2273uses the active swipe content while copying.packages/server/src/routes/chats.routes.ts:2314carries the folder assignment.packages/server/src/routes/chats.routes.ts:2316copies tracker snapshots.packages/client/src/components/chat/ChatFilesDrawer.tsx:84renames via branch display name / metadata.packages/client/src/components/chat/ChatFilesDrawer.tsx:99preserves active chat behavior when deleting a branch.packages/client/src/components/chat/ChatBranchSelector.tsx:91renders only grouped chats and supports switching.Refactor files inspected:
src-tauri/src/commands/storage/chats.rs:990beginsbranch_chat.src-tauri/src/commands/storage/chats.rs:996reads the source base name.src-tauri/src/commands/storage/chats.rs:1010assigns the new chat id and writesnameto{base_name} Branch.src-tauri/src/commands/storage/chats.rs:1016prunes summary metadata, but this path does not initializemetadata.branchName.src/shared/lib/chat-display.ts:25displaysmetadata.branchNamewhen present.src/features/modes/shared/chat-ui/components/ChatFilesDrawer.tsx:95renames by patchingbranchName.src/features/modes/shared/chat-ui/components/ChatBranchSelector.tsx:94usescurrentBranch?.namefor the selector button label.src/features/modes/shared/chat-ui/components/ChatBranchSelector.tsx:193rendersbranch.namefor menu rows.Regression notes
This is a parity gap against legacy
mainfor #2268 Target 9, Batch 9. The legacy route explicitly documents that branch labels should live in metadata while the stable thread/chat name remains unchanged.Additional context
Source tracker: #2268.
Follow-ups not included in this issue:
Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: