Skip to content

fix(diff-viewer): reset comment editor scroll on comment change#736

Merged
matt2e merged 1 commit into
mainfrom
review-comment-scroll
May 18, 2026
Merged

fix(diff-viewer): reset comment editor scroll on comment change#736
matt2e merged 1 commit into
mainfrom
review-comment-scroll

Conversation

@matt2e
Copy link
Copy Markdown
Contributor

@matt2e matt2e commented May 18, 2026

Summary

  • Reset the CommentEditor textarea's scrollTop to 0 when the displayed comment's identity changes, so a previously-scrolled comment no longer leaks its scroll offset into the next comment being viewed.

Test plan

  • Open a review with multiple comments; scroll within a long comment, then switch to a shorter comment and confirm the textarea is scrolled to the top.
  • Edit an existing comment and confirm the textarea still initializes at the top.

The CommentEditor textarea reused its scrollTop across comments, so
switching from a long, scrolled comment to another comment kept the
old offset and hid the new comment's top. Bind the textarea and
reset scrollTop in the effect that swaps in the new content.

Signed-off-by: Matt Toohey <contact@matttoohey.com>
@matt2e matt2e requested review from baxen and wesbillman as code owners May 18, 2026 00:45
@matt2e matt2e merged commit 317e721 into main May 18, 2026
6 checks passed
@matt2e matt2e deleted the review-comment-scroll branch May 18, 2026 01:01
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