Skip to content

feat(core): search fields ask a touch keyboard for its Search key and no autocorrection - #8157

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c09-search-key
Nov 2, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c09-search-key

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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" and autocorrect="off". The key is only a label: Enter keeps each member's effect, and desktop browsers ignore both.

Current specification

  • family:input-fields FR12 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:CommandPaletteInput FR6: the query field carries both, standalone and in a palette, and Enter keeps FR2's routing.
  • A patch [feat] under spec:AST-017 FR5 and FR7.
  • Both records drop their FR12 and FR6 gaps and name the new tests. The record edits need an engineering owner's /approve-spec on this head.

Public delta and caller burden

  • Two native attributes on three inputs, through the shared textEntryTraitAttributes helper: BaseTypeahead's (Typeahead, Tokenizer and so PowerSearch), PanelSearchInput's (the Selector and MultiSelector search row) and CommandPaletteInput's.
  • No prop, type, style or layout change.

Design and alternatives

  • A caller prop on each member was rejected: the member knows that Enter searches, so it labels the key itself (DEC-10).
  • The web has no counterpart to UIKit's enablesReturnKeyAutomatically, so that stays out.

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

  • Render tests, one per member: Typeahead, Tokenizer, BaseTypeahead, the Selector and MultiSelector search rows, and CommandPaletteInput standalone and in a palette. Each checks both attributes. Each also checks that Enter keeps its effect: it picks or adds the highlighted result, selects or toggles the highlighted option, or routes to the palette. Written first, all six attribute checks failed on main.
  • Interaction spec on a touch-emulated phone: in Chromium and in WebKit's CI profile, a tap focuses each member's search input, which then carries both attributes.

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 CLI doctor integration 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-fields FR12 and DEC-10; component:CommandPaletteInput FR2 and FR6; component:TextInput FR16 (no keyboard props on these members); spec:AST-017 FR5 and FR7; architecture:public-component-api INV4; architecture:knowledge-contracts INV29.

Writing rubric results

family:input-fields:

  • R1 narration: none in FR12, DEC-10 or the FR12 verification row.
  • R2 research: none.
  • R3 evidence: the FR12 row names the tests and the spec.
  • R4 rejected alternatives: none added.
  • R5 change references: four, in older gap notes outside this change; left.
  • R6 open questions: none.

component:CommandPaletteInput:

  • R1 narration: none.
  • R2 research: none.
  • R3 evidence: the FR6 row names the tests and the spec.
  • R4 rejected alternatives: one, one sentence; untouched.
  • R5 change references: none.
  • R6 open questions: OQ1 is unanswered and keeps its options.

@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 2, 2026 10:39pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 2, 2026, 10:47 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

Comment thread .changeset/search-fields-search-key.md Outdated
'@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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retagged [feat] in 9976783; the patch bump stays.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 08a734c

Storybook · Sandbox · built from this PR's head

Modified components

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

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the patch bump, 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.tsx and CommandPaletteInput.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 () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped in 9976783; the body cites CommandPalette's Enter test.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@vjeux
vjeux marked this pull request as draft October 29, 2026 22:32
@vjeux
vjeux force-pushed the uikit/c09-search-key branch from 9976783 to 010865c Compare November 2, 2026 20:47
@vjeux vjeux changed the title fix(core): search fields set up the touch keyboard like an iOS search bar feat(core): search fields ask a touch keyboard for its Search key and no autocorrection Nov 2, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 2, 2026
@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 010865c

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 2, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

Comment on lines +1729 to +1730
enterKeyHint="search"
autoCorrect="off"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.").

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 08a734c: the input spreads textEntryTraitAttributes({enterKeyHint: 'search', hasAutoCorrect: false}), and the helper's SYNC: list names it.

Comment on lines +278 to +279
enterKeyHint="search"
autoCorrect="off"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in BaseTypeahead.tsx: {...textEntryTraitAttributes({enterKeyHint: 'search', hasAutoCorrect: false})} keeps the search row on the shared trait path.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 08a734c: the input spreads textEntryTraitAttributes({enterKeyHint: 'search', hasAutoCorrect: false}), and the helper's SYNC: list names it.

Comment on lines +325 to +326
enterKeyHint="search"
autoCorrect="off"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in BaseTypeahead.tsx: {...textEntryTraitAttributes({enterKeyHint: 'search', hasAutoCorrect: false})} keeps the palette's query field on the shared trait path.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 2, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 2, 2026 21:47
@vjeux
vjeux force-pushed the uikit/c09-search-key branch from 010865c to 08a734c Compare November 2, 2026 22:27
@vjeux

vjeux commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

At 08a734c, all three search inputs (BaseTypeahead, PanelSearchInput, CommandPaletteInput) spread the shared textEntryTraitAttributes helper instead of writing the attributes by hand. The helper's SYNC: list now names them. The rendered attributes are unchanged, and the six render tests and the touch-emulated spec still pass. The records are unchanged since the last approval, but the new head needs a fresh /approve-spec.

@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 08a734c

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

@cixzhang
cixzhang merged commit d0b6e0f into meta:main Nov 2, 2026
70 checks passed
@vjeux
vjeux deleted the uikit/c09-search-key branch November 2, 2026 22:57

This branch was successfully deployed

1 active deployment
Preview — 08a734cb Deployed Nov 2, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants