mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8114] [MERGED] feat(chats): show chat branches as a collapsible tree in the chat list #8110
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#8110
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8114
Author: @ylli-selmani
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ylli-selmani
Base:
staging← Head:feat/chat-list-branch-tree📝 Commits (10+)
d21b583feat(chat-list): build branch rows for a chat groupbe29720feat(chat-list): open a chat's branches as a tree under its rowd2583cadocs(branches): describe the branch tree in the chat list73695adfix(chat-list): review fixes for the branch tree81a03dbfix(chat-list): Dottore round 1 and simpler branch guidesc10eb7ffix(chat-list): show branches as a compact thread list1775ffbtest(chat-list): pin where a legacy sibling sorts among real branchesac82650fix(chat-list): open a focused chat row with Enter or Spacee4bc9acfix(chat-list): one keypress opens a row once, however long it is helddd6279bfix(chat-list): describe the branch-count toggle by what users see📊 Changes
5 files changed (+866 additions, -299 deletions)
View changed files
📝
docs/chats/branches.md(+2 -2)📝
packages/client/src/components/layout/ChatSidebar.tsx(+616 -297)➕
packages/client/src/lib/chat-branch-tree.ts(+139 -0)📝
packages/client/src/localization/locales/en.json(+2 -0)➕
scripts/regressions/chat-branch-tree.regression.ts(+107 -0)📄 Description
Linked issue
Closes #8025
Why this change
The chat list folds every branch of a chat into one row with a branch-count badge, so a branch can only
be found by opening the chat, opening Chat Settings, and expanding Chat Branches. Branches of
branches are worse: they render as one flat pile, which is why the reporters rename them by hand as
"<parent branch> - <alt name>"just to tell them apart.The hierarchy already exists in the data — every Engine-created branch records its immediate source
chat in
metadata.branchParentChatId, andGET /chatsalready returns it — but nothing in the listshowed it. Without this change the only way to navigate branches stays a flat modal list, and a branch
that updates in the background is invisible while it is not the active chat.
What changed
A chat's branches now open as a thread list under its row. The chat keeps its row, and its
existing branch-count badge becomes the toggle: it gains a small chevron and opens the branches
beneath, each nested under the branch it was made from. Every branch shares the chat's characters,
so a branch row drops the avatar and keeps only what tells branches apart: its display name, when it
was last active, busy/unread, and a delete button. One compact row style at every depth, so the
indent alone says who belongs to whom.
Shared data (no server, schema, storage or API change)
packages/client/src/lib/chat-branch-tree.ts— pure builder turning one group's chats into renderrows in pre-order: the chat at depth 0, each branch below its own parent, siblings in the caller's
order.
scripts/regressions/chat-branch-tree.regression.ts— nested lineage, sibling ordering,parent-before-child ordering, legacy branches with no lineage and where they sort among real ones,
deleted and self-referencing parents, a parentless cycle, and that every chat in a messy group
appears exactly once.
Chat list UI
<button aria-expanded>with a "Show/Hide branches of {name}"label. Rows without branches pay nothing: no chevron gutter, no spacer, so every chat name in the
list stays at the same x. On touch the badge's tap area grows to about 44px without growing the
pill.
and each nested level's line starts under its parent's name, so a child can never sit left of its
parent. Past four levels a branch still renders, just without another step of indent.
SmoothFolderContentcollapsewith a
border-lguide, and the existing branch badge.different branch is the most recently active one.
getCurrentGameGroupRepresentativepicks (the newest), and a lineage-rooted tree would demote thegroup to its eldest session.
the active branch row is highlighted.
highlights a row it is not rendering.
truncated name; their delete button deletes that one branch.
name), and opens the matching group while a filter is active.
today's single row and count. Inventing a parent there would be a lie about the data.
tabIndex), and Enter or Space now opens it. Staging's row was focusable but did nothing on Enter;the key goes through the row's click handler, so multi-select and the touch-drag guard apply too.
Docs —
docs/chats/branches.mddescribed the old single-row behaviour and now describes the list.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
What I ran locally:
pnpm check— passed (TypeScript, ESLint, localization, format, build).node scripts/run-regressions.mjs --filter chat-branch-tree— 1/1 passed.of a branch and a branch of that, plus an unrelated chat): the badge opens and closes the list, the
rows nest correctly, only the active branch is highlighted, no console errors.
names start where the chat's name starts (x 66), and the nested lines sit under their parents'
names (66, 81).
with the chat row's, the badge's tap area is 54×47, and the active branch's group opens on reload.
rows follow multi-select, the connector geometry went away). The thread-list redesign came after.
above it and is now a real test of where a legacy sibling sorts). Two declined: the unread badge's
red copies the existing per-chat badge verbatim, and the docs paragraph about message IDs predates
this PR (only its last sentence is ours).
Left for the maintainer to check by hand:
Enter on the badge only opens or closes the branches.
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/chats/branches.mdis edited, so it needs a[docs-i18n] docs/chats/branches.mdfollow-up. I havenot filed it; the text is drafted and waiting for approval.
UI evidence (if applicable)
Before: one row per branched chat, with a
⑂ Nbadge and no way to see or pick a branch without openingChat Settings.
After: the badge opens the branches under the chat as a compact thread list, with the active branch
highlighted; collapsed, the chat row carries the highlight instead.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.