Live PR status badge on Kanban cards (web parity + daemon refresh)#619
Merged
Merged
Conversation
The TUI kanban already renders a live PR badge (state + checks + diff) and refreshes PR info on a tick, but the web/desktop board only showed a bare PR chip and never surfaced state or CI. This brings the web to parity and keeps the cached PR state fresh daemon-side so the badge updates without a restart. - web API: taskJSON / BoardEntry now carry a `pr` object (state, check_state, mergeable, additions, deletions) decoded from the cached PRInfoJSON. - web UI (Board.tsx): PRBadge renders state-colored icon (open/draft/merged/ closed), a CI check mark (passing/failing/pending, conflicts as failing), and diff stats; falls back to a bare chip for legacy rows without cached state. - db: UpdateTaskPRInfo records a board-change event only when the PR JSON actually changes, so the SSE feed re-pushes the board live without spamming. - executor: refreshActivePRInfo refreshes cached PR state for processing/blocked tasks with a branch on a 90s tick (batch list, rate-limit gated), carrying forward a known CI rollup so checks aren't wiped. Render cache: hashTaskCard already hashes every PR field the TUI badge reads, so the existing signature covers it — no stale-card regression. Tests: web PR payload (present/omitted, board snapshot, string mappings), db event-on-change/no-op, all touched Go packages + tsc green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
QA — web board PR badge (live)Built the UI into Full board — every state on real app chrome: Close-up — icons + colors + diff stats: States verified on the cards:
|
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 & why
The TUI kanban already renders a live PR badge (state + checks + diff stats) and refreshes PR info on a tick — but the web/desktop board only showed a bare purple
PR #Nchip and never surfaced state or CI, and the cached PR state only updated when a TUI was open. This brings the web board to parity and keeps the cache fresh daemon-side so the badge updates without a restart.Changes
Web API (
internal/web/handlers.go,board.go)taskJSONandBoardEntrynow carry aprobject —state(open/draft/merged/closed),check_state(passing/failing/pending/""),mergeable,additions,deletions— decoded from the cachedPRInfoJSONalready persisted on each task. Omitted when there's no PR.Web UI (
desktop/src/components/Board.tsx,api/types.ts)PRBadge: state-colored icon (open=green, draft=gray, merged=purple GitMerge, closed=red), a CI check mark (passing / failing / pending; merge conflicts read as failing, matching the TUI), and+/-diff stats. Falls back to a bare chip for legacy rows with a URL but no cached state yet. Card memo equality compares the new PR fields so SSE ticks repaint on change.Live updates (
internal/db/tasks.go)UpdateTaskPRInforecords a board-change event only when the PR JSON actually changes, so the SSE board stream re-pushes live without spamming the feed on idle refreshes.Daemon refresh (
internal/executor/executor.go)refreshActivePRInforefreshes cached PR state for processing/blocked tasks with a branch on a 90s tick, reusing the rate-limit-gated batchFetchAllPRsForRepo. It carries forward a previously-known CI rollup (the batch path omitsstatusCheckRollupby design) so checks aren't wiped, and skips terminal PRs (left toreconcileReviewTasks). Keeps the web board live even with no TUI open.Render-cache gotcha — verified
hashTaskCardalready hashes every PR field the TUI badge reads (State,CheckState,Mergeable,Additions,Deletions). No new TUI card field was added, so the existing render signature covers the badge — no stale-card regression.Tests
internal/web/pr_badge_test.go: PR payload present/omitted on/api/tasks,BuildBoardSnapshotincludes PR, state/check string mappings.internal/db:UpdateTaskPRInfoemits a board event on change and stays quiet on a no-op.go testgreen for db/web/executor/github/ui; gofmt clean; golangci-lint v2.8.0 clean;tsc --noEmitclean.Acceptance
🤖 Generated with Claude Code