Skip to content

fix(review): comment on the cursor's line when its number is pressed - #239

Merged
pavelzw merged 1 commit into
mainfrom
mw/cursor-line-click
Sep 30, 2026
Merged

pavelzw merged 1 commit into
mainfrom
mw/cursor-line-click

Conversation

@moritzwilksch

Copy link
Copy Markdown
Owner

After jumping to a file (tree click, J/K, ]), the keyboard cursor selects that file's first changed line. Pressing that line's number did nothing: @pierre/diffs toggles off a lone selected line when its number is pressed again, so onLineSelectionEnd saw no selection and opened no composer. Every other line number opened one.

The viewer still dispatches onLineClick for the number-column press after the toggle-off. When that press leaves no selection, ReviewPane now opens the composer on the pressed line. A press that leaves a selection already went through onLineSelectionEnd and is skipped.

Pressing the line of an already open single-line draft still closes that draft, as on main.

Verified in the browser: tree click, then pressing the cursor's line number opens the composer (it didn't on main). Range drags still store the right anchor. Added a regression test in ReviewPane.test.ts, which fails without the fix.

Found in #238, where the screenshot harness worked around it with Escape.

The keyboard cursor holds a one-line selection, and the viewer toggles a
lone selected line off when its number is pressed again, so that press
opened nothing. It now opens the composer like a press on any other line.
@github-actions github-actions Bot added the fix label Sep 30, 2026
@pavelzw
pavelzw merged commit 5d6db93 into main Sep 30, 2026
15 checks passed
@pavelzw
pavelzw deleted the mw/cursor-line-click branch September 30, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants