Repository navigation
fix(Layout): a Layout with no contentWidth caps no header or footer - #10715
Conversation
Layout reset --layout-content-width to 100cqi for descendants. LayoutHeader and LayoutFooter read it as max-width, but only the middle row is a query container, so in the header and footer 100cqi resolved to an outer container or the viewport. In a frame wider than the viewport they stopped at the viewport's width. The reset is now 'initial', so their var(--layout-content-width, none) falls back to none, as component:Layout's default says. --layout-alignment-width stays 100cqi: LayoutContent reads it only inside the middle row's container. Red first: LayoutContentWidthDefault.a11y.chromium.spec.ts fails on main (inner wrapper 1280 of a 2400 frame) and passes here.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 827bf23 |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| AlertDialog | 105.4 kB (+1 B) · 14.6 kB CSS (+3 B) | — | — · — · — |
| CommandPalette | 73.1 kB (−1 B) · 12.7 kB CSS (+4 B) | — | — · — · — |
| Layout | 7.0 kB (0) · 2.3 kB CSS (+3 B) | — | ✓ · ✓ · ✓ |
10 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| PowerSearch | 285.0 kB (0) · 24.1 kB CSS (+3 B) | — | — · — · — |
| Tokenizer | 91.4 kB (0) · 18.8 kB CSS (+2 B) | — | — · — · — |
| lab/Comments | 348.3 kB (+1 B) · 2.5 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 277.7 kB (+1 B) · 454 B CSS (0) | — | — · — · — |
| LayoutContent | 17.7 kB (0) · 1.7 kB CSS (0) | — | ✓ · ✓ · ✓ |
| LayoutFooter | 6.1 kB (0) · 1.6 kB CSS (0) | — | ✓ · ✓ · — |
| LayoutHeader | 6.2 kB (0) · 1.6 kB CSS (0) | — | ✓ · ✓ · — |
| LayoutPanel | 21.3 kB (0) · 4.9 kB CSS (0) | — | ✓ · ✓ · ✓ |
| lab/CommentThread | 341.6 kB (0) · 2.4 kB CSS (0) | — | — · — · — |
| AppShell | 90.9 kB (0) · 13.5 kB CSS (−12 B) | — | — · — · — |
Package size: @astryxdesign/core 7.17 MB packed (+26 B); no new dependencies.
API changes: none in this pull request
Committed API report behind this build: cli 29 rows, core 34 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.
Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because drafts run no CI; marking the pull request ready for review starts it.
Resetting --layout-content-width to initial restores the "no content width" default for LayoutHeader and LayoutFooter. In a 2400px frame at a 1280px viewport, their inner wrappers now measure 2400px instead of 1280px, and Layouts that set contentWidth or sit in narrower frames render unchanged.
- Non-blocking: the new comment at
Layout.tsxlines 82–85 says the alignment width is read only inside the middle row's query container and thatcontentWidthoverrides both values; neither holds without a lengthcontentWidth(inline suggestion attached). - Non-blocking: the description has no
## Writing rubric resultssection for theLayout.spec.mdedit, which the contributing guide asks for whenever a record changes.
[Automated review]
| // A Layout without contentWidth caps no region: `initial` makes every | ||
| // var(--layout-content-width, none) fall back to none. The alignment width | ||
| // is read only inside the middle row's query container, where 100cqi is | ||
| // its own width. An explicit contentWidth overrides both on this node. |
There was a problem hiding this comment.
Non-blocking (comment accuracy): two statements here don't hold. LayoutContent applies its alignment calc in every Layout, and the middle row is a query container only when a length contentWidth is set (and not both panels); without one, the two 100cqi terms cancel at LayoutContent. A percentage, intrinsic or bare-variable contentWidth replaces only the content width. A version that keeps only the reasons:
// `initial` makes every var(--layout-content-width, none) fall back to none,
// so a Layout without contentWidth caps no region. LayoutContent subtracts the
// alignment width from its own 100cqi, so this value adds no gutter. A
// contentWidth on this node replaces the content width; a length one also
// replaces the alignment width.
User impact
Anyone who puts a
LayoutwithoutcontentWidthin a frame wider than the browser window (a scrolling canvas, a wide embed, a horizontally scrolling board) sees itsLayoutHeaderandLayoutFootercontent stop at the window's width, while the content region below spans the whole frame. Header actions and footer controls end up stranded mid-frame.After this change the header and footer span the frame, like the rest of the Layout. Layouts that set
contentWidth, and frames narrower than the window, render as before.Problem and solution fit
--layout-content-widthto100cqifor its descendants.LayoutHeaderandLayoutFooterread it asmax-width: var(--layout-content-width, none), but only the middle row is a query container. So in the header and footer,100cqiresolves against an outer query container, or the viewport when there is none.initial, a guaranteed-invalid value, so everyvar(--layout-content-width, none)falls back tonone, which is the defaultcomponent:Layoutstates.--layout-alignment-widthstays100cqi: LayoutContent reads it only for padding math inside the middle row's container, where100cqiis that row's own width.contentWidth(component:LayoutFR6), now throughinitialinstead of100cqi. The styles that read--layout-content-widthfor alignment apply only whencontentWidthis set.Expected behavior and authority
component:Layout: the Content width row's default is "none", and FR6 says a nested Layout withoutcontentWidthdoes not inherit its parent's.Smallest restoration
Layout.tsx:--layout-content-width: 'initial'in the inner reset, with the comment updated.contentWidth.test.tsx: the nested-reset expectation readsinitial.Core/Layout › No Content Width — Frame Wider Than the Viewport(a 2400px frame), and a Chromium spec over it.component:Layout's FR6 verification row andverified_byname the new spec.[fix]Changeset for@astryxdesign/core.Evidence
LayoutContentWidthDefault.a11y.chromium.spec.tsagainst a Storybook built frommainplus the story, at a 1280px viewport. The header's and footer's inner wrappers measure 1280px inside a 2400px frame: both cases fail.contentWidthcase (no panels, one panel, both, nested, percentage widths).Scope
Testing
LayoutContentWidthDefault.a11y.chromium.spec.ts: 0 of 2 pass onmain, 2 of 2 here.vitestforLayout,AppShellandtheme/derivedVarRegistry.test.ts: 13 files, 375 tests pass.pnpm check:knowledge,check:changesetsand strict ESLint on the changed files: clean.