Skip to content

feat(desktop): comment on a range of lines in Review - #4425

Merged
LHagfoss merged 3 commits into
mainfrom
feat/desktop-review-range-comments
Nov 25, 2026
Merged

LHagfoss merged 3 commits into
mainfrom
feat/desktop-review-range-comments

Conversation

@LHagfoss

Copy link
Copy Markdown
Owner

What

Review comments can cover a range of lines.

  • App: click a line number, then Shift-click another on the same side in the same hunk. The range is tinted in the gutter, and the comment box opens after its last line. Escape or Cancel clears it. The draft keeps startLine (persisted with the drafts). Send to agent writes path:11-18 and quotes up to 6 lines, then "…". Post to #N sends start_line/start_side. rangeLines in state/diff.ts refuses a range that crosses a hunk header.
  • Engine: the batch review's ReviewComment gains optional start_line/start_side. review_payload sends a one-line range as a single line, refuses a range that ends before it starts, and defaults start_side to the comment's side. The review payload and its comment type moved to pull_review.rs (re-exported from pull_requests), which brings pull_requests.rs down from 2,590 to 2,523 lines. The size cap is lowered to match.

Changelog

Review: Shift-click a second line number to comment on a range of lines; the agent and pull request reviews get the whole range.

Testing

  • bun run check (new state/diff.test.ts: range lines per side, refused across hunks, range message and elision).
  • Engine unit tests in pull_review.rs (payload with and without a range, single-line collapse, reversed range refused, old JSON without the fields). No local Rust build on this machine: CI compiles and runs them.
  • cargo fmt --all -- --check, comment and size lints.
  • Mock, dark theme: on mock-thread-1, clicked new line 1 and Shift-clicked line 2. Both are tinted, and the saved draft's message reads - `src/app.ts:1-2`: … with both lines quoted.

Closes #4397

@github-actions github-actions Bot added the feature New feature or request label Nov 25, 2026
@LHagfoss
LHagfoss merged commit 2f2892b into main Nov 25, 2026
11 checks passed
@LHagfoss
LHagfoss deleted the feat/desktop-review-range-comments branch November 25, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(desktop): comment on a range of lines in Review

2 participants