Skip to content

fix(core): ChatComposer keeps its send action inside the composer on a narrow screen - #12158

Closed
josephfarina wants to merge 2 commits into
mainfrom
josephfarina/chat-composer-narrow-footer
Closed

josephfarina wants to merge 2 commits into
mainfrom
josephfarina/chat-composer-narrow-footer

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

User impact

On a narrow screen, a ChatComposer whose footer actions are wider than the footer pushed its send button past the composer's edge, so the main action sat partly outside the composer and the content area scrolled sideways. At 320 px the AI chat landing page template's send button ended 63 px past the composer.

Now the footer actions wrap onto more lines inside the footer, and the send action stays at the end of the footer, inside the composer. A single action too wide for a line of its own is shortened with an ellipsis. When everything fits on one line, nothing changes.

Width Before After
320 px Send button past the composer's edge; the page content scrolled sideways Footer actions take two lines; send stays inside
390 px Send button pushed into the composer's padding Footer actions take two lines; send sits at its normal inset
1280 px One line Unchanged

Problem and solution fit

The footer is a row of two groups: the caller's actions and the send area. The caller's group was a nowrap row that could not shrink below its content. With labeled actions it simply ran on, and the send area went with it. The fix lets the caller's group shrink (min-width: 0) and wrap its own items, and keeps the send area from shrinking. Everything stays inside the one footer row the component's record describes ("places caller actions and the primary action on the final body row"), and it meets the record's narrow-viewport requirement of no horizontal overflow.

No API change and no new props.

Tests

  • New story: Readiness / footer actions on narrow viewport (three labeled footer actions at a mobile viewport).
  • New browser spec: ChatComposerNarrowFooter.a11y.chromium.spec.ts. At 320 px it checks that the composer and page don't scroll sideways, that the send action ends inside the composer, and that no footer action's label is cut. It fails on main (the composer overflows by 156 px) and passes with this change.
  • The other ChatComposer browser specs (7) and the Chat unit tests (499) pass.

Evidence

  • Every existing ChatComposer story renders pixel-identically before and after at 320 and 1280 px. Only the new story differs, at 320 px.
  • The AI chat landing page template: fixed at 320 and 390 px, identical at 1280 px. The AI chat page template, which has one footer action, is identical at every width.
  • astryx build on a build replay set: no start, alternative or block suggestion changes.
  • No doc text changes.

Scope

Components: core (ChatComposer)

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • prettier and eslint: clean.
  • pnpm test:a11y-contract on the new spec against Storybook builds of main and of this change: fails, then passes.
  • vitest run packages/core/src/Chat: pass.

@vercel

vercel Bot commented Nov 16, 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 16, 2026 9:12pm UTC

Request Review

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

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 16, 2026, 9:36 PM UTC

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · fec1bc3

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
ChatComposer 84.7 kB (+17 B) · 12.9 kB CSS (+10 B) — ✓ · ✓ · —
lab/CommentComposer 174.1 kB (+19 B) · 1.9 kB CSS (0) — — · — · —
lab/Comments 370.4 kB (+19 B) · 2.5 kB CSS (0) — — · — · —
17 more components
Component Size LoC Visual · A11y · RTL
lab/CommentThread 363.6 kB (+16 B) · 2.4 kB CSS (0) — — · — · —
ChatComposerDrawer 18.2 kB (0) · 4.7 kB CSS (0) — ✓ · ✓ · —
ChatComposerInput 82.3 kB (0) · 12.1 kB CSS (0) — ✓ · ✓ · —
ChatComposerTokenElement 82.3 kB (0) · 12.1 kB CSS (0) — ✓ · ✓ · —
ChatDictationButton 65.6 kB (0) · 10.9 kB CSS (0) — ✓ · ✓ · —
ChatLayout 88.3 kB (0) · 11.4 kB CSS (0) — ✓ · ✓ · —
ChatLayoutScrollButton 65.6 kB (0) · 11.0 kB CSS (0) — ✓ · ✓ · —
ChatMessage 17.2 kB (0) · 3.7 kB CSS (0) — ✓ · ✓ · ✓
ChatMessageBubble 7.6 kB (0) · 3.7 kB CSS (0) — ✓ · ✓ · ✓
ChatMessageList 27.4 kB (0) · 7.1 kB CSS (0) — ✓ · ✓ · —
ChatMessageMetadata 20.4 kB (0) · 4.1 kB CSS (0) — ✓ · ✓ · —
ChatSendButton 65.5 kB (0) · 10.8 kB CSS (0) — ✓ · ✓ · —
ChatSystemMessage 7.1 kB (0) · 3.8 kB CSS (0) — ✓ · ✓ · —
ChatTokenizedText 7.6 kB (0) · 4.0 kB CSS (0) — ✓ · ✓ · —
ChatToolCalls 31.6 kB (0) · 8.5 kB CSS (0) — ✓ · ✓ · —
chat — — — · ✓ · —
Chat — — ✓ · ✓ · —

Package size: @astryxdesign/core 7.62 MB packed (+138 B); no new dependencies.

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


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.

Changes requested: the footer fix works, and one release-note claim needs narrowing before it lands.

  • The changeset says no footer label is cut, but a single footer action wider than the room beside the send area is shortened with an ellipsis (at 320 px, "Research mode with web sources" next to a labeled send action shows "Research …"), so reword the changeset, and the matching code comment, to say that.

The wrap keeps the send button inside the composer at 320 and 390 px, mirrors correctly in right-to-left, and leaves footers that already fit unchanged, so the code itself can stay as it is.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the send action stays inside the composer on a narrow screen — verified (at 320 px it sits 12 px inside the composer's end; ChatComposer.tsx:230-243).
  • Claim: footer actions wider than the footer wrap onto another line instead of pushing the send button out — verified (two or three lines at 320 and 390 px).
  • Claim: no label is cut — false (one action wider than the room beside the send area is truncated).
  • Claim: wide composers look the same — verified (identical at 1280 px, and for footers that already fit at 320 px).
  • Claim: at 320 px the AI chat landing template's send button ended past the composer — verified (the exact distance depends on the page width).
  • Claim: at 390 px the landing template's send button lost its normal inset — verified; it now sits at the normal inset with the actions on two lines.
  • Claim: the caller group could not shrink, and the fix lets it shrink and wrap while the send area keeps its width — verified (ChatComposer.tsx:232, :235, :242).
  • Claim: everything stays on the footer row the component record describes and meets its narrow-viewport requirement — verified.
  • Claim: no API change and no new props — verified (no public surface row changes in any published package).
  • Claim: a new story and a browser spec check overflow, the send position and whole labels at 320 px — verified (spec lines 35-65).
  • Claim: the spec fails on main (156 px overflow) and passes with the change — verified by measuring the same geometry on both revisions.
  • Claim: the other ChatComposer browser specs and the Chat unit tests pass — partly verified (ChatComposer and ChatSendButton unit tests pass; the browser specs did not run because CI has not run on this head).
  • Claim: existing ChatComposer stories render identically at 320 and 1280 px — verified for Full Featured, With Footer Actions, Flat and the disabled-streaming story.
  • Claim: the landing template is fixed at 320 and 390 px and identical at 1280 px — verified.
  • Claim: the AI chat page template is identical at every width — verified at 320, 390 and 1280 px.
  • Claim: build suggestions and docs text are unchanged — verified (no doc, template or metadata file changes).
  • Claim: prettier and eslint are clean — verified (the lint check passed).
  • File .changeset/chat-composer-narrow-footer.md: finding (the "no label is cut" claim).
  • File apps/storybook/stories/ChatComposer.stories.tsx: clear.
  • File packages/core/src/Chat/ChatComposer.tsx: clear (one non-blocking comment-style suggestion).
  • File packages/core/src/Chat/__tests__/ChatComposerNarrowFooter.a11y.chromium.spec.ts: clear.

Automated review (maintainer link)

Comment thread packages/core/src/Chat/ChatComposer.tsx Resolved

@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.

Approved pending CI: CI has not run on this head yet, because the run was refused for capacity ("CI is full"), so its jobs need a re-run before merge.

The changeset and the code comment now describe what happens to an action too wide for its line, which was the one change the last review asked for. The wrap keeps the send button inside the composer at 320 and 390 px, mirrors in right-to-left, and leaves footers that already fit unchanged.

  • Miss (non-blocking): the send area keeps its full width for sendActions too, so a wide labeled control there (a 119 px "Choose model" button at 320 px) leaves the caller's footer actions as blank 24 px buttons; every shipped example uses icon-only sendActions, so addressing this is optional.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: the send action stays inside the composer on a narrow screen — verified (12 px inside its end at 320 px; ChatComposer.tsx:228-241).
  • Claim: footer actions wider than the footer wrap onto more lines inside the composer instead of pushing the send button past its edge — verified (three lines at 320 px, two at 390 px).
  • Claim: an action too wide for a line of its own is shortened with an ellipsis — verified, where the line is the room beside the send area; a wide labeled sendActions control can shrink that room to an icon's width (the non-blocking note above).
  • Claim: wide composers look the same as before — verified (identical at 1280 px).
  • Claim: on main, wide footer actions pushed the send button past the composer's edge and the content scrolled sideways — verified (156 px past with the new story's code; the landing template's content area scrolls 58 px sideways at 320 px).
  • Claim: at 320 px the landing template's send button ended 63 px past the composer — verified in substance (it ends past the composer; this review measures 82 px in a Storybook render, so the distance depends on the host page).
  • Claim: at 390 px the landing template's send button was pushed into the composer's padding and now sits at its normal inset with the actions on two lines — verified for the change; the before state measured 12 px past the edge here, again host-dependent.
  • Claim: the caller group could not shrink, and the fix lets it shrink and wrap while the send area keeps its width — verified (ChatComposer.tsx:230, :233, :240).
  • Claim: everything stays on the one footer row the component record describes and meets its narrow-viewport requirement — verified.
  • Claim: no API change and no new props — verified (no public surface row changes in any published package).
  • Claim: a new story and a browser spec check overflow, the send position and whole labels at 320 px — verified (story lines 513-539, spec lines 32-66).
  • Claim: the spec fails on main by 156 px and passes with the change — verified (it passes against the Storybook CI built for this head; the same story code overflows by 156 px on main).
  • Claim: the other ChatComposer browser specs and the Chat unit tests pass — verified (all 7 ChatComposer browser tests, the new one included; 499 Chat unit tests).
  • Claim: every existing ChatComposer story renders identically at 320 and 1280 px — verified (all 20 stories at both widths).
  • Claim: the landing template is fixed at 320 and 390 px and identical at 1280 px — verified.
  • Claim: the AI chat page template is identical at every width — verified at 320, 390 and 1280 px.
  • Claim: build suggestions and doc text are unchanged — verified (no doc, template or metadata file changes).
  • Claim: prettier and eslint are clean — verified (the lint check passed).
  • File .changeset/chat-composer-narrow-footer.md: clear.
  • File apps/storybook/stories/ChatComposer.stories.tsx: clear.
  • File packages/core/src/Chat/ChatComposer.tsx: one non-blocking note (wide sendActions).
  • File packages/core/src/Chat/__tests__/ChatComposerNarrowFooter.a11y.chromium.spec.ts: clear.

Automated review (maintainer link)

display: 'flex',
alignItems: 'center',
gap: spacingVars['--spacing-1'],
flexShrink: 0,

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.

Miss (non-blocking), from the earlier review: flexShrink: 0 here keeps all of sendActions at full width, not only the send button. With a labeled control there, such as a 119 px "Choose model" button at 320 px, footerLeft falls to 24 px and every caller action renders as a blank button that is still focusable and clickable. No shipped template, block or story puts a labeled control in sendActions, so this is optional: keep flexShrink: 0 on the send button alone so sendActions can give up width too, or say in the slot's docs that it takes icon-only controls.

@josephfarina josephfarina reopened this Nov 17, 2026
@josephfarina josephfarina reopened this Nov 18, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12694 fix(cli): the Order Detail template's discount uses a minus sign held to its amount
  Author: @josephfarina
- #12114 fix(templates): reset, reply, send and go-into icons mirror in right-to-left pages
  Author: @josephfarina
- #12143 refactor(templates): example blocks lay out with HStack and VStack instead of flex wrappers
  Author: @josephfarina
- #12158 fix(core): ChatComposer keeps its send action inside the composer on a narrow screen
  Author: @josephfarina
- #12242 fix(cli): the npm commands the CLI runs for itself use npm's own noproxy setting
  Author: @josephfarina
- #12283 fix(core): dark secondary text meets 4.5:1 on the neutral fill over the page and cards
  Author: @josephfarina
- #12290 fix(Markdown): keep bulleted and numbered lists inside their column
  Author: @josephfarina
- #12372 [fix] Heading: a missing level renders an h2 and warns, instead of crashing
  Author: @josephfarina
- #12447 spec(AST-057): the swipe codemod's paths match it in any lifecycle folder
  Author: @josephfarina
- #12475 fix(templates): on a phone the settings search moves under the title
  Author: @josephfarina
- #12530 fix(cli): the contact-form template fits a phone; its section fills the width up to 800px
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12812.

@github-actions
github-actions Bot deleted the josephfarina/chat-composer-narrow-footer branch November 19, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — fec1bc37 Deployed Nov 16, 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. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant