Skip to content

spec(TextInput, TextArea, search, ChatComposer): touch keyboard props and return-key defaults - #9424

Merged
cixzhang merged 1 commit into
mainfrom
spec/touch-keyboard-props
Nov 2, 2026
Merged

cixzhang merged 1 commit into
mainfrom
spec/touch-keyboard-props

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Maintainer impact

People typing into Astryx text fields on a phone get the keyboard each field needs. Callers can ask TextInput and TextArea for a phone pad, a number pad, or a URL keyboard, a Return key that says Next, Go, or Done, and no capitalization or correction for names and codes. Search fields show a Search key and stop autocorrecting queries. The chat composer's Return key says Send, because Enter sends. Desktop browsers ignore all of this, and what Enter does is unchanged everywhere (TextInput FR10, ChatComposerInput FR2). Every prop is optional and renders nothing when unset.

Nothing is built yet: every new rule carries an implementation gap and an evidence-gap verification row. This unblocks #8157, #8166, and #8167, with these required changes:

Exact decision needed

May callers set the touch keyboard on text fields, and do search fields and the chat composer label their own Return key?

Existing authority searched

architecture:public-component-api (INV2 naming, INV3 one concept per prop and closed unions, INV4 derive what you can, INV5 and INV25 admission), spec:AST-002 DEC-1, spec:AST-082 FR3 and DEC-14, spec:AST-017 FR3, FR5, FR7, and FR59, family:input-fields, and the TextInput, Swift TextInput, TextArea, ChatComposerInput, CommandPaletteInput, and NumberInput records. BaseProps.ts leaves enterKeyHint, inputMode, autoCapitalize, autoCorrect, and spellCheck out on purpose, so INV5 does not admit them, and no current record decided them. TextInput listed keyboard hints as uncontracted.

Decision

The owner chose keyboard A and return A on 2026-11-01. About enterKeyHint, the owner added: "make sure it's a set enum then".

  • keyboard A. On the web, TextInput, TextArea, and ChatComposerInput accept enterKeyHint (EnterKeyHint: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'). TextInput and TextArea also accept inputMode (InputMode: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'), autoCapitalize (AutoCapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'), and hasAutoCorrect. TextInput also accepts hasSpellCheck, and its type accepts search, tel, and url. The three value types are closed unions exported from the package entry, with no string widening (INV3). The names follow INV2: native names stay, and on/off natives become has…, as TextArea hasSpellCheck already is. Each API row is decided in TextInput's Public concepts table, FR16, and DEC-1, TextArea FR13, and ChatComposerInput FR17 (INV25). For Swift, spec:AST-082 FR3 and DEC-14 apply: the Swift TextInput contract carries a keyboard prop or type value only where its field applies it. Today the field applies none of them, which is recorded as an implementation gap (Swift TextInput FR6).
  • return A. The search inputs of Typeahead, Tokenizer, the Selector and MultiSelector search row, and CommandPaletteInput carry enterkeyhint="search" and autocorrect="off" (family FR12 and DEC-10, CommandPaletteInput FR6). ChatComposerInput defaults to enterKeyHint="send", and its prop overrides that default (FR17, DEC-2). The search members have no caller prop for these hints: keyboard A admits the props only on TextInput, TextArea, and ChatComposerInput. These are keyboard hints only, so Enter's behavior is unchanged (TextInput FR10, ChatComposerInput FR2).
  • Release class. Every change here is a patch [feat].
    • The added optional props and wider type are additive (spec:AST-017 FR5, FR7).
    • The new search and composer defaults are also patch [feat]. The browser's default key label and autocorrection were undocumented, so they were never a released contract (FR3). No caller has to change source to keep working (FR1), and the change intentionally sets new keyboard direction rather than restoring an existing contract (FR7).
    • The composer's Changeset names enterKeyHint="enter" as the way to keep the plain Return key.
    • Fine-pointer behavior is unchanged (FR59).

Rejected alternatives

  • keyboard B: keep the shared base props closed, so fields stay on the letters keyboard and callers cannot change it.
  • return B: keep the browser default, with a Return key and autocorrect everywhere.

Claim scope and non-goals

The new claims are the touch-keyboard props and their value types, TextInput's three added types and the searchbox role (AR6), the search-input and composer defaults, and Swift's omission. Nothing else changes: Enter handling, the rest of each component's API, the other family members, and visual design.

Evidence and implementation relationship

This PR is spec-only. #8166 implements keyboard A for TextInput and TextArea, #8167 implements the composer prop and its Send default, and #8157 implements the search defaults. Each needs the changes listed under Maintainer impact.

Changed records

  • docs/specs/components/TextInput/TextInput.spec.md (contract table, compatibility, ownership, public concepts, FR16, AR6, verification, current-state impact, DEC-1)
  • docs/specs/components/TextInput/TextInput.swift.spec.md (FR6, verification, contract table)
  • docs/specs/components/TextArea/TextArea.spec.md (contract table, compatibility, ownership, public concepts, FR13, verification, current-state impact)
  • docs/specs/components/Chat/ChatComposerInput.spec.md (contract table, compatibility, ownership, public concepts, FR17, verification, DEC-2)
  • docs/families/input-fields.md (FR12, implementation gaps, verification, DEC-10)
  • docs/specs/components/CommandPalette/CommandPaletteInput.spec.md (contract table, compatibility, FR6, verification)

Writing rubric results

  • R1 narration: none added. Every new rule is in the present tense; unbuilt parts are "Implementation gap" and "Evidence gap until built" statements about the system. "Before" and "now" were kept out of FR13 and FR17.
  • R2 research in the record: none. The keyboard demonstrations stay in the decision explainer, outside the repository.
  • R3 evidence naming a change: none. Basis cells cite records and current source; the new verification rows name the tests still to be written.
  • R4 rejected alternatives over one line or outside a decision: none added. TextInput DEC-1, ChatComposerInput DEC-2, and family DEC-10 carry no Rejected: line, because neither option the owner declined is likely to come back.
  • R5 pull request or issue references remaining: none in the records. Pull requests appear only in this description.
  • R6 ruled open questions still listing options: none. CommandPaletteInput OQ1 is unanswered and unchanged.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal Meta context.

Validation

  • pnpm install --frozen-lockfile: ok
  • pnpm check:knowledge: "Knowledge templates and records are aligned."
  • Prettier (also run by the pre-commit hook): ok
  • git diff --check: ok

@vercel

vercel Bot commented Nov 2, 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 1:49am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Nov 2, 2026, 1:41 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label 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 Author

/approve-spec 59c50a3

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 2, 2026
@cixzhang
cixzhang merged commit e64b41b into main Nov 2, 2026
51 of 52 checks passed
@github-actions
github-actions Bot deleted the spec/touch-keyboard-props branch November 2, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 59c50a31 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

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.

1 participant