feat: add line range comment support with visual selection mode#115
feat: add line range comment support with visual selection mode#115agavra merged 3 commits intoagavra:mainfrom
Conversation
agavra
left a comment
There was a problem hiding this comment.
This is awesome, I've been wanting to add this feature. I'll be curious to see if the agent does any better with mutliline ranges than with leaving a comment somewhere within the range. I'll definitely use it!
| // Apply visual selection highlighting if applicable | ||
| let style = if is_in_visual_selection { |
There was a problem hiding this comment.
note that highlighting doesn't seem to work in split mode
There was a problem hiding this comment.
Here are some options Claude offers:
❯ Multiline selection doesn't really work in split mode, since it would select both old and new side at the same time. Is there a way
to fix it without harming UX or should we just disable multiline support for split mode altogether?
⏺ Good catch. Let me think through the options for handling visual selection in side-by-side mode.
Option 1: Disable visual mode in split view
- Simplest implementation
- User can switch to unified view (v) to use visual selection
- Minor UX friction but keeps behavior predictable
Option 2: Use h/l to select which side in visual mode
- In side-by-side + visual mode, h/l could switch between selecting old vs new side
- j/k still extends the selection vertically
- Status bar shows which side is active: "VISUAL L10-L15 (new)" or "VISUAL L10-L15 (old)"
- More complex but preserves full functionality
--
I'd be slightly in favor of 2, since this also seems weird for single line comments (should the comment apply to old or new side)
There was a problem hiding this comment.
I like favor 2 as well, though instead of h/l let's use ;h and ;l (nerdtree bindings, the way you can navigate between file browser/diff browser) and add it to the cycle with tab. since that gets chunky let's just ignore this bug and file a ticket we can follow up with that change in a future PR. (h/l is for horizontal scrolling, which is useless in split mode because it ...s but nice to have consistency)
Add support for comments that span multiple lines (e.g., L10-L15): - Add LineRange struct with start/end bounds and helper methods - Add line_range field to Comment with serde(default) for backward compat - Add VisualSelect input mode with V keybinding to enter visual mode - Use j/k to extend selection, c/Enter to create range comment - Display ranges as "L10-L15" in comment panel and status bar - Export ranges as `file:10-15` or `file:~10-~25` for old side - Add visual selection highlighting in unified diff view - Add 23 new tests covering LineRange, Comment, and export functionality Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add visual mode to Features list - Add V keybinding to Review Actions table - Add new Visual Mode keybindings section - Update Review Output example to show line range format Co-Authored-By: Claude Opus 4.5 <[email protected]>
Map both `v` and `V` to visual mode for entering/exiting line range selection. The diff view toggle is now accessible via the `:diff` command instead of the `v` key. Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
Thanks for the contribution @dmvk! 🔥 |
Add support for comments that span multiple lines (e.g., L10-L15):
file:10-15orfile:~10-~25for old side