✨ Worktree support, branch triage list, and branch review - #32
Draft
trasta298 wants to merge 3 commits into
Draft
Conversation
Three features for parallel-branch workflows (common with AI coding agents that spawn many worktrees/branches): - Worktrees: list linked worktrees, show a ⌂ marker on their branches in the graph and the worktree path in the commit detail pane. Create (w) and remove (W) worktrees via the git CLI. Guard checkout/delete of branches checked out in another worktree, which git2 does not enforce. - Branch triage list (B): full-screen list of local branches with ahead/behind vs the base branch (origin/HEAD -> main -> master), merged/base badges, worktree marker, last activity and subject. Checkout (Enter), delete (d), bulk-delete merged branches (D). - Branch review (v): show the cumulative diff merge-base..branch (git diff base...branch) in the existing file list / file diff views, with a base…branch badge in the status bar. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHpCigTLkn7MstZMcP9twP
RUSTSEC-2026-0194/0195 are DoS issues in quick-xml's XML parsing, patched only in 0.41.0, which syntect -> plist cannot use yet. keifu never parses untrusted XML (syntect loads its bundled binary dumps), so the advisories are not reachable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHpCigTLkn7MstZMcP9twP
Performance: - Compute branch review diffs on a background thread; the UI showed a freeze on large branches (same mpsc pattern as commit diffs) - Build graph rows for the visible window only instead of all ~500 rows on every frame (the offset is now synced by clamp_graph_offset) - Read worktree HEAD files directly instead of opening each worktree as a Repository on every auto-refresh - Replace O(n²) already-shown scans in build_graph with a HashSet - Resolve HEAD once in BranchInfo::list_all instead of per branch - Skip full row clones for branch-list movement keys UX: - Show errors in a wrapping dialog; long git errors were clipped to one status-bar line and unreadable - Clear stale in-progress messages when an operation fails, and stop silent auto-fetch from pinning unrelated messages forever - Drop whole status-bar hints that don't fit instead of clipping mid-word; fixed-height dialogs so y/n hints survive 24-row terminals - Checkout now reports success, and dirty-tree conflicts get an actionable message instead of raw git2 codes - Empty states for a fresh repo and an empty branch list; "1 file changed" pluralization; neutral search badge only after typing - Branch list: name column sized to content, subject preferred over date on narrow widths; B toggles the list; ? opens help from it - Help popup: Branch List / Diff View sections, readable width on narrow terminals; detail panes stack below 70 columns Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHpCigTLkn7MstZMcP9twP
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.
Summary
Three features aimed at parallel-branch workflows — increasingly common now that AI coding agents spawn many worktrees and branches (
.claude/worktrees/,worktree-*, etc.):1. Worktree first-class support
⌂marker in the graph ([agent-task ⌂]), and the commit detail pane shows the worktree pathwcreates a worktree for the selected branch (path input pre-filled with a sibling directory),Wremoves it (confirmation; refuses when dirty viagit worktree remove)2. Branch triage list (
B)Full-screen list of local branches for cleaning up branch sprawl:
origin/HEAD→main→master),merged/basebadges,⌂worktree marker, last activity, commit subjectEntercheckout,ddelete (warns when not merged),Dbulk-delete merged branches (HEAD / base / worktree-attached branches are excluded),v/w/Walso work from the list3. Branch review (
v)merge-base..branch(=git diff base...branch) in the existing FileSelect / FileDiff viewsbase…branchbadge and a REVIEW mode labelImplementation notes
git, matching the existing fetch/push pattern, so CLI locking and checkout rules applyDiffSource::Rangethrough FileSelect/FileDiff, reusing the diff viewer; the async uncommitted-diff sync is guarded so it never overwrites a review file listbranch_listmode) are updatedTest plan
cargo test(72 passed) — newtests/branch_triage_test.rscovers base-branch detection, triage ahead/behind/merged flags, worktree listing, and range diffscargo clippy --all-targets/cargo fmt --checkclean--debug-listen): ⌂ markers, worktree create/remove, checkout guard message, triage list rendering, bulk prune of merged branches, review badge + range file diff🤖 Generated with Claude Code
https://claude.ai/code/session_01HHpCigTLkn7MstZMcP9twP