Commit e99516e
🤖 feat: add l/h keybinds to mark hunks as read/unread (#509)
Add vim-style keybindings for marking hunks in the code review panel:
- `l`: mark selected hunk as read (reviewed)
- `h`: mark selected hunk as unread (unreviewed)
## Implementation
The keybindings follow vim conventions where `l` (right) moves
forward/marks as done, and `h` (left) moves backward/unmarks.
**Auto-navigation logic**: When `showReadHunks` is disabled and a user
presses `l` to mark a hunk as read, the selection automatically advances
to the next unread hunk. This maintains keyboard navigation flow and
prevents the selection from becoming invalid. The logic reuses the same
pattern as `handleToggleRead` for consistency.
## Testing
Manual testing:
- [x] Press `l` on unread hunk → marks as read, advances to next unread
hunk
- [x] Press `h` on read hunk → marks as unread
- [x] Works correctly when `showReadHunks` is enabled (no
auto-navigation)
- [x] Works correctly when `showReadHunks` is disabled (auto-navigation)
- [x] Typechecks pass
---
_Generated with `cmux`_
---------
Signed-off-by: Test <test@example.com>
Co-authored-by: Test <test@example.com>1 parent 4a5ff11 commit e99516e
File tree
2 files changed
+56
-2
lines changed- src
- components/RightSidebar/CodeReview
- utils/ui
2 files changed
+56
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
422 | 455 | | |
423 | 456 | | |
424 | 457 | | |
| |||
496 | 529 | | |
497 | 530 | | |
498 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
499 | 540 | | |
500 | 541 | | |
501 | 542 | | |
| |||
508 | 549 | | |
509 | 550 | | |
510 | 551 | | |
511 | | - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
512 | 560 | | |
513 | 561 | | |
514 | 562 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
273 | 279 | | |
274 | 280 | | |
275 | 281 | | |
0 commit comments