Repository navigation
feat(ChatComposerInput): the touch keyboard's Return key says Send - #8167
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.
No defects turned up: the implementation, tests and docs agree, and Enter still submits as component:ChatComposerInput FR2 requires. Approval waits on one owner decision, because no current spec admits the new public enterKeyHint prop or its 'send' default, which changes the Return key of every existing composer on touch keyboards. An engineering owner needs to settle whether ChatComposerInput admits enterKeyHint with default 'send', knowing that composers whose Enter inserts a line break on touch would then pass enterKeyHint="enter", and records that decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner, and the ruling then goes into the component's spec record.
[Automated review]
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
c6007a0 to
eb8cab6
Compare
There was a problem hiding this comment.
This looks ready to approve: the composer's send default and enterKeyHint prop, and the TextInput and TextArea keyboard-trait props carried from #8166, match the current component specs, and the new tests cover the attributes, the types and unchanged Enter handling. The three spec record edits only remove implementation gaps, but the repository's spec gate still needs an engineering owner to comment /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner). After that, land #8166 first or together with this branch.
[Automated review]
component:ChatComposerInput FR17 and DEC-2. Enter sends the draft, so the editor now sets enterkeyhint="send" and iOS shows its Send key instead of a plain Return; ChatComposer's default input carries the same default. A new enterKeyHint prop takes another label, such as `enter` for a composer whose onKeyDown makes Enter insert a line break on a touch screen. The hint only labels the key: Enter submits under every label. enterKeyHint takes the closed union EnterKeyHint the package entry exports (component:TextInput FR16), so TypeScript rejects any other value; a public type test pins it. The record's implementation and evidence gaps for FR17 are closed, and a Chromium spec checks, on a phone viewport with touch emulation, the label on the editor a tap focuses. Core's API report gains this prop and the text fields' keyboard props and unions, which merged without their report rows. Rows that other changes left stale are not touched here.
eb8cab6 to
bb50383
Compare
|
/approve-spec bb50383 |
There was a problem hiding this comment.
This looks ready to approve: the editor's send default and the new enterKeyHint prop match the current ChatComposerInput spec (FR17), and the API report rows added for the TextInput and TextArea keyboard props match their current specs. The new render tests, the public type test and the Chromium Return-key spec fail against the base and pass on this branch, and Enter still submits under every label.
[Automated review]
User need
ChatComposerInput sends on Return, on every keyboard (
component:ChatComposerInputFR2), but a phone's keyboard shows a plain Return key, so a person expecting a line break sends a half-written message. UIKit'sreturnKeyType = .sendlabels the key; Mobile Safari applies it fromenterkeyhint="send".Problem and solution fit
enterkeyhint="send": the touch keyboard shows its Send key (a blue up arrow on iOS 26). ChatComposer's default input carries the same default.enterKeyHintprop relabels it for a composer whoseonKeyDownmakes Enter a line break on touch; the Enter behavior story passesenter.Current specification
component:ChatComposerInputFR17 and DEC-2, recorded in #9424, withenterKeyHinttyped byEnterKeyHint(component:TextInputFR16). FR2 is unchanged. This pull request closes FR17's implementation and evidence gaps. The record edit is owner-gated: it needs an engineering owner's/approve-specat this exact head.Each API report row this pull request adds is decided by a current record (
architecture:public-component-apiINV25): this prop bycomponent:ChatComposerInputFR17, and the text fields' props,typevalues and unions bycomponent:TextInputFR16 and AR6 andcomponent:TextAreaFR13.Public delta and caller burden
enterKeyHint?: EnterKeyHint, default'send': optional and additive, a patch[feat].EnterKeyHintis the closed union the package entry exports for the text fields, so TypeScript rejects any other value.enterKeyHint="enter". No theming or accessibility change (enterkeyhintis not announced).typevalues and exported unions, which feat(TextInput,TextArea): tell a touch keyboard what the field holds #8166 merged without. Rows that other changes left stale (two input status styles' forced-colors value, the input wrapper and display styles, a CSS variable, and a CLI template field) are not touched here.Design and alternatives
DEC-2: Enter sends, so the editor labels the key Send itself, as a component decides what it can derive. No default would keep a label that contradicts what Enter does, and the label can't be derived from
onKeyDown: what a handler does with Enter is unknown until it runs.Evidence
iOS 26.2 simulator, the composer inside ChatLayout with #8176 (which keeps it above the keyboard), home-screen web app (keyboard in frame): the Send key, then Done.
Mobile Safari, the composer's own stories: before (Return), after (Send), and the Enter behavior story (Return).
Android, Chrome 124 with Gboard (emulator): the same three, then a message typed with Gboard and sent with its Send key.
ChatComposerReturnKey.a11y.chromium.spec.tstaps the editor of the Simplest story (Send) and of the Enter behavior story (Return,enter): 20 of 20 runs alone, and 20 of 20 at 4 workers on two pinned cores.sendby default, the value passed,sendinside ChatComposer's default input, and Enter submitting under each of the seven labels.ChatComposerInput.public.test.ts, run bypnpm typecheck):enterKeyHintisEnterKeyHint, and an arbitrary or unnarrowed string is rejected. Widening the prop's type withstringmakes it report 4 errors.ChatComposerInput.tsx: the three label tests fail (the default label, the default label inside ChatComposer, and a passed label), and the file's other 104 tests pass, the Enter cases included, since they guard FR2. Against a Storybook built from main's source and stories, the Chromium spec fails both cases:enterkeyhintreads null wheresendandenterare expected.Scope
Writing rubric results
Testing
ASTRYX_STRICT_LINT=1 pnpm lint), Prettier, the knowledge checks, the Chat suites (436 tests) and the CLI documentation suites (2,595) pass. At 6a257e0503, whose code differs from this head only in comments and the record'sverified_bylist, the build, the whole typecheck and the API report ran:pnpm api:reportthere differs from the committed reports only by rows that other changes left stale, five in core's report and one CLI field. The comment-provenance baseline check fails on main at this base too, on four entries in files this pull request does not touch.Notes
ChatComposerInput.tsxmeets refactor(Chat): internal-authoritative composer input state #4074 in its props destructuring. Whichever merges second rebases.