Repository navigation
fix(frontend): ignore keyless key events and stop composer autocorrect - #480
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
PR Reviewer Guide 🔍(Review updated until commit bb196cb)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
… 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.
|
Persistent review updated to latest commit bb196cb |
PR Code Suggestions ✨No code suggestions found for the PR. |
User description
Summary
keyvalue, such as the one Chrome dispatches when its autofill popup touches a password field, made the shortcut handler throw "Cannot read properties of undefined (reading 'length')".lswith "Is" and turned quotes curly.Change
lib/keyboardShortcuts.ts:formatShortcutEventreturnsnullfor an event without a key, next to the existing modifier-only case. Both callers, the global shortcut handler and the Keyboard Shortcuts recorder, already treatnullas "not a shortcut".components/message/PromptInput.tsx: the textarea setsautocomplete="off"always, keeps autocorrect, sentence capitalization and spellcheck in normal mode, and turns all three off in bash mode.null; the existing bash-mode composer test now also asserts the attributes in normal and bash mode.Validation
pnpm test: frontend 320 files / 4096 tests passpnpm typecheck,pnpm lint: clean (41 pre-existing warnings, 0 errors)Notes
PR Type
Bug fix
Description
Skip key events that have no key value
Disable browser autocorrect, autocapitalize and spellcheck in composer
Extend tests for keyless events and composer attributes
Diagram Walkthrough
File Walkthrough
keyboardShortcuts.ts
Guard shortcut formatting against keyless eventsfrontend/src/lib/keyboardShortcuts.ts
formatShortcutEventnow returnsnullwhen the event has nokeyvaluekeyboardShortcuts.test.ts
Cover keyless keydown in shortcut testsfrontend/src/lib/keyboardShortcuts.test.ts
keyisundefinedformatShortcutEventreturnsnullfor that casePromptInput.command.test.tsx
Extend composer tests for text assistance attributesfrontend/src/components/message/PromptInput.command.test.tsx
normal mode
PromptInput.tsx
Disable composer text assistance attributesfrontend/src/components/message/PromptInput.tsx
autoComplete="off"unconditionallyautoCorrect,autoCapitalizeandspellCheckin all modes