When duplicate physical key events arrive while a chord pending-timer is active, the ChordHandler.feed() flow clears the existing timer and also clears pendingHandler. The duplicate dedupe branch then reschedules a timer but pendingHandler is null, which causes the deferred handler to be lost and never invoked.
This work item will:
- Update src/tui/chords.ts so clearing an existing timer does not drop a previously set pendingHandler; preserve/restore the handler across the dedupe path.
- Add a unit test to cover the scenario: a deferred single-key handler is pending, a duplicate physical event arrives, and after the timeout the deferred handler is invoked.
Acceptance criteria:
- ChordHandler.feed preserves deferred handlers when deduping duplicate events.
- New unit test in test/tui-chords.test.ts reproduces the issue and passes.
- All existing tests continue to pass.
Notes:
When duplicate physical key events arrive while a chord pending-timer is active, the ChordHandler.feed() flow clears the existing timer and also clears pendingHandler. The duplicate dedupe branch then reschedules a timer but pendingHandler is null, which causes the deferred handler to be lost and never invoked.
This work item will:
Acceptance criteria:
Notes: