The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): leave Space activation to focused controls
brooklyn!2a6debe5eb9d
diff --git a/apps/desktop/src/lib/keybinds/composer-focus-keys.test.ts b/apps/desktop/src/lib/keybinds/composer-focus-keys.test.tsindex c1fe51484c1..98ed53b1582 100644--- a/apps/desktop/src/lib/keybinds/composer-focus-keys.test.ts+++ b/apps/desktop/src/lib/keybinds/composer-focus-keys.test.ts@@ -166,13 +166,14 @@ describe('composerFocusKeysAllowed', () => {expect(composerFocusKeysAllowed(keydown({ key: 'h', code: 'KeyH', target: document.body }), 'type')).toBe(true)})- it('refuses editables; refuses Enter on buttons but allows / and typing', () => {+ it('refuses editables; leaves Enter and Space to buttons but allows / and typing', () => {const input = document.createElement('input')const button = document.createElement('button')document.body.append(input, button)expect(composerFocusKeysAllowed(keydown({ key: 'a', code: 'KeyA', target: input }), 'type')).toBe(false)expect(composerFocusKeysAllowed(keydown({ key: 'Enter', code: 'Enter', target: button }), 'enter')).toBe(false)+ expect(composerFocusKeysAllowed(keydown({ key: ' ', code: 'Space', target: button }), 'type')).toBe(false)expect(composerFocusKeysAllowed(keydown({ key: '/', code: 'Slash', target: button }), '/')).toBe(true)expect(composerFocusKeysAllowed(keydown({ key: 'a', code: 'KeyA', target: button }), 'type')).toBe(true)})diff --git a/apps/desktop/src/lib/keybinds/composer-focus-keys.ts b/apps/desktop/src/lib/keybinds/composer-focus-keys.tsindex 1c01f3ec4c7..8c009991d8b 100644--- a/apps/desktop/src/lib/keybinds/composer-focus-keys.ts+++ b/apps/desktop/src/lib/keybinds/composer-focus-keys.ts@@ -184,5 +184,6 @@ export function composerFocusKeysAllowed(event: KeyboardEvent, combo: string): breturn false}- return !(combo === 'enter' && isActivateOnEnterTarget(event.target))+ // Space activates focused buttons too; it must not become a composer draft.+ return !((combo === 'enter' || event.key === ' ') && isActivateOnEnterTarget(event.target))}