-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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.\n\nThis work item will: \n- 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.\n- 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.\n\nAcceptance criteria:\n- ChordHandler.feed preserves deferred handlers when deduping duplicate events.\n- New unit test in test/tui-chords.test.ts reproduces the issue and passes.\n- All existing tests continue to pass.\n\nNotes:\n- Priority: medium.\n- Issue discovered during PR review of PR #930 (TUI freeze fixes).