Commit f96fabc
SIN CI
fix(tui): wire compact toggle, crash recovery on quit, block input during streaming
3 real bugs fixed:
1. CompactToggle (c key) was in keymap but never handled in handleKey.
Now toggles compact mode with system message feedback.
2. CrashRecovery.Save() was never called on quit — chat history was
lost on crash/quit. Now saves on all 3 quit paths (Ctrl+X, Ctrl+C,
keymap.Quit). Init() restores on next launch with '↻ Restored from
previous session' message.
3. User could submit messages during streaming — wastes tokens and
interrupts the response. SubmitMsg handler now blocks with
'⏳ Wait for the current response to finish (Esc to interrupt)'.
Input shows '⏳ Waiting for response…' placeholder when disabled.
Build ✅ | Tests ✅ (-race) | CEO 99/A+1 parent 6e24b62 commit f96fabc
3 files changed
Lines changed: 58 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
93 | 98 | | |
94 | 99 | | |
95 | 100 | | |
| |||
414 | 419 | | |
415 | 420 | | |
416 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
417 | 425 | | |
418 | 426 | | |
419 | 427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
250 | 256 | | |
251 | 257 | | |
252 | 258 | | |
| |||
312 | 318 | | |
313 | 319 | | |
314 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
315 | 326 | | |
316 | 327 | | |
317 | 328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
77 | 89 | | |
78 | 90 | | |
79 | 91 | | |
| |||
445 | 457 | | |
446 | 458 | | |
447 | 459 | | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
458 | 472 | | |
459 | 473 | | |
460 | 474 | | |
| |||
616 | 630 | | |
617 | 631 | | |
618 | 632 | | |
| 633 | + | |
619 | 634 | | |
620 | 635 | | |
621 | 636 | | |
| |||
757 | 772 | | |
758 | 773 | | |
759 | 774 | | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
760 | 786 | | |
761 | 787 | | |
762 | 788 | | |
| |||
2317 | 2343 | | |
2318 | 2344 | | |
2319 | 2345 | | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
2320 | 2349 | | |
2321 | 2350 | | |
2322 | 2351 | | |
| |||
0 commit comments