Skip to content

fix: multi-line comments on committed Review-tab files - #234

Merged
Ziinc merged 2 commits into
mainfrom
cursor/review-committed-multiline-comments-813b
Aug 9, 2026
Merged

fix: multi-line comments on committed Review-tab files#234
Ziinc merged 2 commits into
mainfrom
cursor/review-committed-multiline-comments-813b

Conversation

@Ziinc

@Ziinc Ziinc commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Multi-line drag selection and comment-from-selection in the Review tab only consulted working-tree allFileHunks, so committed-only files never expanded a selection and the + button could not open a multi-line composer.
  • Selection/comment helpers now resolve hunks from committedFileHunks as well (with content-based disambiguation when a path appears in both maps), and DiffContentArea wires real comment getters for the Committed section.

Test plan

  • Unit: ChangesDiffViewer.committed-multiline.test.tsx (highlight + composer on committed hunks)
  • Integration: test/integration/review/comments.test.tsx committed describe
  • Screenshot QA: scripts/screenshot/specs/committed-multiline-comment.spec.tsx (selection + composer on committed Review tab)
  • Lint / format / tsc
  • Confirm uncommitted multi-line selection still works in manual smoke
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 9, 2026 09:01
Selection and comment-from-selection only looked up working-tree hunks, so
drag-selecting committed Review-tab lines never expanded and the + button
could not open a multi-line composer. Resolve hunks from committedFileHunks
as well, and wire committed file comment getters through DiffContentArea.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>
Tighten array destructuring for eslint, drop a banned test comment, and
align screenshot expectations with the hover-only + button affordance.

Co-authored-by: Ziinc <Ziinc@users.noreply.github.com>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Committed Review-tab hunks live in committedFileHunks, not allFileHunks. Drag expansion previously bailed out when the file was missing from the working-tree map.

  • Fallback to committedFileHunks so committed-only files can expand a multi-line selection
  • When the same path exists in both maps, prefer the map whose anchor line content matches the mouseDown capture — avoids selecting the wrong hunks for overlapping committed/uncommitted rows
  • See useLineSelection.ts

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Committed section previously stubbed getFileCommentsForFile / getOutdatedCommentsForFile to () => [], so any comments attached to committed files could never render in that section.

  • Wire the real getters through now that selection/comment creation can target committed hunks
  • Permalink: DiffContentArea.tsx

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleAddCommentFromSelection had the same working-tree-only lookup, so even a successful selection couldn't open a multi-line composer on committed hunks.

  • Resolve hunks from both maps (same content-based disambiguation as selection)
  • isCommentOutdated also consults committed hunks via resolveFileHunks so comments on committed lines aren't mis-classified once that map is the source of truth
  • Permalink: useComments.ts

@Ziinc
Ziinc marked this pull request as ready for review August 9, 2026 11:03
@Ziinc
Ziinc merged commit 73f470f into main Aug 9, 2026
10 checks passed
@Ziinc
Ziinc deleted the cursor/review-committed-multiline-comments-813b branch August 9, 2026 11:03
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.

2 participants