Sidebar rows show the state of the work, and every task's git facts stay fresh - #249
Merged
Merged
Conversation
…tay fresh A sidebar row could only say whether an agent was attached. A task merged last week, one that never started, and one genuinely waiting on you all wore the same green "idle" dot. The row's trailing slot now answers the question that remains once no agent is attached: what state is the WORK in. It renders `triage.bucket` — merged, open PR, commits ahead, uncommitted, orphan — with `triage.reason` as the tooltip. A live agent keeps the slot (blue running, amber needs-you, hollow when triage says stalled), and the leading agent glyphs are untouched. Two things had to be true first. `prState` was a write-only-"merged" field. Its only two writers both wrote the literal "merged", so `open` and `closed` were unreachable despite being in the type — `.pr.open` in the CSS had never rendered. `detectMerged` already parsed the state from the `gh pr view` it was paying for, then the caller returned early on `!merged` and threw it away. It now returns that state, at no new I/O. Git and PR facts also only refreshed via CH.gitStatus, which the renderer fires from the open task's panel alone, so every other row showed a snapshot from whenever it was last opened, or nothing. worktree-sweep.ts makes that one refresh path with two triggers — the RPC and a 90s background pass — sharing a 60s per-task throttle so they cannot double-probe. Each pass takes 12 worktrees round-robin, skipping live tasks and terminal merged ones. Recording PR facts is split from moving a card to Done: noting an open PR is always safe, while the column move keeps its old guards. Also fixes a collision the glyph exposed: .task-trail is absolutely positioned, so names ellipsized underneath it. The row now reserves that space constantly, so changing state never reflows the row. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
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.
A sidebar row could only say whether an agent was attached. A task merged last week, one that never started, and one genuinely waiting on you all wore the same green "idle" dot (
.tstatus.idle).The row's trailing slot now answers the question that remains once no agent is attached: what state is the work in. It renders
triage.bucketwithtriage.reasonas the tooltip.merged_doneGitMergemerged_unfinishedGitMergeopen_prGitPullRequestunmerged_no_prGitCommitVerticaluncommittedGitCommitVerticalorphanCircleAlertactive/not_startedA live agent keeps the slot (blue running, amber needs-you, hollow when triage says stalled, mirroring the card's
.ring.stalled). The leading agent glyphs are unchanged.Two things had to be true first
prStatewas a write-only-"merged"field. Its only two writers both wrote the literal"merged", soopenandclosedwere unreachable despite being in the type —.pr.openin the CSS had never once rendered.detectMergedalready parsed the state from thegh pr viewit was paying for, then the caller returned early on!mergedand threw it away. It now returns that state, at no new I/O.Git and PR facts only refreshed for the open task.
CH.gitStatusis fired from the task panel alone, so every other row showed a snapshot from whenever it was last opened, or nothing at all.worktree-sweep.tsmakes that one refresh path with two triggers (the RPC, plus a 90s background pass started beside the reap timer), sharing a 60s per-task throttle so they cannot double-probe. Each pass takes 12 worktrees round-robin, skipping live tasks (their events already cover them) and terminalmergedones. Recording PR facts is split from moving a card to Done: noting an open PR is always safe, while the column move keeps its old guards.Also fixes a collision the glyph exposed:
.task-trailis absolutely positioned, so names ellipsized underneath it. The row now reserves that space constantly, so changing state never reflows it.Verification
detectMergedrun against live GitHub:add-search-bar-for-tasks-at→{merged:true, prNumber:61, state:"MERGED"};show-sidebar-scrollbar-opacity-only-on→{merged:false, prNumber:114, state:"OPEN"}. That second case is precisely what the old code discarded.Known gap:
worktree-sweep.tshas no unit test. The throttle, the batch cursor, and the record-PR-state-without-moving-the-column split are the logic worth pinning down.🤖 Generated with Claude Code