Repository navigation
fix(review): comment on the cursor's line when its number is pressed - #239
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/diffstoggles off a lone selected line when its number is pressed again, soonLineSelectionEndsaw no selection and opened no composer. Every other line number opened one.The viewer still dispatches
onLineClickfor the number-column press after the toggle-off. When that press leaves no selection,ReviewPanenow opens the composer on the pressed line. A press that leaves a selection already went throughonLineSelectionEndand 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.