feat(web): pull request files can be marked as viewed - #7721
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
Reviewed the changed web UI: the new viewed-file checkbox in the diff header, the counter in the toolbar, and the fold/overlay logic modules. Two findings, both on changed lines in PullRequestCodeTab.tsx.
Posted via Macroscope — UI Consistency
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces a new user-facing feature (marking PR files as viewed) with new UI components, RPC endpoints, GraphQL mutations, and client-side state management across multiple packages. New feature additions warrant human review. You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2bc61d8. Configure here.
There was a problem hiding this comment.
Reviewed the web UI changes (PullRequestCodeTab.tsx, pullRequestDiff.logic.ts, pullRequestFilesViewed.logic.ts, usePullRequestFilesViewed.ts) for shared-primitive use, Tailwind/CSS ownership and virtualizer behavior.
Both findings from the previous run are resolved: the Checkbox no longer carries a partial size-* override, and truncated is now threaded through the hook and surfaced in the meta line with the same Tooltip + TriangleAlertIcon treatment the withheld-diff caveat uses. Two remaining items below — one virtualizer regression risk, one accessible-name issue on the new control.
Posted via Macroscope — UI Consistency
A review spread over an afternoon, or picked up on a second machine, started again from the top every time, so large changes were read in the browser and only small ones stayed here. The marks are the host's rather than ours because a checkbox only this app remembers is worse than none: it looks like the one GitHub shows, disagrees with it, and leaves a reviewer unsure which of the two knows what they have actually read. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…he window resets Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…since Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…at it is partial Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…he wrong way Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…count Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…carries Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
A press moved the whole viewed view, and every file header on screen was memoized on it, so one tick cost a rebuild of all of them. The same mark also has to say whether the control is offered at all, or a capability arriving after the first paint leaves the headers without a box. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
It borrowed its name from the label beside it, and that label turns into "Changed" once the file has been pushed to, leaving a reader who cannot see it with no idea what the box does. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
1296cb6 to
6b44e51
Compare
Screen.Recording.2026-08-20.at.6.15.29.PM.mov |

Note
Medium Risk
Adds new pull-request RPCs and GitHub GraphQL mutations that write viewer state, plus dedicated cache invalidation. Paths are sent as GraphQL variables rather than interpolated into the query.
Overview
Lets reviewers tick files off on GitHub pull requests so a long review can be resumed on another machine or in the browser. Marks live on the host, not locally; GitLab/Bitbucket/Azure hide the control.
Code tab: each file header gets a Viewed checkbox that also folds/unfolds the file. A toolbar count tracks files on screen; files pushed since they were cleared show Changed. Presses are optimistic, batched after 400ms, and rolled back on failure.
Backend: new
pullRequests.filesViewed/setFilesViewedRPCs (read vs operate scope). GitHub pages GraphQL viewed state (capped at 5×100 files, thentruncated) and batches mark/unmark into one aliased mutation. Viewed state has its own 15s cache; ticking a file does not drop the diff cache. Unsupported hosts fail with a dedicated operation error.Reviewed by Cursor Bugbot for commit 6b44e51. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add per-file viewed tracking to pull requests
viewedFilescapability, contracts (PullRequestFileViewedState,PullRequestFilesViewedResult,PullRequestSetFilesViewedInput), and two WebSocket RPCs (pullRequests.filesViewed,pullRequests.setFilesViewed) for reading and writing per-file viewed state.setFilesViewedbumps only thefilesViewedepoch so the diff cache stays valid.Viewedcheckbox per file header with optimistic overlay, batched flushes after 400ms, failure rollback,Changedindicator for stale (dismissed) states, and fold-state sync viatoggleFileDiffFoldForViewed.setFilesViewedon unsupported hosts returnsPullRequestOperationError("filesViewed")/("setFilesViewed")instead of a generic error;RPC_REQUIRED_SCOPESnow requiresAuthOrchestrationReadScopefor reads andAuthOrchestrationOperateScopefor writes.Macroscope summarized 6b44e51.