feat(web): pull request files can be marked as viewed - #7721
maria-rcks merged 96 commits into
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds viewed-file tracking across GitHub, GitLab, Bitbucket, and Azure DevOps. Adds environment persistence, RPC endpoints, provider revision APIs, optimistic client state, UI controls, Azure DevOps diff generation, and repository identity normalization. ChangesPull request review features
Priority: ➖ Normal Estimated code review effort: 5 (Critical) | ~120 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Reader
participant PullRequestCodeTab
participant ClientRuntime
participant WebSocket
participant PullRequestService
participant Provider
participant ViewedRepository
Reader->>PullRequestCodeTab: Toggle file viewed
PullRequestCodeTab->>ClientRuntime: Queue viewed-state update
ClientRuntime->>WebSocket: pullRequests.setFilesViewed
WebSocket->>PullRequestService: setFilesViewed
PullRequestService->>Provider: Read file revision when needed
PullRequestService->>ViewedRepository: Store environment mark
PullRequestService-->>WebSocket: Complete update
WebSocket-->>ClientRuntime: Refresh viewed state
ClientRuntime-->>PullRequestCodeTab: Render viewed or changed state
Merge Risk: 🟡 Moderate · up to Large Azure-created or deleted files can produce oversized diff responses, increasing memory and transport risk. This should be bounded before merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 67.95% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 78 functions across 52 files. (2 skipped: 2 unsupported.) Full details: Description checkExplanation The description contains detailed change, testing, UI, and verification information, but it does not use the required What Changed, Why, UI Changes, and Checklist sections. It also does not provide the required checklist responses.
✨ Finishing Touches🧪 Generate unit tests (beta)
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 adds a cross-provider viewed-file workflow with persistent storage, new authenticated RPCs, client-side state management, and substantial Azure diff behavior. It also changes product defaults and adds static-analysis suppression directives, so the breadth and runtime impact require human review. You can add or adjust custom eligibility rules. Learn more. |
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
GitHubScreen.Recording.2026-08-20.at.6.15.29.PM.mov |
The branch had drifted behind main far enough to conflict, which blocked review of the change itself. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
The button exists for a reader who can see that what they are looking at is behind, so leaving one part of the page on the last read defeats the point of pressing it. A push since that read is exactly when the mark beside a ticked file stops being true. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
An error the reader cannot act on, about a press they have already replaced, reads as their current tick having been lost when it has not. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
There was a problem hiding this comment.
One finding on the new viewed-files hook: the command-failure path surfaces an error toast for interrupt-only failures, which diverges from the repo's established useAtomCommand failure convention. Everything else in the web scope (Checkbox/Tooltip primitive use, the amber caveat icon matching the adjacent meta-line pattern, header portal render-prop stability via refs, explicit environmentId threading) looks consistent.
Posted via Macroscope — UI Consistency
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…s-viewed-upstream
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
…s-viewed-upstream Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com> # Conflicts: # apps/server/src/pullRequest/PullRequestService.ts # apps/web/src/components/pullRequest/PullRequestCodeTab.tsx # docs/user/source-control.md # packages/contracts/src/pullRequest.test.ts # packages/shared/package.json
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Bil0000
left a comment
There was a problem hiding this comment.
Re-reviewed 0d64740. Server, web, contracts, shared and mobile review suites green (765 / 449 / 29 / 42 / 71), typecheck clean on server, web and mobile, lint clean, CI green, up to date with main, no overlapping files.
Julius's round checks out against the code:
- Azure summary is one
azread now, and both reactors go throughsummary(), so the polled path no longer pays for iterations and changes. - The pause bypass is scoped to
requiredViewerOf. Background reads hitrateLimits.checkbefore the shared flight, so a paused host is not re-spawned per refresh, and the flight key is still caller-free so a listing and a press coalesce. The new test pins one lookup across an eleven-minute pause. - The overlay bug is fixed the right way. I reproduced the original with the logic helper (viewed pressed, host says dismissed, nothing pending, overlay kept) and confirmed the
answeredset retires it on the first read after the acknowledged write, with the hook tests covering the pushed-before-read sequence. - Bitbucket revisions now come off one parse, and a complete answer seeds the held entry for every file, so the tick after this one costs nothing. Docs and description corrected, migration is 052, comment density roughly halved.
One new bug, introduced by the complete-answer seeding, inline. It is Bitbucket only and only on a change with more than a thousand files, but the outcome is a mark that never reports Changed, which is the thing the feature exists to report. Reproduced through the service with a test that fails on this head.
Two notes, neither blocking on my side: the scope split Julius asked for has not happened, and that is his call, not mine. And the last commit rewrites an unrelated existing mobile test to drop its cross-entry-point equality assertion; main's version of that test passes against this head on my machine, so if it is a CI flake it deserves its own commit with the failure linked rather than riding in here.
Will approve once the trim is fixed.
A whole-change answer wider than one entry's path cap trimmed away the reader's own files, which stored the mark without a baseline and left it reading viewed however far the head moved. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Bil0000
left a comment
There was a problem hiding this comment.
Re-reviewed 042e3c6. The trim bug is fixed: asked paths are seeded last, so the cap can only reach what the whole-change answer added. My repro (1178-file complete answer, tick f0000 and f0500, move both, refresh) now reports both as dismissed, and the new test beside the cap test covers the same shape and fails on the old ordering.
Server pull request suites green (753), typecheck and lint clean, CI green, merges clean with no overlapping files. The one-line change touches nothing else.
Approving. Scope split remains Julius's call.
juliusmarminge
left a comment
There was a problem hiding this comment.
Audit of 042e3c6
Verdict: fix first. Every blocker from my previous round is genuinely fixed and the branch is green on its own, but it cannot land as-is: it has a textual conflict with main on the migration number and, more importantly, a semantic conflict with #11888 that makes four of this PR's own viewed-files tests fail once main is merged in.
Blockers
1. pullRequests.invalidate no longer refreshes viewed marks after merging main.
#11888 (f4600d7) changed invalidate to canonicalise the reference through canonicalRef before bumping the epoch, so the epoch scope now carries the project's resolved host. Every other read (summary, detail, diff) goes through credentialCached, which canonicalises the input the same way, so their keys line up. filesViewed and setFilesViewed are exposed on the service raw and key on the client's un-hosted reference, so after the merge refEpoch(input) in the filesViewed cache key reads a scope that invalidate never bumps.
Consequence: on GitLab, Bitbucket and Azure, a reader who pushes and hits refresh keeps seeing "viewed" instead of "Changed" for up to FILES_VIEWED_CACHE_TTL, and the refresh path the docs promise for staleness stops working. On GitHub the host is authoritative so it is only a delayed re-read.
Evidence: merged origin/main into this head in a scratch worktree (migration renumbered to 053, see below) and ran apps/server/src/pullRequest/: 4 failures in PullRequestService.test.ts, all tests that use service.invalidate({ reference }):
reports a file pushed to since it was cleared as changedleaves a mark alone when the host could not say what the head has of itkeeps the version it last heard when a later read of the head stops shortforgets what the head had of a marked file once a mutation moves the head
The same tests pass on the un-merged head (753/753). CI could not see this because the merge-ref check never ran while the PR reports as conflicting.
Smallest fix, verified (full merged server pullRequest + persistence + server.test.ts suite 1007/1007, server and web typecheck clean):
// PullRequestService.of({ ... })
filesViewed: (input) => canonicalRef(input).pipe(Effect.flatMap(filesViewed)),
setFilesViewed: (input) => canonicalRef(input).pipe(Effect.flatMap(setFilesViewed)),plus input.host ?? null as a slot in the filesViewedCache key and the matching field in its loader:
const [, , projectId, host, repository, number] = JSON.parse(key) as [number, number, string, string | null, string, number];
return viewedFiles.filesViewed({ projectId, ...(host === null ? {} : { host }), repository, number } as PullRequestRef);2. Migration 052 is taken. Main now has 052_ProjectionThreadTitleState.ts (#10720), so Migrations.ts conflicts and this PR's file needs to become 053_PullRequestFilesViewed.ts. Mechanical, but it is why GitHub reports the PR as conflicting and why blocker 1 was invisible.
Previous findings, re-checked
All three blockers from my last round are resolved and hold up:
- Azure polling cost (5a5b7bd):
getChangeRequestSummaryis a singleazread, so the reactor's one-minute poll no longer walks iterations. - Global
getViewerpause bypass (4c404a8): opt-in viaviewerAllowsPause, onlyrequiredViewerOfasks for it, backgroundresolveViewerscallers hitrateLimits.checkbefore joining the shared flight. The project-registration call site does not pass the flag. Pinned by c98d31b. - Optimistic tick hiding a pushed file (63ea078): the press retires on the first read that lands after the acknowledged write, regardless of whether the host agrees. The hook test covers the push-between-write-and-read sequence.
Also confirmed: Bitbucket revisions off one parsed patch with the asked-paths-last trim fix (042e3c6), and the revision guide now matches the implementation on a failed press.
Non-blocking
- Unrelated mobile test rewrite (0d64740). The preceding merge commit did fail CI on
shikiReviewHighlighter.test.ts(run 34856951033), so it was not invented. But main's version of that test passed 3/3 for me on the merged tree, and the rewrite drops the assertion thathighlightSourceFileandhighlightCodeSnippetproduce equal tokens. That is a weakening of a test this PR does not otherwise touch. It belongs in its own PR with the failure linked; if it is a grammar warm-up flake, fix the warm-up rather than remove the equality. - Scope. Still four PRs in one: viewed marks; Azure diff support with the new
diffdependency; Azure SSH remote canonicalisation inpackages/shared/src/git.ts; thegitPatchPathquoted-name fix across web and mobile. At minimum the Azure diff work and the remote canonicalisation should land separately, since each changes behaviour for Azure users who never touch a checkbox. - Squash on merge.
Verification
- PR head: server
src/pullRequest/+src/persistence/PullRequestFilesViewed753/753; webcomponents/pullRequest/+lib/diffRendering+lib/openPullRequestLink449/449; shared 836/836; contractspullRequest29/29. - Head merged with
origin/main(migration renumbered to 053): server pullRequest + persistence +server.test.ts1007/1007 only with thecanonicalRefpatch above; 4 failures without it. Server and web typecheck clean on the patched merge. - CI is green on 042e3c6 but runs against the head, not the merge.
- Not verified: live GitLab/Bitbucket/Azure calls, and no browser pass on the UI.
Audit by Claude Fable 5 via Claude Code.
…s-viewed-upstream Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com> # Conflicts: # apps/server/src/persistence/Migrations.ts
The equality it dropped guards a test this change does not otherwise touch, and the CI flake behind the rewrite is load-sensitive rather than a property of viewed marks. Both belong in their own change. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
…s-viewed-upstream
|
On the scope point: I cannot use |
|
Note Written by @juliusmarminge ready for another review at f28664a. Current main is integrated, migration is 053, and credential-aware cache keys use the current reference encoding. The unrelated mobile highlighter test rewrite is no longer in the PR diff. The takeover also fixed collapsed-default viewed gestures, quoted GitHub/GitLab filenames, account guards and environment routing, and viewed-only invalidation (including skipping linked-thread sync). All latest CI checks pass. Blacksmith passed 374 focused regression tests and 203 server/sync tests, relevant typechecks and scoped lint. Two independent final reviewers approved this exact head. Both outstanding inline threads are resolved. The PR body includes live GitHub mark/unmark evidence, independent provider readback, and the no-diff-refetch check. Live GitLab/Bitbucket/Azure sessions were not rerun; their automated coverage and the author's demos remain linked. Your earlier request to split Azure diff support and SSH canonicalization remains a scope decision. I preserved the existing PR and history rather than splitting or replacing it during this takeover. Please re-review the fixes and that remaining scope question; your changes-requested review is still active. |
## What's Changed * fix(web): keep thoughts and failed tool calls in one activity row by @maria-rcks in pingdotgg/t3code#12270 * fix(web): avoid reopening settled threads when adding projects by @dominic-r in pingdotgg/t3code#11804 * feat(mobile): make Settings easier to navigate and scope by @juliusmarminge in pingdotgg/t3code#12272 * fix(mobile): prevent overlapping text and UI on Android chat messages by @Exotic209093 in pingdotgg/t3code#11611 * feat(web): pull request files can be marked as viewed by @yordis in pingdotgg/t3code#7721 * fix(web): keep composer banners compact and readable by @Bil0000 in pingdotgg/t3code#12166 * fix(web): collapse thoughts within tool groups by @maria-rcks in pingdotgg/t3code#12302 * fix(usage): preserve saved totals after transcript cleanup by @maria-rcks in pingdotgg/t3code#12304 * fix(mobile): show Agent behavior icon on Android by @juliusmarminge in pingdotgg/t3code#12316 ## New Contributors * @Exotic209093 made their first contribution in pingdotgg/t3code#11611 **Full Changelog**: pingdotgg/t3code@v0.0.43-nightly.20260917.1866...v0.0.43-nightly.20260917.1880 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.43-nightly.20260917.1880
Merges `pingdotgg/t3code` `6d1d549441..9946541` (50 commits) into the fork. Landed 304 files against 303 in the upstream range — the extra one is `docs/fork/inventory.json`. Fork delta is 777 files, unchanged from the last merge. Everything upstream changed landed. Six conflicts, each resolved with the verdict `preflight.mjs` printed; five were a single hunk. Details and reasoning are in [the merge tracker](docs/fork/upstream-merge-log.md). The two worth reading here: - **`ChatView.tsx`** — pingdotgg#12306 added `activeWorktreePath !== null` to the "Revert files too" button, on the line the fork gates with `FEATURES.checkpointFileRestore`. Kept both as a conjunction: upstream's condition is about a shared workspace, the fork's is about what Moatless serves, and they answer different questions. - **`FilePreviewPanel.tsx`** (the one `decide`) — pingdotgg#10909 restructured the file read so a folder is knowable as a folder, adding `isDirectory` / `previewPath`. Took that whole and re-stated the fork's `onRetargetFile` effect on top. `apps/web/src/routeTree.gen.ts` was regenerated rather than hand-resolved. One judgement call: pingdotgg#11598's new `/settings/storage` page is deliberately **not** given a `FEATURES` gate. It self-gates on two new capability booleans Moatless does not report and renders an explanatory notice, so a fork flag would duplicate a decision the wire already makes — and would have to be deleted again the day the capability is reported. ## Usable as-is - Diff files open from a right-click context menu (pingdotgg#11842). - Sidebar filtering from the thread menu (pingdotgg#8719). - Command palette matches thread IDs (pingdotgg#11185). - Mobile settings are easier to navigate and scope (pingdotgg#12272); favorites in the mobile model picker (pingdotgg#12231). - Thoughts collapse within tool groups (pingdotgg#12302); thoughts and failed tool calls stay in one activity row (pingdotgg#12270). - Folder links from chat open the file tree instead of a broken preview (pingdotgg#10909). - Chat no longer jumps when the scroll-to-end pill mounts (pingdotgg#12317); numbered jumps no longer steal browser tabs (pingdotgg#12315); composer banners stay compact (pingdotgg#12166). - A large batch of shared-component refactors across web and mobile (pingdotgg#12353–pingdotgg#12371). ## Unsupported in Moatless / needs implementation - **Pull request files marked as viewed** (pingdotgg#7721) — adds `pullRequests.filesViewed` and `pullRequests.setFilesViewed`, which record which files a reviewer has checked off, persisted server-side. Both declare `PullRequestRpcError` and so arrived already refusing; `unsupported-methods.mjs` reported ADD 0 / DROP 0 as a result. Closes with the rest of the `pullRequests.*` group, not separately. - **Multi-model threads in separate worktrees** (pingdotgg#12179) — one prompt starts a thread per selected model, each in its own worktree. The model picker is the same `worktree` send-mode control `FEATURES.worktreeSelection` already gates, so the fan-out is simply not offered. The same commit adds a `requiredWorktreeBootstrap` capability the backend does not report. - **Automatic storage cleanup settings** (pingdotgg#11598) — the `/settings/storage` page, gated by the backend's absent `storageCleanup` and `projectWorktreeCleanup` capabilities. Needs the sweeper below before the page means anything. - **Command palette entries for the pull requests and usage pages** (pingdotgg#12211) — the PR half is covered by `FEATURES.pullRequestSurface`. ## Backend behavior to consider reproducing in Moatless Eight items, recorded in full in [the gaps register](docs/fork/gaps.md) under _Runtime fixes upstream made to its own server_. Five are on the checkpoint and usage paths the previous merge already opened: - **Reject a file rewind on a shared or nested-owner cwd** (pingdotgg#12306, `CheckpointReactor.ts`) — a checkpoint holds the whole checkout, so restoring one erases a sibling's uncommitted work. Moatless isolates by sandbox, but a workspace with nested repositories has the same overlap inside one task. - **Capture a checkpoint when the baseline lookup fails** (pingdotgg#12307) — the case that silently leaves a turn with no restore point. - **Move the file-search refresh off the checkpoint path** (pingdotgg#12308) — it extended every capture by an index walk. - **Survive an empty nested repository, and clear a stale index lock** (pingdotgg#12181, `GitVcsDriver.ts`) — git cannot stage an embedded repository until it has a commit. The lock half matters most here: forced termination is the normal end of a sandboxed task. - **Bound the provider event log before serialization** (pingdotgg#12305, `EventNdjsonLogger.ts`) — otherwise it grows proportionally to tokens streamed. - **Keep usage totals across transcript cleanup** (pingdotgg#12304, `UsageService.ts`) and **resolve a contested fingerprint to the newest scan** (pingdotgg#10315, `usageMerge.ts`). Moatless serves `server.getUsageSummary` itself. - **Pass provider image attachments by path** (pingdotgg#11050, `CodexAdapter.ts`) — the turn/start request stops scaling with attachment size. A sandbox adds a hop, so an oversized request costs more there. - **Sweep stale worktrees and transcripts against retention rules** (pingdotgg#11598, `storageCleanup.ts`, with a workspace lease so two servers cannot sweep the same directory). A sandbox per task bounds the worktree half; transcripts outlive the sandbox. ## Verification `verify.mjs` — all 9 checks green on the first full pass, tests included (333 test files, 5071 tests). No flaky retries and no caveats. Contract drift: ADD 0 / DROP 0, so `packages/contracts/src/rpc.ts` needed no change. The `orchestration-decode-boilerplate` duplicate-add exception went stale — the colliding line is gone — and was deleted from `inventory.json` in this merge. Owned-concern sweep: the three new `apps/mobile/src/features/connection/` files are false positives, all upstream extracting shared mobile components out of files it already owned, with no fork delta in any of them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- Moatless task: https://moatless.soaplabstest.com/tasks/c83db5aa-7c47-47c6-93f4-fe2f6f9f548e
adds per-file viewed marks to the pull request code tab, with automatic folding and a "changed" state after a file is pushed. github uses its native marks; forgejo, gitlab, bitbucket, and azure devops keep marks per viewer on the connected t3 environment. azure devops gains the diff support needed for this review flow.
resolved conflicts with main, preserved viewed-only diff caching, and isolated stored marks by the requested repository even when another checkout supplies its credentials. truncated forgejo diffs cannot establish a false revision baseline.
verified against real forgejo 16.0.5 through tea 0.16.0 and the t3 web client: mark/unmark, folding, reload persistence, alpha-only changed detection after a real push, and modified/added/deleted/renamed/unicode filenames. a second real repository with the same pr number and filename verified storage isolation and adoption by a newly added checkout. sqlite readback confirmed separate keys and real blob revisions.
blacksmith: the 1,266-test scoped suite passed; all 157 service tests passed again after the isolation fix. the new isolation regression fails on the previous code. server/web typechecks and scoped lint passed. live gitlab, bitbucket, and azure sessions were not rerun; their existing adapter tests passed.
final head
c2b9144829b184090c005d36ab17e560604d06a3: all github checks passed, both independent final reviewers approved, and no review threads remain unresolved. the pr diff is 67 files, +9,014/-200, compared with 66 files, +8,805/-199 at takeover.implemented and reviewed with
gpt-6-astravia codex.