Skip to content

fix(cli): the contact-form template fits a phone; its section fills the width up to 800px - #12530

Closed
josephfarina wants to merge 6 commits into
mainfrom
josephfarina/selector-placeholder-width
Closed

josephfarina wants to merge 6 commits into
mainfrom
josephfarina/selector-placeholder-width

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

User impact

The contact-form template scrolled sideways on a phone. At 390px it was 393px wide in matcha and y2k, and at 320px it was 358px wide in matcha and y2k and 322px in chocolate. A long placeholder ("When are you thinking of launching?") set the page's minimum width. With this change the page fits at 390 and 320px in every theme. On its own, at 768px and wider, it renders pixel-identical to main. Inside a padded layout region (Layout's default content inset, or AppShell content padding) narrower than the section's 800px, the section now stays within the padding; on main it took its content's width and ran into the padding (at 768px with 16px padding, 768px wide in a 736px region).

Problem and solution fit

  • Why does it occur? The form's Section sits in a VStack that centres its children (hAlign="center"), so the Section takes its content's width up to 800px, and never less than its content's minimum width. A Selector's placeholder is one line by design (family:input-fields DEC-1), so its full width became that minimum.
  • Why does it harm the task? Sideways scroll on a phone hides part of every field and button.
  • Why does that matter? The template is what people start a form page from.

The Section takes width="100%" with its existing maxWidth={800}, so it fills its region up to 800px and stays centred. Where the region is 800px or wider it already drew at 800px. Its fields then take the width they are given, and a long placeholder ends in an ellipsis, as Selector draws it in any narrow field.

Expected behavior and authority

Templates must not overflow their region at phone width (320 and 390px). Selector keeps its released one-line behaviour.

Smallest restoration

packages/cli/assets/templates/pages/contact-form/page.tsx: the Section takes width="100%".

Evidence

  • Before: at 390px matcha and y2k are 393px wide; at 320px matcha and y2k are 358px and chocolate 322px.
  • After: 390px and 320px wide in all three themes.
  • Unchanged on its own: at 1280, 1024 and 768px, light and dark, the page renders pixel-identical to main in matcha, y2k and chocolate. At 390px chocolate is pixel-identical too.
  • Changed inside a padded region narrower than 800px: the section fits the region instead of running into its padding.

Scope

Components: cli (contact-form template)

  • 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

  • Rendered the template with astryx experimental render in matcha, y2k and chocolate at 320, 390, 768, 1024 and 1280px, light and dark. Measured the page width and compared full-page screenshots with main pixel by pixel.
  • node scripts/check-changesets.mjs

…m width

An input-variant trigger's value takes the width its field gives it (contain: inline-size), since it already ellipsizes. A long placeholder no longer makes its one-line width the layout's minimum and pushes a narrow page sideways. Ghost and secondary triggers still size to their value.
@vercel

vercel Bot commented Nov 18, 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 18, 2026 5:27am UTC

Request Review

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 18, 2026
@astracat-bot

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 5:35 AM UTC

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

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 2c78524

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 5.38 MB packed (+13 B); no new dependencies.

Not run on this PR: 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.

This needs an engineering owner's decision before it can be approved. The input-field family rules let a standalone Selector size to its placeholder or selected value (family:input-fields DEC-1), and this change ends that for input Selectors in every layout, so an owner either amends DEC-1 or records the decision by commenting /approve-spec with the full head SHA; as an engineering owner, you may record it yourself. The 390 px fix itself works: the contact-form template goes from 402 px to 390 px wide in matcha and y2k.

Whatever the decision, these need changes:

  • contain: inline-size (Selector.tsx:213-215) also removes the value's preferred width, so in content-sized rows an input Selector shrinks to its chevron: the ToolbarTableFilter block's unset Status, Priority and Customer chips render 50 px wide with no visible text, and in a full-width HStack "Within a month" shows as "Within…".
  • The description says "No visual change where the text already fits", which those rows disprove, and it quotes a component:Selector claim ("The field, not the value, decides the width") that the current record does not contain.

A test that measures a field's width in a content-sized row would catch the first finding, and CI has not run on this head yet.

Claims and files checked

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

  • Claim: a long Selector placeholder made the contact-form page scroll sideways at 390 px in matcha and y2k — verified (402 px on the base).
  • Claim: the page fits at 390 px with the change — verified in matcha, y2k and neutral (390 px); other themes not measured.
  • Claim: the value's one-line width counted as the layout's minimum — verified (a 275 px placeholder forced a 341 px field).
  • Claim: the containment adds nothing to the layout's minimum — verified, and it also removes the value's preferred width.
  • Claim: ghost and secondary Selectors still size to their value — verified (ghost 108 px on both).
  • Claim: the Selector record says the field, not the value, decides the width — false (no such claim; the family rules say the opposite).
  • Claim: no visual change where the text already fits — false (a 1040 px row cuts or hides the text).
  • Claim: no new public API is hidden under the fix — verified (no API rows); the default layout behaviour does change.
  • Claim: the regression test fails on main — verified for the input case; the ghost and secondary cases pass on both.
  • Claim: the Selector tests pass — verified (16 files, 367 tests).
  • Claim: the look-gate note about the primary button's pressed state — not checked; it concerns another component.
  • Changeset: a Selector in a field no longer makes a narrow page scroll sideways — verified.
  • Changeset: the text no longer sets the field's minimum width; ghost and secondary still size to their value — verified, narrower than the change.
  • File: .changeset/core-selector-placeholder-width.md — accurate but does not warn content-sized callers (non-blocking).
  • File: packages/core/src/Selector/Selector.tsx — both blocking findings; the new comment is one long sentence (non-blocking).
  • File: packages/core/src/Selector/Selector.placeholderWidth.test.tsx — clear; it pins the CSS value, not the layout.

Automated review (maintainer link)

Comment thread packages/core/src/Selector/Selector.tsx Resolved
Comment thread packages/core/src/Selector/Selector.tsx Resolved
…idth

Instead of containing the value's width, the value may break between any two characters and shows one clamped line with an ellipsis. Its one-line width stays the field's preferred width, so content-sized rows keep the full value; only its minimum goes.

@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 390 px overflow is fixed and content-sized rows keep their width, but three things need fixing:

  • A Selector in a Toolbar's center lane no longer makes the row wrap, because the lane is sized from its content's minimum width and the clamp drops that minimum: at 400 px main wraps the row and shows "Within a month", while this branch keeps one row, cuts it to "Within …" and moves the center lane off the middle, against the Toolbar's wrapping rule; fix the overflow in the contact-form template's centred column instead, or keep the value's minimum width where a layout wraps by it, and add a browser check of that toolbar case.
  • In a field whose direction differs from its text (an English placeholder in a right-to-left page, or a Hebrew option in a left-to-right one), the clamp puts its ellipsis over the text's first letter and cuts the end with no marker, unlike the nowrap ellipsis on main; give the value span its own direction (for example dir="auto" with text-align: match-parent) and add a mixed-direction case to the test.
  • The ghost and secondary cases in Selector.placeholderWidth.test.tsx assert that contain is not inline-size, which no variant sets, so they still pass with the clamp applied to every variant; assert white-space: nowrap there, as the description says they do.

Two smaller notes: the description's 41/48/65 px and 102 px figures are text widths (the chips are 91, 98 and 115 px, unchanged), and the new comment at Selector.tsx:208-212 reads better as short sentences (see the inline suggestion).

Claims and files checked

Review mode: incremental; reason: none

  • Claim: a long placeholder made the contact-form page wider than 390 px in matcha and y2k: verified (402 px on main).
  • Claim: the page now fits at 390 px in every theme: verified in all seven themes.
  • Claim: the text keeps setting the field's preferred width, so a content-sized row still shows the whole value: verified for rows with room (the filter toolbar at four widths and content-sized rows are pixel-identical).
  • Claim: where the text fits, widths are unchanged: false in a Toolbar center lane at 400 px (first finding).
  • Claim: the clamp shows one line with an ellipsis exactly as nowrap did: false for mixed-direction text (second finding); true for text in the field's own direction.
  • Claim: ghost and secondary keep nowrap: verified in the browser.
  • Claim: the regression test holds ghost and secondary to nowrap: false (third finding).
  • Claim: the regression test fails on main: verified for the input case.
  • Claim: the toolbar chips (41, 48, 65 px) and the "Within a month" field (102 px) match main: they match main; the figures are text widths.
  • Claim: in chocolate each placeholder is one 30 px line ending in an ellipsis: chocolate's placeholders fit on one 20 px line.
  • Claim: the Selector and Toolbar suites pass: verified.
  • Changeset: no sideways scroll, preferred width kept and minimum dropped: verified; "the text ends in an ellipsis on one line, as before": false for mixed-direction text; ghost and secondary unchanged: verified.
  • File packages/core/src/Selector/Selector.tsx: first and second findings, comment suggestion.
  • File packages/core/src/Selector/Selector.placeholderWidth.test.tsx: third finding.
  • File .changeset/core-selector-placeholder-width.md: its "as before" follows the second finding.

Automated review (maintainer link)

Comment thread packages/core/src/Selector/Selector.tsx Resolved
Comment thread packages/core/src/Selector/Selector.tsx Resolved
Comment thread packages/core/src/Selector/Selector.tsx Resolved
…rection

A chosen value keeps nowrap, so a lane sized from its content's minimum (a Toolbar's center) still wraps the row to make room, as on main. The trigger's text span gets dir=auto, so in a field of the other direction its ellipsis lands at its own end. The ghost and secondary tests assert nowrap.
@josephfarina josephfarina changed the title fix(Selector): an input trigger's value never sets its field's minimum width fix(Selector): an input trigger's placeholder never sets its field's minimum width Nov 18, 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 390 px overflow is fixed, a chosen value in a Toolbar's center lane wraps the row as on main, and the new tests fail on main and catch each mutation tried, but three things need fixing:

  • An unset Selector in a Toolbar's center lane still keeps the row on one line instead of wrapping it: at 400 px main moves the end lane to a second line and shows "Pick a window", while this branch shows "Pic…" with the center lane off the middle, against the Toolbar's wrapping rule; fix the overflow in the contact-form template's centred column instead, or keep the placeholder's minimum width where a layout wraps by it, and add a browser check of that case.
  • dir="auto" on the trigger text also makes text-align: start follow the text, so in a right-to-left page English text, numbers and prices (Pagination's page sizes included) move to the chevron end of the field, and Hebrew does the same in a left-to-right page; letting the label hug its text (flexGrow: 0 on triggerLabel, with margin-inline-start: auto on the end content when a leading icon is present) puts the text back at the field's start while keeping the own-end ellipsis, whereas text-align: match-parent does not, so please add an alignment case to the test too.
  • The description says the Selector's text, and the value, no longer set the field's minimum width, but a chosen value still does by design, so please say "the placeholder" in the User impact and authority sections.

Two smaller notes: the 41/48/65 px and 102 px figures are text widths (the chips are 91, 98 and 115 px, unchanged), and the comment at Selector.tsx:208-214 reads better as short sentences.

Claims and files checked

Review mode: incremental; reason: none

  • Claim: a long placeholder made the contact-form page 402 px wide at 390 px in matcha and y2k: verified.
  • Claim: in chocolate and neutral the page fit only by a pixel or two: not measured (both fit on main).
  • Claim: the Selector's text never sets the field's minimum width: false, a chosen value still does (third finding).
  • Claim: the page now fits at 390 px in every theme: verified at 390 px in matcha and y2k; the placeholder code is unchanged from the revision where all seven themes fit.
  • Claim: the placeholder's one-line width stays the preferred width, so a content-sized row still shows it whole: verified where there is room (Toolbar center lane at 720 px unchanged).
  • Claim: a chosen value keeps nowrap, so a Toolbar center lane still wraps its row as on main: verified at 400 and 720 px.
  • Claim: ghost and secondary keep nowrap: verified.
  • Claim: with dir="auto" a cut text's ellipsis lands at its own end: verified in both directions; it also moves the text's alignment (second finding).
  • Claim: the value no longer forces the layout wider than the screen: false for a chosen value (third finding).
  • Claim: where the text fits, widths are unchanged: false for an unset Selector in a Toolbar center lane at 400 px (first finding).
  • Claim: the toolbar chips (41, 48, 65 px) and the "Within a month" field (102 px) match main: they match main; the figures are text widths.
  • Claim: the regression test holds the placeholder to one clamped line and a chosen value and the ghost and secondary placeholders to nowrap with the text's own direction, and fails on main: verified, and it catches each mutation tried.
  • Claim: the Selector and Toolbar suites pass (410): verified.
  • Claim: in matcha, y2k and chocolate each placeholder is one 30 px line ending in an ellipsis: true in matcha and y2k; chocolate's fit on one 20 px line.
  • Claim: the look check's results: not reproduced (an external check).
  • Changeset: no sideways scroll from a long placeholder, preferred width kept and minimum dropped, one-line ellipsis: verified; a chosen value and ghost and secondary Selectors unchanged: false for numbers and opposite-direction text (second finding); the text takes its own direction: verified.
  • File packages/core/src/Selector/Selector.tsx: first and second findings, comment note.
  • File packages/core/src/Selector/Selector.placeholderWidth.test.tsx: clear apart from the alignment case the second finding asks for.
  • File .changeset/core-selector-placeholder-width.md: its "unchanged" follows the second finding.

Automated review (maintainer link)

Comment thread packages/core/src/Selector/Selector.tsx Resolved
Comment thread packages/core/src/Selector/Selector.tsx Resolved
… of its content's width

Reverts the Selector change: the section around the form centred to its content's width, so a long placeholder's one-line width set the page's minimum and pushed a 390px page sideways. The Section now takes width 100% up to its 800px maximum, as wide screens already drew it.
@josephfarina josephfarina changed the title fix(Selector): an input trigger's placeholder never sets its field's minimum width fix(cli): the contact-form template fits a phone; its section fills the width up to 800px Nov 18, 2026
@github-actions github-actions Bot removed the needs:design-review Affects visuals — Design should review label Nov 18, 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 contact-form page now fits 320 and 390 px screens on its own and is unchanged at 768 and 1280 px, but one claim needs fixing:

  • The release note's "Wider screens are unchanged" holds only for the page rendered on its own: inside a layout region with padding (a LayoutContent with Layout's default inset, or AppShell contentPadding={4}), width="100%" keeps the section inside that padding where main let it reach the screen edges, so at 768 px it goes from 768 to 736 px wide (and at 390 px from 390 to 358 px); please scope the sentence, for example "On its own the page looks the same on wider screens. Inside a layout region with padding, the section now stays within that padding at every width, as it already did on wide screens.", and the description's Evidence section the same way.

One smaller note: #12104 carries the same contact-form hunk and also lists the contact form in its release note, so whichever lands second should drop that part.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: the page scrolled sideways on a phone in matcha and y2k, and in chocolate at 320 px: verified (402 px wide at 390 px, 367 and 329 px at 320 px in this renderer; the description's exact widths come from another renderer).
  • Claim: a long Selector placeholder set the page's minimum width because the centred column sizes the section to its content: verified (page.tsx:111; the section is 413 px wide on a 390 px screen in matcha).
  • Claim: the page now fits at 390 and 320 px in every theme: verified in matcha, y2k, chocolate and neutral at 390 px and matcha, y2k and chocolate at 320 px.
  • Claim: at 768 px and wider the page is pixel-identical to main, light and dark: verified on its own at 768 and 1280 px in light; false inside a padded layout region (the finding); 1024 px and dark were not captured.
  • Claim: at 390 px chocolate is pixel-identical: verified on its own; false inside a padded layout region.
  • Claim: fields take the width they are given and a long placeholder ends in an ellipsis: verified (a 252 px field for a 275 px placeholder at 390 px).
  • Claim: on wider screens the section already drew at 800 px: verified at 1280 px.
  • Claim: Selector keeps its released one-line behaviour: verified; the Selector source is identical to main.
  • Claim: the smallest restoration is one Section prop: verified; it is the only code change.
  • Claim: the changeset check passes: verified.
  • Claim: renders with the CLI's experimental renderer: not reproduced; Storybook renders were used instead.
  • Claim: no new public API, default or interaction model: verified.
  • Changeset: no sideways scroll on a phone: verified; the section takes the full width up to 800 px: verified on its own; a long placeholder no longer sets the minimum width: verified; wider screens are unchanged: false inside a padded layout region (the finding); a patch fix for the CLI: matches the rule that template content may change in a patch.
  • File packages/cli/assets/templates/pages/contact-form/page.tsx: clear on its own; the release note has to describe its effect in padded hosts; template grade A, unchanged from main.
  • File .changeset/cli-contact-form-phone-width.md: the finding.

Automated review (maintainer link)

@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 finished on this head yet. The contact-form page now fits 320 and 390 px screens on its own and looks the same at 768 px and wider, and the release note now says what changes inside a padded layout region narrower than 800 px.

One note: #12104 carries the same contact-form change and also lists the contact form in its release note, so whichever lands second should drop that part.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: the page scrolled sideways on a phone in matcha and y2k, and in chocolate at 320 px: verified (402 px wide at 390 px, 367 and 329 px at 320 px in Storybook; the description's exact widths come from another renderer).
  • Claim: a long Selector placeholder set the page's minimum width because the centred column sizes the section to its content: verified (page.tsx:111, :225; the section is 413 px wide on a 390 px screen in matcha).
  • Claim: the page now fits at 390 and 320 px in every theme: verified in matcha, y2k and chocolate at 390 px, and in matcha and chocolate at 320 px.
  • Claim: on its own, at 768 px and wider, the page is pixel-identical to main in light and dark: verified at 768 px (matcha), 1024 px (y2k, dark) and 1280 px (chocolate).
  • Claim: on its own, chocolate at 390 px is pixel-identical: verified.
  • Claim: inside a padded region narrower than 800 px the section stays within the padding, where main ran into it (768 px wide in a 736 px region at 768 px): verified (768 to 736 px; a 788 px region changes from 800 to 788 px, an 808 px region does not change).
  • Claim: the section fills its region up to 800 px, stays centred, and already drew at 800 px in wider regions: verified at 840, 1024 and 1280 px.
  • Claim: fields take the width they are given and a long placeholder ends in an ellipsis: verified.
  • Claim: Selector keeps its released one-line behaviour: verified; the Selector source is unchanged.
  • Claim: the smallest restoration is one Section prop: verified; it is the only code change.
  • Claim: the changeset check passes: verified.
  • Claim: rendered with the CLI's experimental renderer: not reproduced; the same states were rendered in Storybook.
  • Claim: no new public API, default or interaction model, and no internal context in public text: verified.
  • Changeset: a patch fix for the CLI: matches the rule that template content may change in a patch release; no sideways scroll on a phone: verified; the section takes the full width up to 800 px instead of its content's width: verified; a long placeholder no longer sets the minimum width: verified; on its own the page looks the same at 768 px and wider: verified; inside a padded region narrower than 800 px the section stays within the padding: verified.
  • File packages/cli/assets/templates/pages/contact-form/page.tsx: clear; template grade A, unchanged from main.
  • File .changeset/cli-contact-form-phone-width.md: clear.

Automated review (maintainer link)

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/selector-placeholder-width branch November 19, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 2c78524b Deployed Nov 18, 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