From c87df9de4b5a1376a8efbab06a08ea6c8e14eb03 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Fri, 6 Nov 2026 08:41:43 -0500 Subject: [PATCH 1/3] fix(frontend): ignore a key event with no key in the shortcut handler --- frontend/src/lib/keyboardShortcuts.test.ts | 7 +++++++ frontend/src/lib/keyboardShortcuts.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/keyboardShortcuts.test.ts b/frontend/src/lib/keyboardShortcuts.test.ts index 9e1dfce71..65d33622d 100644 --- a/frontend/src/lib/keyboardShortcuts.test.ts +++ b/frontend/src/lib/keyboardShortcuts.test.ts @@ -23,6 +23,13 @@ describe('keyboardShortcuts', () => { expect(formatShortcutEvent(new KeyboardEvent('keydown', { key: 'Shift', shiftKey: true }))).toBeNull() }) + it('ignores a key event without a key, such as one Chrome autofill dispatches', () => { + const autofillEvent = new KeyboardEvent('keydown') + Object.defineProperty(autofillEvent, 'key', { value: undefined }) + + expect(formatShortcutEvent(autofillEvent)).toBeNull() + }) + it('returns the shared defaults with the key set', () => { expect(Object.keys(getDefaultKeyboardShortcuts())).toEqual(Object.keys(DEFAULT_KEYBOARD_SHORTCUTS)) }) diff --git a/frontend/src/lib/keyboardShortcuts.ts b/frontend/src/lib/keyboardShortcuts.ts index 418eca7b0..52bf4c017 100644 --- a/frontend/src/lib/keyboardShortcuts.ts +++ b/frontend/src/lib/keyboardShortcuts.ts @@ -59,7 +59,7 @@ export function formatEventModifiers(e: KeyboardEvent): string { * Formats a keydown event as a canonical shortcut string such as `Cmd+Shift+Z`, or null for a lone modifier key. */ export function formatShortcutEvent(e: KeyboardEvent): string | null { - if (isModifierOnlyEvent(e)) return null + if (!e.key || isModifierOnlyEvent(e)) return null return [...eventModifiers(e), eventMainKey(e)].join('+') } From a1c254621989d00224d0623c90f7f414e523ea2b Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Fri, 6 Nov 2026 08:41:43 -0500 Subject: [PATCH 2/3] fix(frontend): disable browser autocomplete and autocorrect in the composer --- .../src/components/message/PromptInput.command.test.tsx | 6 ++++++ frontend/src/components/message/PromptInput.tsx | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/frontend/src/components/message/PromptInput.command.test.tsx b/frontend/src/components/message/PromptInput.command.test.tsx index 5cd875cb1..71e78c42c 100644 --- a/frontend/src/components/message/PromptInput.command.test.tsx +++ b/frontend/src/components/message/PromptInput.command.test.tsx @@ -642,6 +642,9 @@ describe('PromptInput command submission', () => { renderComponent() const input = await screen.findByPlaceholderText('Send a message...') + expect(input).toHaveAttribute('autocomplete', 'off') + expect(input).toHaveAttribute('autocorrect', 'on') + expect(input).toHaveAttribute('spellcheck', 'true') fireEvent.focus(input) fireEvent.change(input, { target: { value: 'text' } }) expect(screen.getByRole('button', { name: 'bash !' })).toBeDisabled() @@ -654,6 +657,9 @@ describe('PromptInput command submission', () => { expect(input).toHaveValue('!') expect(screen.getByTestId('composer-mode-badge')).toHaveTextContent('BASH') expect(screen.getByRole('button', { name: 'cmd /' })).toBeDisabled() + expect(input).toHaveAttribute('autocorrect', 'off') + expect(input).toHaveAttribute('autocapitalize', 'off') + expect(input).toHaveAttribute('spellcheck', 'false') fireEvent.click(screen.getByRole('button', { name: 'bash !' })) expect(input).toHaveValue('') diff --git a/frontend/src/components/message/PromptInput.tsx b/frontend/src/components/message/PromptInput.tsx index f0a8d4598..0f2af3cb7 100644 --- a/frontend/src/components/message/PromptInput.tsx +++ b/frontend/src/components/message/PromptInput.tsx @@ -1280,6 +1280,10 @@ return ( onDragOver={handleDragOver} onDragLeave={handleDragLeave} onDrop={handleDrop} + autoComplete="off" + autoCorrect={isBashMode ? 'off' : 'on'} + autoCapitalize={isBashMode ? 'off' : 'sentences'} + spellCheck={!isBashMode} placeholder={ isBashMode ? "Enter bash command..." From bb196cb118c7b7e48b7818f71eba62a76e2b3100 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Fri, 6 Nov 2026 10:19:30 -0500 Subject: [PATCH 3/3] fix(frontend): turn off autocorrect, capitalization and spellcheck in the composer Prompts often mention file names, commands and identifiers, which browser text assistance rewrites. Disable autocorrect, auto-capitalization and spellcheck in every composer mode, not only bash mode. --- .../src/components/message/PromptInput.command.test.tsx | 5 +++-- frontend/src/components/message/PromptInput.tsx | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/message/PromptInput.command.test.tsx b/frontend/src/components/message/PromptInput.command.test.tsx index 71e78c42c..f560876d1 100644 --- a/frontend/src/components/message/PromptInput.command.test.tsx +++ b/frontend/src/components/message/PromptInput.command.test.tsx @@ -643,8 +643,9 @@ describe('PromptInput command submission', () => { const input = await screen.findByPlaceholderText('Send a message...') expect(input).toHaveAttribute('autocomplete', 'off') - expect(input).toHaveAttribute('autocorrect', 'on') - expect(input).toHaveAttribute('spellcheck', 'true') + expect(input).toHaveAttribute('autocorrect', 'off') + expect(input).toHaveAttribute('autocapitalize', 'off') + expect(input).toHaveAttribute('spellcheck', 'false') fireEvent.focus(input) fireEvent.change(input, { target: { value: 'text' } }) expect(screen.getByRole('button', { name: 'bash !' })).toBeDisabled() diff --git a/frontend/src/components/message/PromptInput.tsx b/frontend/src/components/message/PromptInput.tsx index 0f2af3cb7..c951ed077 100644 --- a/frontend/src/components/message/PromptInput.tsx +++ b/frontend/src/components/message/PromptInput.tsx @@ -1281,9 +1281,9 @@ return ( onDragLeave={handleDragLeave} onDrop={handleDrop} autoComplete="off" - autoCorrect={isBashMode ? 'off' : 'on'} - autoCapitalize={isBashMode ? 'off' : 'sentences'} - spellCheck={!isBashMode} + autoCorrect="off" + autoCapitalize="off" + spellCheck={false} placeholder={ isBashMode ? "Enter bash command..."