feat(web): collapse same-worktree chats into one sidebar row - #15
Merged
Conversation
Chats spawned into the same git worktree via the in-chat worktree tab strip no longer each claim their own sidebar row. A worktree now shows as a single row — the earliest-created chat — and its siblings are reachable only through the tab strip. Chats with no worktree are unchanged. Add collapseWorktreeSiblings to Sidebar.logic and apply it in both the v1 sidebar (per project) and the v2 sidebar (before active/snoozed/settled partitioning). When the active route is a collapsed sibling, its representative row highlights, pins when collapsed, gets pulled into view in the settled/snoozed shelves, and keyboard traversal steps relative to it. The v1 project status dot still reads every non-archived thread so a busy sibling is never hidden behind its row. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Chats spawned into the same git worktree via the in-chat worktree tab strip no longer each get their own sidebar row. A worktree now appears as a single sidebar row — the earliest-created chat — and its sibling chats are reachable only through the tabs inside that chat. Chats with no worktree are unchanged (one row each).
Applies to both sidebars: v1 (
Sidebar.tsx) and v2 (SidebarV2.tsx, default on dev/nightly).How
collapseWorktreeSiblings(threads, keyOf)inSidebar.logic.ts— groups byenvironmentId+worktreePath, keeps the earliest-created chat per group (ties broken by id), preserves order, and returns arepresentativeKeyByThreadKeymap.Verification
pnpm typecheck(apps/web): cleanvp linton changed files: cleanSidebar.logic.test.ts: 86/86 passNote on the representative
The representative is the earliest chat (stable title/position). In v2 the row's active/settled bucket follows that earliest chat's status — a known tradeoff of choosing stability over "surface the most recent activity."
🤖 Generated with Claude Code