Repository navigation
feat(core): search fields ask a touch keyboard for its Search key and no autocorrection - #8157
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approval waits on an engineering-owner decision: no current Astryx spec covers touch-keyboard traits, so an owner needs to approve or reject making enterkeyhint="search" and autocorrect="off" fixed behavior of the Typeahead, Tokenizer and PowerSearch input, the Selector and MultiSelector search row, and CommandPaletteInput, or approve only the Search key and split autocorrection out. Any engineering owner, including you as the author, records approval by commenting /approve-spec 32f4d2f72b68fd52b503a2fc5a0ec805ca4027d4 on this pull request. Separately, please retag the changeset [feat] instead of [fix] and keep the patch bump, since AST-017 FR7 uses [fix] for corrections and no current contract is being restored. The new tests fail on main and pass here, and desktop rendering is unchanged.
[Automated review]
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] Search fields set up a touch keyboard the way iOS search bars do: a Search key, and no autocorrection. The inputs of Typeahead, Tokenizer, PowerSearch, CommandPaletteInput and the search row of Selector and MultiSelector now carry `enterkeyhint="search"` and `autocorrect="off"`, so an iPhone keyboard shows a Search key (a magnifier on iOS 26) instead of Return and leaves typed names and terms as typed. The key is only a label: Enter still does what it did before in each field. |
There was a problem hiding this comment.
AST-017 FR7 uses [fix] for corrections. No current Astryx spec covers touch-keyboard traits, so nothing is corrected here and this entry should be [feat]; the patch bump stays.
There was a problem hiding this comment.
Retagged [feat] in 9976783; the patch bump stays.
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Pagination | 84.3 kB (+119 B) · 15.9 kB CSS (0) | — | — · — · — |
| Tokenizer · Storybook | 68.4 kB (+114 B) · 17.1 kB CSS (0) | 1,988 (0) | — · — · — |
| MultiSelector · Storybook | 71.1 kB (+107 B) · 15.2 kB CSS (0) | 2,704 (0) | — · — · — |
28 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Selector | 75.2 kB (+104 B) · 15.6 kB CSS (0) | — | — · — · — |
| BaseTypeahead | 53.3 kB (+103 B) · 10.2 kB CSS (0) | — | — · — · — |
| CommandPaletteInput | 26.7 kB (+99 B) · 8.5 kB CSS (0) | — | — · — · — |
| CommandPalette | 48.3 kB (+98 B) · 12.2 kB CSS (0) | — | — · — · — |
| Typeahead | 61.1 kB (+97 B) · 11.8 kB CSS (0) | — | — · — · — |
| PowerSearch | 181.0 kB (+81 B) · 20.5 kB CSS (0) | — | — · — · — |
| lab/MobilePowerSearch | 165.0 kB (+75 B) · 1.2 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 219.8 kB (+73 B) · 454 B CSS (0) | — | — · — · — |
| lab/Comments | 230.3 kB (+4 B) · 2.5 kB CSS (0) | — | — · — · — |
| CommandPaletteEmpty | 6.2 kB (0) · 3.5 kB CSS (0) | — | — · — · — |
| CommandPaletteFooter | 17.0 kB (0) · 3.7 kB CSS (0) | — | — · — · — |
| CommandPaletteGroup | 3.5 kB (0) · 3.5 kB CSS (0) | — | — · — · — |
| CommandPaletteItem | 9.9 kB (0) · 3.6 kB CSS (0) | — | — · — · — |
| CommandPaletteList | 16.0 kB (0) · 3.4 kB CSS (0) | — | — · — · — |
| Field | 39.6 kB (0) · 8.3 kB CSS (0) | — | — · — · — |
| FieldLabel | 33.3 kB (0) · 5.9 kB CSS (0) | — | — · — · — |
| SelectorOption | 16.5 kB (0) · 5.4 kB CSS (0) | — | — · — · — |
| TextArea | 45.4 kB (0) · 9.8 kB CSS (0) | — | — · — · — |
| TextInput | 50.9 kB (0) · 10.9 kB CSS (0) | — | — · — · — |
| TypeaheadItem | 6.3 kB (0) · 3.6 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 62.9 kB (0) · 773 B CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 63.5 kB (0) · 1.1 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 100.6 kB (0) · 1.9 kB CSS (0) | — | — · — · — |
| lab/EmojiPicker | 68.3 kB (0) · 722 B CSS (0) | — | — · — · — |
| lab/MobileTokenizer | 99.1 kB (0) · 880 B CSS (0) | — | — · — · — |
| lab/TransferList | 72.5 kB (0) · 1.7 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 78.7 kB (0) · 1.9 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 225.0 kB (−3 B) · 2.4 kB CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 5.84 MB packed (+524 B); no new dependencies.
Wide change (6 components): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approval waits on an engineering-owner decision: no current Astryx spec covers touch-keyboard traits, so an engineering owner needs to provide that direction by approving or rejecting enterkeyhint="search" and autocorrect="off" as fixed behavior of the Typeahead, Tokenizer and PowerSearch input, the Selector and MultiSelector search row, and CommandPaletteInput, or by approving only the Search key and splitting autocorrection out. Any engineering owner, including you as the author, records that decision by commenting /approve-spec <full head SHA> on this pull request (for the current head, /approve-spec 54f182bf2d2e748e1f89626520f4f5bad4412645). Two changes are needed whichever way that goes:
- Retag the changeset
[feat]and keep thepatchbump, since AST-017 FR7 keeps[fix]for corrections and no current contract is being restored. - Drop the three new Enter tests in
Typeahead.test.tsx,Selector.test.tsxandCommandPaletteInput.test.tsx, which repeat existing Enter assertions (the IME-guard tests and the CommandPalette Enter test) that component-test-sufficiency INV11 asks you to cite instead.
The red pr-a11y check runs a lab spec that exists only on main, so a rebase should clear it.
[Automated review]
| }); | ||
|
|
||
| describe('Typeahead', () => { | ||
| it('keeps Enter selecting the highlighted result: the Search key is only its label', async () => { |
There was a problem hiding this comment.
This repeats the last step of the IME-guard test at lines 361-365 (same BaseTypeahead render, App query, Enter and onChange assertion), and its enterkeyhint check is already made by the next test; without that line it passes on main. component-test-sufficiency INV11 asks to cite the existing test rather than add a second one with equivalent setup and assertions.
There was a problem hiding this comment.
Dropped in 9976783. The PR body now cites the existing Enter coverage (Typeahead's and Selector's IME-guard tests, CommandPalette's Enter test).
| expect(screen.getByRole('combobox', h)).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('keeps Enter selecting the highlighted option in the search row: the Search key is only its label', async () => { |
There was a problem hiding this comment.
Same setup and assertion as the end of the IME test at lines 1670-1672 (render, ban, ArrowDown, Enter, onChange('Banana')), and the enterkeyhint check duplicates the next test; without that line it passes on main. Per component-test-sufficiency INV11, cite the existing test instead.
There was a problem hiding this comment.
Dropped in 9976783; the body cites Selector's IME-guard test for Enter.
| expect(input).not.toHaveAttribute('aria-autocomplete'); | ||
| }); | ||
|
|
||
| it('keeps routing Enter to the palette: the Search key is only its label', () => { |
There was a problem hiding this comment.
handleKeyDown is unchanged here, and CommandPalette.test.tsx:508-510 already proves that Enter in the palette input selects the highlighted command; the enterkeyhint check duplicates the next test, and without it this passes on main. Per component-test-sufficiency INV11, cite that evidence instead.
There was a problem hiding this comment.
Dropped in 9976783; the body cites CommandPalette's Enter test.
54f182b to
9976783
Compare
There was a problem hiding this comment.
Approval waits on an engineering-owner decision: no current Astryx spec covers touch-keyboard traits, so an engineering owner needs to provide that direction by approving enterkeyhint="search" and autocorrect="off" as fixed behavior of the Typeahead, Tokenizer and PowerSearch input, the Selector and MultiSelector search row and CommandPaletteInput, by approving only the Search key and splitting autocorrection out, or by rejecting both. Any engineering owner, including you as the author, records that decision by commenting /approve-spec 9976783f70c3feada0e502c4c954c0aab8827057 on this pull request; a new commit needs a fresh command. If both attributes are approved nothing else needs to change, and the earlier changeset and test requests are resolved.
[Automated review]
9976783 to
010865c
Compare
|
/approve-spec 010865c |
There was a problem hiding this comment.
Changes requested: the Search key and autocorrection-off match the current input-fields and CommandPaletteInput specs, and the new render and touch tests prove them, but the three inputs hand-write the attributes instead of using the shared touch-keyboard helper. Please replace enterKeyHint="search" and autoCorrect="off" in BaseTypeahead.tsx, PanelSearchInput.tsx and CommandPaletteInput.tsx with {...textEntryTraitAttributes({enterKeyHint: 'search', hasAutoCorrect: false})}, the helper's own documented example, and add those files to its SYNC: list, so a later change to how traits render reaches these fields too. A new commit will need a fresh /approve-spec for the record edits.
[Automated review]
| enterKeyHint="search" | ||
| autoCorrect="off" |
There was a problem hiding this comment.
textEntryTraitAttributes in Field/textEntryTraits.ts already maps these traits. Its header calls it the one place that says how a field tells a touch keyboard what it holds, and its @example is this exact call:
{...textEntryTraitAttributes({enterKeyHint: 'search', hasAutoCorrect: false})}Please use it here and add this file to the helper's SYNC: list. Non-blocking: the comment above can keep only the reason and the Enter note ("Autocorrect would rewrite names and identifiers. The key is only a label: Enter still commits the highlighted option.").
There was a problem hiding this comment.
Fixed in 08a734c: the input spreads textEntryTraitAttributes({enterKeyHint: 'search', hasAutoCorrect: false}), and the helper's SYNC: list names it.
| enterKeyHint="search" | ||
| autoCorrect="off" |
There was a problem hiding this comment.
Same as in BaseTypeahead.tsx: {...textEntryTraitAttributes({enterKeyHint: 'search', hasAutoCorrect: false})} keeps the search row on the shared trait path.
There was a problem hiding this comment.
Fixed in 08a734c: the input spreads textEntryTraitAttributes({enterKeyHint: 'search', hasAutoCorrect: false}), and the helper's SYNC: list names it.
| enterKeyHint="search" | ||
| autoCorrect="off" |
There was a problem hiding this comment.
Same as in BaseTypeahead.tsx: {...textEntryTraitAttributes({enterKeyHint: 'search', hasAutoCorrect: false})} keeps the palette's query field on the shared trait path.
There was a problem hiding this comment.
Fixed in 08a734c: the input spreads textEntryTraitAttributes({enterKeyHint: 'search', hasAutoCorrect: false}), and the helper's SYNC: list names it.
… no autocorrection The search inputs of Typeahead, Tokenizer (and so PowerSearch), CommandPaletteInput and the Selector and MultiSelector search row now carry enterkeyhint="search" and autocorrect="off", as family:input-fields FR12 and component:CommandPaletteInput FR6 state (family:input-fields DEC-10). A phone keyboard then shows a Search key instead of Return and leaves names and identifiers as typed. These are member-owned defaults with no caller prop. The key is only a label: Enter keeps each member's effect. Each input spreads the shared textEntryTraitAttributes helper, as TextInput and TextArea do, and the helper's SYNC list names the three inputs. Each member's render test checks both attributes and that Enter keeps its effect; written first, all six failed on main. A Chromium interaction spec on a touch-emulated phone checks that the input a tap focuses carries both. The two records drop their FR12 and FR6 implementation gaps, and their verification rows and verified_by lists name these tests.
010865c to
08a734c
Compare
|
At 08a734c, all three search inputs (BaseTypeahead, PanelSearchInput, CommandPaletteInput) spread the shared |
|
/approve-spec 08a734c |
There was a problem hiding this comment.
This looks ready to approve.
The Typeahead, Tokenizer and PowerSearch field, the Selector and MultiSelector search row, and CommandPaletteInput now carry enterkeyhint="search" and autocorrect="off" through the shared textEntryTraitAttributes helper, as family:input-fields FR12 and component:CommandPaletteInput FR6 require, which also addresses the earlier request to use that helper. The new render tests fail without the attributes and pass with them, a touch-emulated check finds both on every focused search input, and an engineering owner approved the record updates at this head. No changes are needed.
[Automated review]
User need
On a phone, Astryx's search inputs open a keyboard that ends in Return and autocorrects, so a name or an identifier is "corrected" into another word. An iOS search bar's keyboard shows a Search key and leaves the query as typed.
Evidence
iOS 26.2 simulator, a tap on each story; left: main, right: this branch.
(device capture removed: it showed browser chrome)
(device capture removed: it showed browser chrome)
(device capture removed: it showed browser chrome)
Android emulator, Chrome with Gboard: the Search key, and "teh quikc " stays as typed, where main corrects it.
(device capture removed: it showed browser chrome)
The captures are from this branch's earlier version.
Problem and solution fit
The inputs were plain text fields with neither attribute, so a phone gave them a text field's Return key and autocorrection. Each search input now carries
enterkeyhint="search"andautocorrect="off". The key is only a label: Enter keeps each member's effect, and desktop browsers ignore both.Current specification
family:input-fieldsFR12 and DEC-10: the search inputs of Typeahead, Tokenizer, and the Selector and MultiSelector search row carry both attributes, as member-owned defaults with no caller prop.component:CommandPaletteInputFR6: the query field carries both, standalone and in a palette, and Enter keeps FR2's routing.[feat]underspec:AST-017FR5 and FR7./approve-specon this head.Public delta and caller burden
textEntryTraitAttributeshelper: BaseTypeahead's (Typeahead, Tokenizer and so PowerSearch), PanelSearchInput's (the Selector and MultiSelector search row) and CommandPaletteInput's.Design and alternatives
enablesReturnKeyAutomatically, so that stays out.Scope
Testing
Local gates at 08a734c, on main 271bd70, with node 24.22.1 from
.nvmrc: the build, Storybook, typecheck, strict ESLint (0 errors), Changeset coverage, export sync, i18n, CLI API types, Lab readiness, knowledge records and docsite data and tests pass. 732 UI test files (18,269 tests) pass. The node project passes except one CLIdoctorintegration file that timed out at 30 s on a loaded machine; run alone it passes 40/40, and this change touches no CLI code. The interaction spec passes 6/6 in Chromium and in WebKit's CI profile. The gates ran at 06f28e49bd; this head changes only a file-header comment since, and strict ESLint, Prettier and the knowledge check ran again at it.Records and clauses checked:
family:input-fieldsFR12 and DEC-10;component:CommandPaletteInputFR2 and FR6;component:TextInputFR16 (no keyboard props on these members);spec:AST-017FR5 and FR7;architecture:public-component-apiINV4;architecture:knowledge-contractsINV29.Writing rubric results
family:input-fields:component:CommandPaletteInput: