Skip to content

fix(github): refresh PRs on an open item page as visible workspace rows - #48007

Merged
Jinwoo-H merged 5 commits into
mainfrom
fix/item-page-prs-refresh-as-visible-rows
Nov 24, 2026
Merged

Jinwoo-H merged 5 commits into
mainfrom
fix/item-page-prs-refresh-as-visible-rows

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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.

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.
  • 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, checks pending).
  • 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.

Review

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.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

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.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d01da7a0-abc6-4ee3-9e4c-e9d281d9742c
Commits

Reviewing files that changed from the base of the PR and between 048f779 and c7d13b6.

Files selected for processing: 1

  • src/renderer/src/store/slices/hosted-review/refresh/visible-item-page-review-host-scope.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

…resh-as-visible-rows

# Conflicts:
#	src/renderer/src/components/bots/items/BotItemLinkChips.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e8e2a5c-5667-482c-9c93-cdd083249ba9
Commits

Reviewing files that changed from the base of the PR and between 95ea772 and 39f294e.

Files selected for processing: 2

  • src/renderer/src/components/bots/items/BotItemGitHubChip.tsx
  • src/renderer/src/components/bots/items/BotItemLinkChips.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@Jinwoo-H
Jinwoo-H merged commit 56e27bb into main Nov 24, 2026
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant