Commit 0613cd2
authored
fix(dash): only act on key Press events in the overlay dispatch (#89)
The dash event loop dispatched each operational overlay (serve wizard,
engine manager, onboarding, …) straight to its `on_key` via
`if state.<overlay>.is_some()` arms that ran BEFORE the general
`handle_key` — the only place filtering non-Press key events. Terminals
that also emit Release/Repeat events (Windows Terminal / ConPTY under
WSL, kitty keyboard protocol) thus delivered each keystroke to overlays
twice.
For the serve wizard's model picker this meant Enter chose+closed the
picker on Press, then the Release/Repeat echo re-opened it seeded with
the just-chosen model as a filter — so the model could never be selected.
This hit both the bare-`rocm` launcher (focused Serve) and the full dash,
since both share this loop.
Extract `is_actionable_key(KeyEventKind)` (Press only), add a
top-priority arm that swallows non-Press key events above every key arm
so the Press-only invariant covers overlays too, and route `handle_key`
through the same predicate. Regression test:
`only_press_key_events_are_actionable`.
Signed-off-by: Michael Roy <michael.roy@amd.com>1 parent 3e9ec2b commit 0613cd2
1 file changed
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1694 | 1694 | | |
1695 | 1695 | | |
1696 | 1696 | | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
1697 | 1711 | | |
1698 | 1712 | | |
1699 | 1713 | | |
| |||
2679 | 2693 | | |
2680 | 2694 | | |
2681 | 2695 | | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
2682 | 2709 | | |
2683 | | - | |
| 2710 | + | |
2684 | 2711 | | |
2685 | 2712 | | |
2686 | 2713 | | |
| |||
3442 | 3469 | | |
3443 | 3470 | | |
3444 | 3471 | | |
| 3472 | + | |
| 3473 | + | |
| 3474 | + | |
| 3475 | + | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
3445 | 3484 | | |
3446 | 3485 | | |
3447 | 3486 | | |
| |||
0 commit comments