You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Show each worktree branch's GitHub PR lifecycle state so you can tell at a glance which worktrees are done (merged), abandoned (closed), or still in flight (open/draft) — the key input to "can I delete this worktree?"
This is the networked half of worktree status; the offline local-sync half (ahead/behind/dirty) is tracked in #13.
This issue (PR status) is the enhancement layer. When the user has connected GitHub (gh auth present and the feature enabled), PR state is layered onto / alongside the same status column. When GitHub is not connected, the view falls back cleanly to just the Local sync indicators: ahead / behind / dirty per worktree #13 baseline — no errors, no gaps.
So the mental model is: worktree status always shows local sync; connect GitHub to additionally see PR state. Build #13 first; this layers on top.
States (first cut — states only)
Per branch with a PR:
none — no PR for this branch
draft — PR open, draft (not yet asking for review)
open — PR open, ready for review
merged — PR merged (worktree is likely safe to delete)
closed — PR closed without merge (abandoned — distinct from merged)
Why
"Merged" and "closed" are the strongest signals that a worktree is disposable; "draft" vs "open" distinguishes work-in-progress from review-ready. Pairs with #13: merged + synced = safe to remove.
Enablement
Gate on connecting GitHub: detect existing gh auth and turn the layer on via a flag/config (e.g. --pr / a config key). No bespoke auth flow — lean on gh.
Data source: gh / GitHub API. One batched call covers all branches: gh pr list --json number,headRefName,state,isDraft,... (plus a query for merged/closed). Avoid per-branch calls.
Likely restricted to -w live mode and/or behind the enable flag, given the cost. Cache results between refreshes; don't refetch every 2s tick — respect rate limits.
Summary
Show each worktree branch's GitHub PR lifecycle state so you can tell at a glance which worktrees are done (merged), abandoned (closed), or still in flight (open/draft) — the key input to "can I delete this worktree?"
This is the networked half of worktree status; the offline local-sync half (ahead/behind/dirty) is tracked in #13.
Relationship to #13 — progressive enhancement
These two are designed as one layered feature, not two disconnected columns:
gh authpresent and the feature enabled), PR state is layered onto / alongside the same status column. When GitHub is not connected, the view falls back cleanly to just the Local sync indicators: ahead / behind / dirty per worktree #13 baseline — no errors, no gaps.So the mental model is: worktree status always shows local sync; connect GitHub to additionally see PR state. Build #13 first; this layers on top.
States (first cut — states only)
Per branch with a PR:
Why
"Merged" and "closed" are the strongest signals that a worktree is disposable; "draft" vs "open" distinguishes work-in-progress from review-ready. Pairs with #13: merged + synced = safe to remove.
Enablement
gh authand turn the layer on via a flag/config (e.g.--pr/ a config key). No bespoke auth flow — lean ongh.Implementation notes
gh/ GitHub API. One batched call covers all branches:gh pr list --json number,headRefName,state,isDraft,...(plus a query for merged/closed). Avoid per-branch calls.-wlive mode and/or behind the enable flag, given the cost. Cache results between refreshes; don't refetch every 2s tick — respect rate limits.merged,draft,↑PR#123), layered onto the Local sync indicators: ahead / behind / dirty per worktree #13 status column. Coordinate column layout with Local sync indicators: ahead / behind / dirty per worktree #13.Acceptance criteria
mergedandclosedare visually distinct.gh, no auth, offline, non-GitHub remote), the view falls back to the Local sync indicators: ahead / behind / dirty per worktree #13 baseline with no errors.Out of scope / follow-ups