Skip to content

fix(web): review pane keeps scroll on refresh and comments are editable - #78

Merged
kalvenschraut merged 1 commit into
rtvisionfrom
fix/review-pane-scroll-comment-edits
Oct 5, 2026
Merged

kalvenschraut merged 1 commit into
rtvisionfrom
fix/review-pane-scroll-comment-edits

Conversation

@kalvenschraut

Copy link
Copy Markdown
Member

Problem

Refreshing the review pane on a large diff threw the reader back to the top. Large diffs load file by file, and that path keyed its state on the diff's content hash, so every refresh that changed the diff remounted the viewer, reset the loaded-file window to four files, and started every file patch from scratch. Review comments also could not be edited once saved, in the review pane or in a pull request review.

Fix

  • useReviewFilePatches scopes its state to the comparison (environment, cwd, source kind, base ref, whitespace) instead of the content hash. A refresh refetches the loaded files in place. Effect atoms keep the previous result while waiting, so the viewer reconciles items by their stable ids and Pierre's scroll anchoring holds the position. Switching scope, turn, base ref, or whitespace still resets the view on purpose.
  • DiffCommentAnnotation gets an edit mode for saved comments (pencil button; Save or ⌘/Ctrl+Enter, Esc to cancel). It is wired into the review pane and file preview comments. addReviewComment now replaces an edited comment where it stands instead of moving it to the end.
  • Pending pull request review comments get the same edit button, using the existing PullRequestMarkdownEditor and a new updateComment store action. After a successful submit, removeComments removes only comments whose body still matches what was sent, so a comment rewritten while the request was in flight stays pending.

Verification

  • vp test run for composerDraftStore, DiffCommentAnnotation, and all of components/pullRequest (505 tests), including new tests for in-place edits and the in-flight edit race.
  • Web typecheck and lint on the changed files are clean.
  • Reviewed by GPT 6.1 Sol: round 1 found the in-flight submit race (fixed here), round 2 approved with no findings.
  • Not exercised in a browser.

Done by Claude Opus 5.5 in Claude Code (T3 Code), reviewed by GPT 6.1 Sol.

🤖 Generated with Claude Code

Large diffs load file by file, and that path keyed its state on the diff's
content hash. Any refresh that changed the diff remounted the viewer,
dropped loaded files, and threw the reader back to the top. The scope now
names the comparison only, so a refresh refetches loaded files in place and
the viewer keeps its scroll anchor.

Saved review comments in the review pane and file preview, and pending pull
request review comments, can now be edited. Editing keeps a comment's
position, and submitting a review no longer discards a comment rewritten
while the request was in flight.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: 952e8b8 · PR result: b80dc19 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@kalvenschraut
kalvenschraut merged commit 1fc752a into rtvision Oct 5, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant