Repository navigation
fix(web): review pane keeps scroll on refresh and comments are editable - #78
Merged
Merged
Conversation
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>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
useReviewFilePatchesscopes 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.DiffCommentAnnotationgets 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.addReviewCommentnow replaces an edited comment where it stands instead of moving it to the end.PullRequestMarkdownEditorand a newupdateCommentstore action. After a successful submit,removeCommentsremoves only comments whose body still matches what was sent, so a comment rewritten while the request was in flight stays pending.Verification
vp test runforcomposerDraftStore,DiffCommentAnnotation, and all ofcomponents/pullRequest(505 tests), including new tests for in-place edits and the in-flight edit race.Done by Claude Opus 5.5 in Claude Code (T3 Code), reviewed by GPT 6.1 Sol.
🤖 Generated with Claude Code