Skip to content

refactor(templates): example blocks lay out with HStack and VStack instead of flex wrappers - #12143

Closed
josephfarina wants to merge 3 commits into
mainfrom
josephfarina/blocks-stack-wrappers
Closed

josephfarina wants to merge 3 commits into
mainfrom
josephfarina/blocks-stack-wrappers

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What

Six example blocks laid out their content with a hand-written flex div where Core's HStack/VStack does the same job. People and agents copy blocks, so these now use the stack components with the same spacing step:

  • HeadingTruncation: column with a 24 px gap → VStack gap={6}.
  • MoreMenuBottomSheet: the bordered frame row (16 px gap, centered, space-between) → HStack gap={4} vAlign="center" hAlign="between", and its text column with a 4 px gap → VStack gap={1}.
  • StepContent: column with a 12 px gap → VStack gap={3}.
  • StepIndicator: wrapping row with a 24 px gap → HStack wrap="wrap" gap={6}.
  • StepStates: wrapping row with a 32 px gap → HStack wrap="wrap" gap={8}.
  • useGridFocusHookUsage: the grid container (4 px column) → VStack gap={1} with its ref, role="grid", label and key handlers, and each role="row" → HStack role="row" gap={1}. Stack forwards the ref, role and handlers, and the accessibility tree is unchanged.

Left as they are on purpose: StepperIndicatorModes (its 48 px gap is beyond the stack spacing steps), the frames' border, radius and padding (no Core frame without padding and radius, so these stay inline; the bottom sheet's frame now lays out with HStack), the framework-free "Vanilla" blocks, and the stepper custom-content example (its fields row is changing in another open pull request).

Evidence

  • Default theme: screenshots of every changed block in 360 px and 1200 px columns, in a plain column and in a centered example frame, are byte-identical before and after; the grid-focus and bottom-sheet conversions were re-shot at this head, also byte-identical at 360 and 1200 px.
  • Themes with roomier spacing (matcha, y2k): the gaps now follow the theme's spacing steps, so they are about 1.5 times wider (24 px becomes 36 px, 32 px becomes 48 px). Nothing overflows or overlaps; the step states row already wraps its fifth example onto a second line at 1200 px, and that line now sits a little lower.
  • The grid-focus example's accessibility snapshot is identical before and after.
  • Build replay over real build requests: no start, alternatives list or block list changes.
  • Lint and prettier pass.

Scope

  • Example blocks only; no component or API change.
  • Public text contains no internal context.

preflight: pass 14097f5 (env-only fails excused: G59 global-local rows-40-59, packed-gather-cache.records, release/handoff.e2e; each fails identically without the change or passes alone)

@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 19, 2026 2:59am 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
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review 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 19, 2026, 3:16 AM UTC

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 45d9ef1

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

Requesting changes. The stack conversion itself is clean and renders pixel-identically in the default theme, but the release note overstates it.

  • The changeset says the blocks "look the same", but their gaps now follow the theme's spacing scale, so in the matcha and y2k themes every converted gap is 1.5x wider (for example 24 to 36 px and 32 to 48 px) and the States block wraps at 1280 px; please reword .changeset/blocks-stack-wrappers.md:5 to say the gaps follow the theme's spacing steps.

Optional: list VStack/HStack in the five blocks' componentsUsed. Making the swatch grid container a VStack gap={1} would also put its row gap on the same spacing token as its cells.

Claims and files checked

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

  • Claim: the six named examples use HStack and VStack instead of flex wrappers. Verified in each file's diff.
  • Claim: they look the same. False outside the default spacing steps: matcha and y2k gaps grow 1.5x.
  • Claim: each block keeps its old gap through the matching step (24, 4, 12, 24 and 32 px). Verified: the computed gaps match in the neutral theme.
  • Claim: the grid rows keep their row role and the accessibility tree is unchanged. Verified: each row renders with its role and eight cells, and Stack adds no role.
  • Claim: some blocks are left alone on purpose (a 48 px gap beyond the steps, the bordered frames, the framework-free blocks, a stepper block that another open pull request changes). Verified: the largest step is 40 px, and that pull request exists.
  • Claim: screenshots are pixel-identical. Verified in the neutral theme at 1280 px, not in matcha or y2k.
  • Claim: the build replay shows no list changes. Consistent: no doc metadata changed, and block search reads only that metadata. The replay was not re-run.
  • Claim: lint and prettier pass. Verified: the lint check passed.
  • Claim: example blocks only, with no component or API change. Verified.
  • Claim: the public text has no internal context. Verified.
  • File .changeset/blocks-stack-wrappers.md: finding (the claim above).
  • File HeadingTruncation.tsx: clear (optional componentsUsed note).
  • File useGridFocusHookUsage.tsx: note (the grid container keeps a pixel gap beside rows that use the token).
  • File MoreMenuBottomSheet.tsx: clear (optional componentsUsed note).
  • File StepContent.tsx: clear (optional componentsUsed note).
  • File StepIndicator.tsx: clear (optional componentsUsed note).
  • File StepStates.tsx: clear (optional componentsUsed note).

Automated review (maintainer link)

Comment thread .changeset/blocks-stack-wrappers.md Resolved
@josephfarina
josephfarina force-pushed the josephfarina/blocks-stack-wrappers branch from 45d9ef1 to 775f5b7 Compare November 16, 2026 20:06
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 775f5b7

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

Requesting changes. The stack conversion is clean and renders pixel-identically with the default spacing steps, but the release note still overstates it.

  • The changeset says the blocks "look the same", but their gaps now follow the theme's spacing scale, so in the published matcha and y2k themes every converted gap is 1.5x wider (for example 24 to 36 px and 32 to 48 px) and the Step states row wraps at 1280 px; please reword .changeset/blocks-stack-wrappers.md:5 to say the gaps follow the theme's spacing steps.

Optional: list the stack each block now renders in the five blocks' componentsUsed, and make the swatch grid container a VStack gap={1} so its rows and cells share one spacing token.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: the six named examples lay out with HStack and VStack instead of hand-written flex wrappers. Verified in each file.
  • Claim (release note): they look the same. False outside the default spacing steps: in matcha and y2k every converted gap grows 1.5x.
  • Claim: each block keeps its old spacing through the matching step (24, 4, 12, 24, 32 and 4 px). Verified with the default steps: all six blocks render pixel-identically and the measured gaps match.
  • Claim: the grid rows keep their row role and the accessibility tree is unchanged. Verified: each row renders with its row role and eight cells, and Stack adds no role of its own.
  • Claim: some blocks are left alone on purpose (a 48 px gap beyond the steps, the bordered demo frames, the framework-free blocks, a stepper block another open pull request changes). Verified: the largest step is 40 px, Core's Card always draws a corner radius, the two framework-free blocks exist, and that open pull request edits the stepper block.
  • Claim: screenshots are pixel-identical. True with the default spacing steps only; every matcha frame changes.
  • Claim: the build replay shows no start, alternatives or block list changes. Consistent: no block metadata changed, and block search reads only that metadata. Not re-run.
  • Claim: lint and prettier pass. Verified: the lint workflow, which also checks the formatting of changed files, passed on this head.
  • Claim: example blocks only, with no component or API change. Verified: no export, command, option or default changed.
  • Claim: the public text has no internal context. Verified.
  • File .changeset/blocks-stack-wrappers.md: finding (the release note claim above).
  • File HeadingTruncation.tsx: clear (optional componentsUsed note).
  • File useGridFocusHookUsage.tsx: note (the grid container keeps a pixel gap beside rows on a spacing token).
  • File MoreMenuBottomSheet.tsx: clear (optional componentsUsed note).
  • File StepContent.tsx: clear (optional componentsUsed note).
  • File StepIndicator.tsx: clear (optional componentsUsed note).
  • File StepStates.tsx: clear (optional componentsUsed note).

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 7dd0b05

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 7dd0b05

Storybook · Sandbox · built from this PR's head

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@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 was full and did not run the tests on this head, so the CI workflow needs a re-run. The release note now says the converted gaps follow the theme's spacing steps, which fixes the earlier finding, and the stack conversion keeps every gap with Core's spacing steps.

Optional follow-ups:

  • Add VStack or HStack to componentsUsed in the five block docs that now render one, so the component lookup lists these blocks.
  • Make the swatch grid container a VStack gap={1} so its rows and cells share one spacing token in every theme.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim (release note): the six examples lay out with HStack and VStack instead of hand-written flex wrappers. Verified in each file; the bottom sheet's bordered frame and the grid container keep inline flex.
  • Claim (release note): the gaps follow the theme's spacing steps, look the same in the default theme, and are wider in themes with roomier spacing. Verified: only matcha and y2k override spacing, at 1.5x on every step, and every other published theme keeps Core's steps.
  • Claim: each block keeps its old spacing through the matching step (24, 4, 12, 24, 32 and 4 px). Verified against Core's spacing tokens.
  • Claim: the grid rows keep their row role and the accessibility tree is unchanged. Verified: Stack passes the role through and adds none, and the example's keyboard tests pass.
  • Claim: some blocks are left alone on purpose (a 48 px gap beyond the steps, the bordered demo frames, the framework-free blocks, a stepper block another open pull request changes). Verified: the largest step is 40 px, Core's Card always draws a corner radius, the two framework-free blocks exist, and that open pull request edits the stepper block.
  • Claim: default-theme screenshots are identical before and after. Consistent: the converted styles resolve to the old pixel values with Core's steps.
  • Claim: in matcha and y2k the gaps are about 1.5 times wider, nothing overflows, and the step states row already wraps its fifth example at 1200 px with that line now a little lower. Verified from the token values and the cell widths.
  • Claim: the grid-focus accessibility snapshot is identical. Verified: the rows keep the same element, role and cells.
  • Claim: the build replay shows no start, alternatives or block list changes. Consistent: no block metadata changed. Not re-run.
  • Claim: lint and prettier pass. Verified: the Lint workflow passed on this head, and prettier and eslint are clean on the changed files.
  • Claim: example blocks only, with no component or API change. Verified: no export, command, option or default changed.
  • Claim: the public text has no internal context. Verified.
  • File .changeset/blocks-stack-wrappers.md: clear (the earlier finding is fixed).
  • File HeadingTruncation.tsx: clear (optional componentsUsed note).
  • File useGridFocusHookUsage.tsx: note (the grid container keeps a pixel gap beside rows on a spacing token).
  • File MoreMenuBottomSheet.tsx: clear (optional componentsUsed note).
  • File StepContent.tsx: clear (optional componentsUsed note).
  • File StepIndicator.tsx: clear (optional componentsUsed note).
  • File StepStates.tsx: clear (optional componentsUsed note).

Automated review (maintainer link)

@josephfarina josephfarina reopened this Nov 17, 2026
josephfarina added a commit that referenced this pull request Nov 18, 2026
josephfarina added a commit that referenced this pull request Nov 19, 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.

Approved pending CI: CI has not run on this head. The latest commit's message contains [skip ci], so GitHub starts no CI run for it; push a commit without it so the required checks run.

The last two inline flex wrappers, the bottom-sheet frame row and the swatch grid container, now use HStack and VStack, which fixes the earlier note about the grid's mixed pixel and token gaps. With the default spacing steps all six blocks render pixel-identically.

Optional follow-ups:

  • Add VStack or HStack to componentsUsed in the five block docs that now render one, so the component lookup lists these blocks.
  • Make the width-only cells in the Step indicator and Step states blocks VStack width={190} and VStack width={220}, so those examples use Core layout instead of raw divs.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim (release note): the six examples lay out with HStack and VStack instead of hand-written flex wrappers. Verified: no inline flex wrapper remains in the six files.
  • Claim (release note): their gaps follow the theme's spacing steps, look the same in the default theme, and are wider in themes with roomier spacing. Verified: default-theme frames are pixel-identical, and matcha and y2k set every step 1.5 times larger.
  • Claim: heading truncation 24 px becomes VStack gap={6}, the bottom sheet's title column 4 px VStack gap={1}, step content 12 px VStack gap={3}, step indicator 24 px HStack wrap="wrap" gap={6}, step states 32 px HStack wrap="wrap" gap={8}, and each grid row HStack role="row" gap={1}. Verified against Core's spacing tokens and computed styles; the list leaves out the bottom-sheet frame row (16 px, now HStack gap={4}) and the grid container (4 px, now VStack gap={1}), which the latest commit converts the same way.
  • Claim: Stack forwards the role, and the accessibility tree is unchanged. Verified: the grid, its rows and its cells keep the same elements, roles, names and selection state, and arrow-key navigation behaves the same.
  • Claim: some blocks are left alone on purpose (a 48 px gap beyond the spacing steps, the bordered demo frames, the framework-free blocks, the stepper custom-content block). Verified: the largest step is 40 px and those blocks are untouched; the bottom sheet's frame keeps its inline border, padding and radius while its row now uses HStack.
  • Claim: default-theme screenshots are byte-identical before and after. Verified in a 1200 px column for all six blocks; at other widths the computed gaps keep the same pixel values.
  • Claim: in roomier themes the gaps are about 1.5 times wider, nothing overflows, and the step states row's wrapped fifth example sits a little lower. Verified in matcha: 24 to 36 px, 32 to 48 px, and the wrapped line moves down 16 px.
  • Claim: the grid-focus accessibility snapshot is identical. Verified: roles, names and selection state match.
  • Claim: a build replay shows no start, alternatives list or block list changes. Consistent: no block metadata changed; not re-run.
  • Claim: lint and prettier pass. Verified: eslint and prettier are clean on the changed files at this head.
  • Claim: example blocks only, with no component or API change. Verified: no export, command, option or default changed.
  • Claim: the public text has no internal context. Verified.
  • File .changeset/blocks-stack-wrappers.md: clear.
  • File HeadingTruncation.tsx: clear (optional componentsUsed note).
  • File useGridFocusHookUsage.tsx: clear (the earlier grid-gap note is fixed).
  • File MoreMenuBottomSheet.tsx: clear (optional componentsUsed note).
  • File StepContent.tsx: clear (optional componentsUsed note).
  • File StepIndicator.tsx: note (width-only div cells; optional componentsUsed note).
  • File StepStates.tsx: note (width-only div cells; optional componentsUsed note).

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/blocks-stack-wrappers branch November 19, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 14097f5e Deployed Nov 19, 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