Repository navigation
feat(tablist): add isFullBleed to bleed a tab bar to container edges - #3938
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsLayout (@astryxdesign/core) · View in Storybook
TabList (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual RegressionStatus: No visual change across 4 compared shot(s). Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
|
Sorry this sat so long — the negative-margin exception in the detail-page template is a real wart and you were right to go after it. Before the prop, though: That's a shape question above a review, so I've put it in front of a maintainer instead of leaving you waiting on me further. Nothing for you to change meanwhile. If you'd rather talk it through with someone, we're in Discord. [Reviewed by Robohands] |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks for this — good to see the detail-page negative-margin exception go. The prop itself is fine; Section, Table and Divider already bleed off the same --container-padding-* vars.
The block gating is the problem. :first-child/:last-child match the TabList's own parent, not the padded container, and in the generated template the strip sits inside a StackItem — so it's both. The gate meant to stop the strip being pulled up is what pulls it up 16px into the metadata row, and the underline lands 15px above the header divider instead of on it — the one thing #2622 asked for.
Ideally I'd drop the block gating and keep this inline-only, like Divider's. Keeping the template's marginBottom: -16, I measured the underline back on the divider at 1px, same as main.
Does inline-only work, or was the auto-dock the part you wanted? If you'd rather talk it through with someone, we're in Discord.
[Reviewed by Robohands]
| maxWidth: 'none', | ||
| width: | ||
| 'calc(100% + var(--container-padding-inline-start, 0px) + var(--container-padding-inline-end, 0px))', | ||
| marginTop: { |
There was a problem hiding this comment.
Hmm, these match the TabList's own parent, not the padded container. Divider's horizontal bleed stays inline-only.
| value={activeTab} | ||
| onChange={onTabChange} | ||
| size="lg" | ||
| isFullBleed> |
There was a problem hiding this comment.
The strip is alone in a StackItem here, so it's first and last child — both block margins fire.
|
Thanks — you're right, and inline-only works. The auto-dock wasn't the part I wanted; the gating was meant as a guard for mid-content strips, but as you point out Respun in 24893c0:
Underline sits back on the header divider as on main. |
cixzhang
left a comment
There was a problem hiding this comment.
The block-axis fix in 24893c048 is exactly right, and the comment in TabList.tsx explaining why a block cancel can't reach the header's padding edge from inside StackItem > HStack is the clearest statement of that constraint I've seen written down. That blocker's closed — thank you for the fast turnaround.
One thing left, and it's the other half of the same idea.
The box bleeds, but the content doesn't follow it out. The first and last stops keep their normal paddingInline (Tab.tsx:93), so their labels land 4px short of the container's content inset — the only thing on the row that isn't on it. The metadata line above and the section heading below both sit on it.
Measured on the real detail-page template, rendered by apps/template-viewer with core aliased to source — not a repro story:
| first tab label vs content inset | ghost toggle centre / tab centre | |
|---|---|---|
| main today | 0.00px | 133.98 / 133.48 |
| this branch | −4.00px | 133.98 / 133.48 |
| + edge-stop compensation | 0.00px | 133.98 / 133.48 |
The fix stays inline-only: the first and last stops pad back in by the amount the box bled out, clamped so a stop never insets less than its normal padding. Block axis untouched, which the third row confirms.
Please don't add a block-end cancel as well. I tried that arm: it double-docks against the template's own marginBottom: -16 and puts the strip 9px below the divider with the tab centre 6px down. Your instinct to leave the block dock hand-tuned was correct — keep marginBottom: -16, marginTop: 12 and vAlign="center" exactly as they are now.
On the tests — className .toContain('fullBleed') (TabList.test.tsx:86 and :99) passes against an empty style object, because StyleX derives that class name from the object's key rather than from anything it contains. So all three pass whether or not the rule does anything, and the third asserts only that the class count grew. Not your invention: Divider's isFullBleed test says as much in its own comment. Worth not carrying forward, though. jsdom has no layout, so this wants a browser test — set --container-padding-inline-start on a wrapper, assert the strip's box escapes it and the first stop's label lands back on it.
Two smaller things:
- Dropping
marginInline: -12also moves the ghost panel-toggle inline (ghost_box_end_inset−12 → 0). It lands on the content inset now, which is an improvement, but it's a visible change to that button and belongs in the description rather than being discovered. - The template moved on main —
packages/cli/templates/→packages/cli/assets/templates/— and the branch is around 904 commits behind, so the rebase won't apply cleanly. Worth doing before the next round so the measurements above stay meaningful.
Full arm-by-arm numbers, frames and sensor receipts: https://github.com/cixzhang/astryx/wiki/Review-3938
|
Correction to my last review — I sent you down the wrong path on the how. The diagnosis stands (the 4px is real, and it's a regression against main, not just an unfinished half), but please don't build what I described. There's a much smaller fix, and the one I asked for is broken in a way I hadn't measured. Do this instead. Leave const STOP_INLINE_PADDING = spacingVars['--spacing-3'];
const EDGE_PAD_START = `max(var(--container-padding-inline-start, 0px) - ${STOP_INLINE_PADDING}, 0px)`;
const EDGE_PAD_END = `max(var(--container-padding-inline-end, 0px) - ${STOP_INLINE_PADDING}, 0px)`;applied to the strip element alongside the existing Why not the version I described. I had
One honest limitation of the version I'm now asking for: with container padding below 12px ( One thing to guard: subtracting Everything else from my last review is unchanged: inline-only, no block-end rule, template keeps Sorry for the churn — better now than after you'd written the three-file version. Full measurements, 13-rig matrix and the exact diffs: https://github.com/cixzhang/astryx/wiki/Review-3938 |
24893c0 to
60adc05
Compare
|
Correction to my last comment: keeping Please hold off on the strip-padding implementation I suggested. I'm checking the surrounding header layout now so the next ask removes [Reviewed by Robohands] |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks — Cindy accepted the ownership split: TabList owns inline full bleed, and LayoutHeader owns the block-end dock. isFullBleed is an improvement and needs no further design change.
Two changes remain:
- Delete
tabsRowandstyle={tabsRow}; addLayoutHeader.paddingBlockEnd?: SpacingStepinSection's existing per-edge family and usepaddingBlockEnd={0}.
At padding={6}, current head leaves the underline +7.00px above the divider; the LayoutHeader arm is docked at −1.00px.
- Move
FullBleedGeometry.playinto required Chromium CI. Vitest never collects stories and the visual job never awaitsplay, so the current guard cannot fail CI.
Sorry for the contradictory round-2a direction; you built exactly what we asked for. Full review and measurements.
[Reviewed by Robohands]
|
Thanks — both items are in as of 37eb7df.
No worries about the round-2a direction — the correction was clearly recorded, and the driven arm A measurements made this side mechanical. |
cixzhang
left a comment
There was a problem hiding this comment.
Maintainers would get conflicting guidance if this lands as-is: TabList now consumes the shared container-padding protocol, but current main’s contract still lists the old participants.
The implementation itself matches the accepted inline/block ownership split, and the Chromium guard closes the earlier test gap. Please rebase; a maintainer needs to add TabList’s bleed-consumer role and browser verification to the owning record in the same stack. I don’t see another implementation change needed.
[Reviewed by Robohands]
…ck gating :first-child/:last-child match the strip's own parent, not the padded container, so the block cancel fired whenever the TabList sat alone in a wrapper (as in detail-page's StackItem) and pulled it into its siblings. Follow Divider's horizontal bleed instead: inline edges only. The detail-page template keeps its hand-tuned block-dock margins.
…ge tab row with it
37eb7df to
221dea6
Compare
cixzhang
left a comment
There was a problem hiding this comment.
Thanks — the inline/block ownership is right, and required Chromium did run on this head. The remaining gap can leave builders with a green check while the documented header rail/divider drifts: FullBleedGeometry hand-writes container variables, so it never exercises the real LayoutHeader paddingBlockEnd={0} → TabList isFullBleed seam. The current container-padding contract also still omits TabList from its participant and verification maps. Please cover that composition in the browser guard; a maintainer can record the consumer and evidence before landing. If you’d rather talk it through with someone, we’re in Discord.
[Reviewed by Robohands]
cixzhang
left a comment
There was a problem hiding this comment.
Thanks, this closes the author-side work. The required Chromium guard now covers the real LayoutHeader paddingBlockEnd={0} → TabList isFullBleed composition and passes on this head.
[Reviewed by Robohands]


Summary
Adds an opt-in
isFullBleed?: boolean(defaultfalse) toTabListso the tab bar box and divider can extend through a padded container without consumer-written inline negative margins.Closes #2622.
Implementation
navcancels--container-padding-inline-start/endwith negative margins and widens past its existingmaxWidth: 100%clamp.max(container padding - --spacing-3, 0px). The first/lastTaborTabMenusupplies the remaining stop padding, so label content stays aligned with the container inset while the divider reaches the outer edge.--_tab-strip-bleedthrough, preserving focus-ring room.TabandTabMenuare unchanged. The behavior is inline-only; surrounding layout continues to own block docking.Template impact
The
detail-pagetemplate now usesisFullBleedand removes only the hand-written inline margin. It intentionally keepsmarginTop: 12,marginBottom: -16, andvAlign="center".Visible change: the ghost panel toggle is no longer dragged outward by the row-level inline negative margin and now aligns with the container inset.
Verification
pnpm vitest run packages/core/src/TabList: 74 tests passedTabMenu; it verifies strip bleed, edge-label alignment, and the shared--spacing-3stop-padding assumptionTabMenucontent coordinatespnpm check:repoandgit diff --checkpassed