fix(desktop): resolve Ctrl+Alt+Enter accept drops and duplicate typo LLM checks

This commit is contained in:
Yun Chan 2026-10-31 04:43:50 +09:00
parent 2a62f2496a
commit 02d0d0c6c1
15 changed files with 238 additions and 19 deletions

View file

@ -438,6 +438,31 @@ describe('ChordStateMachine — AltGr chord guard', () => {
machine.keyUp(ctrlRightAlt, VK.AltRight)
expect(events.map(label)).toEqual(['command:pressed', 'command:released'])
})
it('releasing Ctrl or RightAlt first releases both command and suggestion-accept so the next Ctrl+Alt+Enter is never swallowed', () => {
machine.setBindings(defaultEntries())
const ctrlAltEnter = keyOf(VK.Enter, { ctrl: true, alt: true })
// 1st press: Ctrl+RightAlt held -> Enter pressed -> Ctrl released first -> RightAlt released (Enter keyup missed or released after)
machine.keyDown(ctrlRightAlt)
machine.keyDown(ctrlAltEnter)
machine.keyUp(keyOf(VK.CtrlLeft, { alt: true }), VK.CtrlLeft)
machine.keyUp(keyOf(VK.AltRight), VK.AltRight)
// 2nd press: Ctrl+RightAlt held -> Enter pressed -> RightAlt released first
machine.keyDown(ctrlRightAlt)
machine.keyDown(ctrlAltEnter)
machine.keyUp(ctrlRightAlt, VK.AltRight)
// 3rd press: must still fire suggestion-accept:pressed
machine.keyDown(ctrlRightAlt)
machine.keyDown(ctrlAltEnter)
const acceptPressedCount = events.filter(
(e) => e.actionId === 'suggestion-accept' && e.type === 'pressed'
).length
expect(acceptPressedCount).toBe(3)
})
})
// ============================================================