Commit 3e774c5
authored
🤖 Add up arrow to edit last user message (#272)
Pressing up arrow on an empty input now edits the last user message,
providing a quick way to iterate without clicking edit.
## Changes
- **ChatInput**: Added keyboard handler for up arrow when input is empty
- **AIView**: Added `handleEditLastUserMessage` callback that finds last
user message
## Cleanup
While implementing this, also cleaned up related code:
- Fixed placeholder to use `CANCEL_EDIT` keybind instead of `CANCEL`
- Removed redundant empty `CANCEL` keybind handler
- Removed redundant `NEW_LINE` handler (`matchesKeybind` already handles
Shift+Enter)
## Testing
Manually test:
1. Send a message
2. Clear input and press up arrow → should edit last message
3. Type something and press up arrow → should move cursor normally
4. Press Shift+Enter → should still insert newline
---
_Generated with `cmux`_1 parent 9ed91d6 commit 3e774c5
2 files changed
+45
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
259 | 279 | | |
260 | 280 | | |
261 | 281 | | |
| |||
464 | 484 | | |
465 | 485 | | |
466 | 486 | | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
473 | 499 | | |
474 | 500 | | |
475 | 501 | | |
| |||
532 | 558 | | |
533 | 559 | | |
534 | 560 | | |
| 561 | + | |
535 | 562 | | |
536 | 563 | | |
537 | 564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
335 | 336 | | |
336 | 337 | | |
337 | 338 | | |
| 339 | + | |
338 | 340 | | |
339 | 341 | | |
340 | 342 | | |
| |||
809 | 811 | | |
810 | 812 | | |
811 | 813 | | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
817 | 819 | | |
818 | 820 | | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
819 | 824 | | |
820 | 825 | | |
821 | 826 | | |
| |||
825 | 830 | | |
826 | 831 | | |
827 | 832 | | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
| 833 | + | |
835 | 834 | | |
836 | 835 | | |
837 | 836 | | |
| |||
841 | 840 | | |
842 | 841 | | |
843 | 842 | | |
844 | | - | |
| 843 | + | |
845 | 844 | | |
846 | 845 | | |
847 | 846 | | |
| |||
0 commit comments