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
{{ message }}
Repository navigation
fix(github): refresh PRs on an open item page as visible workspace rows - #48007
When an item page is open, the PRs it shows now stay as fresh as the PRs on workspace rows you can see in the sidebar. Close the page and they stop being refreshed for it.
Files
Added
Deleted
Net
Test
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$31
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$31
Prod
9
$\color{#1a7f37}{\Huge{\mathbf{+}}}$103
$\color{#cf222e}{\Huge{\mathbf{−}}}$30
$\color{#1a7f37}{\Huge{\mathbf{+}}}$73
What Changed
The item page reports the workspaces behind its PRs (linked PRs and its workers' PRs) as visible review rows while it is mounted, through a new visibleItemPageReviewWorktreeIds list that the existing visible-review reporter merges with the sidebar's visible rows. Main's PR refresh coordinator then treats them exactly like on-screen sidebar rows: same queue, cadence, rate budget and priority. Unmounting the page (going back, closing the sidebar) clears the list, and views that hide the right sidebar don't count it.
The PR chips under the item title read the shared workspace PR cache (the same overlay the full link rows already used), so a refresh shows up on the chip instead of the host record's older copy.
Removed the per-row one-shot active refresh the link rows queued when their read was older than the cache TTL; the visible-row refresh replaces it.
Why
Chips showed whatever state the host record had at its last read, and the rows only asked for one read on mount. A PR that merged while the page was open kept showing open. Reusing the visible-row path means no new refresh machinery and no reads triggered by CLI calls.
A PR linked on its own, with no local workspace, has no workspace to report, so it is not refreshed by this change; its chip still updates whenever any workspace read lands the same PR URL in the shared cache. Refreshing those by PR number would need a new read path and is left out.
Linked Issue
N/A (maintainer change)
Visual Proof
N/A: no layout change; the chip shows the same fields from a fresher source. Behaviour was verified in a dev build through CDP (below).
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Dev build (macOS, isolated profile, mock keychain), this branch's own workspace and PR as the subject, driven through CDP with the sidebar's PR card reporting off:
Nothing visible: no PR read for the workspace in 10 s; visibleReviewWorktreeIds empty.
Clearing it (page unmount) empties the visible set again.
Same measurement through the sidebar's own channel (setVisibleReviewCardWorktreeIds) vs the item-page channel: both give one read on exposure when the data is stale and the same follow-up timing afterwards; main cannot tell the two apart.
Not exercised end to end: a real item with worker PRs (needs live agent turns).
No new tests: this is wiring into the existing visible-row refresh, which has its own coverage. Existing hosted-review refresh and item tests pass (--maxWorkers=1), pnpm tc:web and oxlint pass.
Performance
None measurable. The page adds at most a handful of workspace ids to the visible set the sidebar already reports; main schedules them with the existing visible-row cadence and rate budget, deduplicated with any sidebar row showing the same workspace. The per-row one-shot read is gone. The reporter's identity selector gains one more reference-compared input.
Risk
Level: Low. Worst case an open item page keeps a few extra workspaces refreshing at the visible-row cadence, or (if unmount were missed) until the page's ids change. Plain revert.
The item page's PR chips showed the host record's copy and the list rows asked the
queue for one active read when stale. The page now reports its PRs' workspaces as
visible rows, so the existing visible refresh keeps them fresh, and chips read the
shared PR cache like the list rows do.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
The change adds GitHub state for visible item-page PR worktree IDs. Bot item link rows publish unique IDs to that state, and visible review refresh reporting includes those IDs when the active view can show the right sidebar. BotItemGitHubChip renders the row returned by useBotItemLivePr, which applies a newer cached read. The hook no longer enqueues per-row refreshes. PR row collection replaces an existing entry when the new entry has a worktree ID and the existing entry does not.
Merge Risk: Minimal · up to c7d13
The change keeps PR chips on an open item page fresh through the existing refresh path. No concrete merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: PRs on an open item page are refreshed as visible workspace rows. The raw summary shows the item page publishing visible review worktree IDs, the reporter merging them…
Description check
The description follows the template sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, and Review. It explains the mechanism, the before and after behavior, th…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: PRs on an open item page are refreshed as visible workspace rows. The raw summary shows the item page publishing visible review worktree IDs, the reporter merging them, and the one-shot refresh removed. The title uses the conventional fix(github) prefix and stays within one sentence, although it is 71 characters.
Full details: Description check
Explanation
The description follows the template sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, and Review. It explains the mechanism, the before and after behavior, the reasons for the approach, the risk level, and the rollback path. The Linked Issue section says N/A (maintainer change) and does not link an issue. The Risk section does not list a level in the template form, though it does state Low. The AI Disclosure, Agent skill upstream boundary, and Checklist sections were removed or left unfilled. The Review section is empty. The Testing section includes CDP results. Its Performance section gives a reason. The Visual Proof section gives N/A with a reason, which the template requires.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
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
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.
ELI5
When an item page is open, the PRs it shows now stay as fresh as the PRs on workspace rows you can see in the sidebar. Close the page and they stop being refreshed for it.
What Changed
visibleItemPageReviewWorktreeIdslist that the existing visible-review reporter merges with the sidebar's visible rows. Main's PR refresh coordinator then treats them exactly like on-screen sidebar rows: same queue, cadence, rate budget and priority. Unmounting the page (going back, closing the sidebar) clears the list, and views that hide the right sidebar don't count it.activerefresh the link rows queued when their read was older than the cache TTL; the visible-row refresh replaces it.Why
Chips showed whatever state the host record had at its last read, and the rows only asked for one read on mount. A PR that merged while the page was open kept showing open. Reusing the visible-row path means no new refresh machinery and no reads triggered by CLI calls.
A PR linked on its own, with no local workspace, has no workspace to report, so it is not refreshed by this change; its chip still updates whenever any workspace read lands the same PR URL in the shared cache. Refreshing those by PR number would need a new read path and is left out.
Linked Issue
N/A (maintainer change)
Visual Proof
N/A: no layout change; the chip shows the same fields from a fresher source. Behaviour was verified in a dev build through CDP (below).
Testing
Dev build (macOS, isolated profile, mock keychain), this branch's own workspace and PR as the subject, driven through CDP with the sidebar's PR card reporting off:
visibleReviewWorktreeIdsempty.setVisibleItemPageReviewWorktreeIds([id])(what the item page publishes): the workspace joins the visible set and PR fix(github): refresh PRs on an open item page as visible workspace rows #48007 lands in the shared PR cache 2 s later (open, checkspending).setVisibleReviewCardWorktreeIds) vs the item-page channel: both give one read on exposure when the data is stale and the same follow-up timing afterwards; main cannot tell the two apart.Not exercised end to end: a real item with worker PRs (needs live agent turns).
No new tests: this is wiring into the existing visible-row refresh, which has its own coverage. Existing hosted-review refresh and item tests pass (
--maxWorkers=1),pnpm tc:weband oxlint pass.Performance
None measurable. The page adds at most a handful of workspace ids to the visible set the sidebar already reports; main schedules them with the existing visible-row cadence and rate budget, deduplicated with any sidebar row showing the same workspace. The per-row one-shot read is gone. The reporter's identity selector gains one more reference-compared input.
Risk
Level: Low. Worst case an open item page keeps a few extra workspaces refreshing at the visible-row cadence, or (if unmount were missed) until the page's ids change. Plain revert.
Review