Repository navigation
fix(cli): the contact-form template fits a phone; its section fills the width up to 800px - #12530
josephfarina wants to merge 6 commits into
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
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: theToolbarTableFilterblock's unset Status, Priority and Customer chips render 50 px wide with no visible text, and in a full-widthHStack"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:Selectorclaim ("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.
…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.
There was a problem hiding this comment.
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
nowrapellipsis on main; give the value span its own direction (for exampledir="auto"withtext-align: match-parent) and add a mixed-direction case to the test. - The ghost and secondary cases in
Selector.placeholderWidth.test.tsxassert thatcontainis notinline-size, which no variant sets, so they still pass with the clamp applied to every variant; assertwhite-space: nowrapthere, 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
nowrapdid: 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.
…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.
There was a problem hiding this comment.
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 makestext-align: startfollow 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: 0ontriggerLabel, withmargin-inline-start: autoon the end content when a leading icon is present) puts the text back at the field's start while keeping the own-end ellipsis, whereastext-align: match-parentdoes 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
nowrapwith 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.
… 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.
There was a problem hiding this comment.
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
LayoutContentwith Layout's default inset, orAppShell 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.
There was a problem hiding this comment.
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.
- #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
|
Landed in #12812. |
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
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-fieldsDEC-1), so its full width became that minimum.The Section takes
width="100%"with its existingmaxWidth={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 takeswidth="100%".Evidence
Scope
Components: cli (contact-form template)
Testing
astryx experimental renderin 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