Repository navigation
fix(BottomSheet): resting content starts below the grab bar, whatever the padding - #8558
Conversation
… the padding
The grab bar floats over the content: 24 px tall, opaque behind the pill
and fading out across its lower half. At the default padding (16 px), a
sheet's first line started inside that fade, and a Popover sheet's (12 px)
under its opaque part, so the top of the first line read washed out or cut.
At rest, the content box's block-start inset is now never less than the
bar's height (`max(padding, --spacing-6)`), so the first line starts below
the bar for any `padding`, `padding={0}` included. The inset is the content
box's own padding, so it scrolls away with the content, which still passes
beneath the bar. The published inset stays the padding, so a child that
bleeds into it also starts below the bar. component:BottomSheet's Content
area inset records the rule.
Chromium proof: BottomSheetGrabBar.a11y.chromium.spec.ts (first line below
the bar at rest; fitting sheets don't scroll; scrolled content passes
under the bar), adapted from the measurements in the alternative fix that
shortened the fade instead.
Co-authored-by: Christopher Chedeau <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| PowerSearch · Storybook | 282.6 kB (+221 B) · 23.7 kB CSS (+174 B) | 7,249 (+3) | — · ✗ · — |
| Tokenizer · Storybook | 90.1 kB (0) · 18.5 kB CSS (+156 B) | 2,227 (0) | — · ✗ · — |
| BottomSheet | 65.7 kB (+180 B) · 7.6 kB CSS (+161 B) | — | — · ✓ · — |
51 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| TimeInput · Storybook | 158.5 kB (+175 B) · 15.9 kB CSS (+166 B) | 1,609 (0) | — · ✓ · — |
| DateTimeInput · Storybook | 204.7 kB (+173 B) · 18.6 kB CSS (+158 B) | 3,613 (0) | — · ✓ · — |
| DateInput · Storybook | 182.9 kB (+172 B) · 16.9 kB CSS (+158 B) | 5,698 (0) | — · ✓ · — |
| charts/ChartTooltip | 175.0 kB (+249 B) · 423 B CSS (0) | — | — · — · — |
| charts/Chart | 197.7 kB (+214 B) · 494 B CSS (0) | — | — · — · — |
| Pagination | 108.3 kB (+42 B) · 17.7 kB CSS (+158 B) | — | — · — · — |
| MultiSelector | 93.5 kB (+37 B) · 16.7 kB CSS (+155 B) | — | — · — · — |
| Selector | 98.2 kB (+36 B) · 17.3 kB CSS (+152 B) | — | — · — · — |
| DropdownMenu | 95.6 kB (+1 B) · 17.3 kB CSS (+163 B) | — | — · ✓ · — |
| MoreMenu | 95.9 kB (0) · 17.3 kB CSS (+163 B) | — | — · — · — |
| Popover | 87.8 kB (0) · 14.1 kB CSS (+155 B) | — | — · — · — |
| Markdown | 179.4 kB (−3 B) · 20.2 kB CSS (+149 B) | — | — · — · — |
| ContextMenu · Storybook | 106.2 kB (−2 B) · 17.1 kB CSS (+122 B) | 704 (0) | — · ✓ · — |
| Table | 116.3 kB (−3 B) · 17.8 kB CSS (+123 B) | — | — · — · — |
| TableHeaderCell | 107.0 kB (−2 B) · 17.3 kB CSS (+121 B) | — | — · — · — |
| TableCell | 107.4 kB (−6 B) · 17.5 kB CSS (+122 B) | — | — · — · — |
| SelectableCard | 18.0 kB (+37 B) · 7.3 kB CSS (+25 B) | — | — · — · — |
| AlertDialog | 104.1 kB (+42 B) · 14.3 kB CSS (+18 B) | — | — · — · — |
| Card | 6.7 kB (+34 B) · 6.4 kB CSS (+25 B) | — | — · — · — |
| ClickableCard | 17.8 kB (+33 B) · 7.1 kB CSS (+26 B) | — | — · — · — |
| Drawer | 49.3 kB (+35 B) · 8.3 kB CSS (+22 B) | — | — · — · — |
| TableSelectionToolbar | 69.3 kB (+37 B) · 13.1 kB CSS (+19 B) | — | — · — · — |
| Section | 7.8 kB (+35 B) · 6.3 kB CSS (+20 B) | — | — · — · — |
| DrawerHeader | 62.1 kB (+31 B) · 12.8 kB CSS (+20 B) | — | — · — · — |
| CommandPalette | 72.4 kB (+30 B) · 12.5 kB CSS (+17 B) | — | — · — · — |
| Dialog | 23.7 kB (+25 B) · 6.7 kB CSS (+20 B) | — | — · — · — |
| charts/ChartLegend | 48.4 kB (+42 B) · 224 B CSS (0) | — | — · — · — |
| lab/EmojiPicker | 85.1 kB (+42 B) · 751 B CSS (0) | — | — · — · — |
| lab/Comments | 337.1 kB (+41 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 330.1 kB (+41 B) · 2.4 kB CSS (0) | — | — · — · — |
| Toolbar | 42.3 kB (+19 B) · 8.1 kB CSS (+20 B) | — | — · — · — |
| lab/SelectableCardGroup | 63.1 kB (+35 B) · 162 B CSS (0) | — | — · — · — |
| lab/CommentComposer | 147.2 kB (+26 B) · 1.9 kB CSS (0) | — | — · — · — |
| richtext/RichTextEditorToolbar | 250.8 kB (+26 B) · 454 B CSS (0) | — | — · — · — |
| BottomSheetSwitcher | 17.9 kB (0) · 3.4 kB CSS (0) | — | — · — · — |
| ContextMenuItem | 28.8 kB (0) · 6.3 kB CSS (0) | — | — · — · — |
| DropdownMenuCheckboxItem | 22.6 kB (0) · 6.6 kB CSS (0) | — | — · — · — |
| DropdownMenuDivider | 5.2 kB (0) · 548 B CSS (0) | — | — · ✓ · — |
| DropdownMenuGroup | 6.3 kB (0) · 3.4 kB CSS (0) | — | — · ✓ · — |
| DropdownMenuItem | 21.9 kB (0) · 6.3 kB CSS (0) | — | — · ✓ · — |
| DropdownMenuRadioGroup | 6.5 kB (0) · 3.3 kB CSS (0) | — | — · ✓ · — |
| DropdownMenuRadioItem | 22.7 kB (0) · 6.6 kB CSS (0) | — | — · ✓ · — |
| DropdownMenuSubMenu | 69.0 kB (0) · 9.7 kB CSS (0) | — | — · ✓ · — |
| Layout | 7.0 kB (0) · 2.3 kB CSS (0) | — | — · ✓ · — |
| LayoutContent | 17.6 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.0 kB (0) · 4.9 kB CSS (0) | — | — · — · — |
| lab/ChatReactionBar | 103.5 kB (0) · 1.1 kB CSS (0) | — | — · — · — |
| lab/ChatEmojiPicker | 102.3 kB (−1 B) · 773 B CSS (0) | — | — · — · — |
| lab/TourStep | 94.1 kB (−37 B) · 590 B CSS (0) | — | — · — · — |
Package size:
- @astryxdesign/cli 3.52 MB packed (−310 B); no new dependencies
- @astryxdesign/core 6.99 MB packed (+2.1 kB); no new dependencies
API changes: none in this pull request
Committed API report behind this build: cli 29 rows, core 35 rows; run pnpm api:report.
Wide change (9 components): add ci:run-visual or ci:run-rtl to run them.
Accessibility: 2 violation(s)
Accessibility Audit
Status: 2 accessibility violation(s) found — 2 serious.
PowerSearch - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 2/36 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
Tokenizer - 1 issue(s)
- 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
- Rule:
color-contrast· Affects 2/31 stories · Learn more - WCAG: 1.4.3 (Level AA)
- Rule:
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
This change is waiting on an engineering owner to decide the new BottomSheet rule it adds: at rest, a sheet's block-start inset is never less than the grab bar's 24px. That rule replaces the current inset (the padding prop, then theme padding, then --spacing-4) and the unpadded padding={0} contract, so an engineering owner records the decision by commenting /approve-spec <full head SHA> here; the author may do so as an engineering owner. Whatever the decision, a few fixes are needed:
- The DateInput, DateTimeInput and TimeInput touch pickers and the DropdownMenu and ContextMenu action sheets pass
padding={0}and already reserve the band, so they now get a second 24px strip under the handle and grow 24px taller. --container-padding-block-startnow publishes less than the padding actually applied, but FR4 and the container-padding architecture require the two to match: publish the applied value or amend those records in this PR.BottomSheet.doc.mjs, thepaddingJSDoc and the record's compatibility line still describe the old inset, and under AST-017 FR3 this change is a[feat], not a[fix].
[Automated review]
…heets stop reserving the band From CodeBunny's review at a6642d3: - The block-start inset is now floored where it is published, so the Content area applies and publishes the same value (bleed children escape exactly what they sit in): the theme default's chain in Layout/container.stylex.ts, and each explicit padding step in BottomSheetPanel. - Core's own padding={0} sheets reserved the band under the grab bar themselves, so they grew a second 24px strip. The touch date, date-time and time pickers drop their 24px top padding (they look the same), and the DropdownMenu and ContextMenu sheet content drops its 16px top (their first row sits 8px lower, below the bar). - BottomSheet's doc, `padding` JSDoc and the record's compatibility line describe the floor; the changeset is a [feat] (spec:AST-017 FR7).
There was a problem hiding this comment.
This change is waiting on an engineering owner to decide the new BottomSheet rule it writes into the component record: at rest the Content area's block-start inset is never less than the grab bar's 24px, replacing the current --spacing-4 inset and the unpadded padding={0} contract. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Whatever the decision, a few fixes are needed:
- Because the floored inset is also published, a lone
Sectionescapes the whole band, so the Showcase, Tall Sheet, Hug Height and Text Only sheets render exactly as before, with the first line 12-17px under the bar, and the new Chromium spec's at-rest tests fail for them. - Lab's MobilePowerSearch and MobileTokenizer sheets pass
padding={0}with their own top band and now get a second 24px strip. docs/architecture/container-padding.mdand Popover's DEC-8 still state the unfloored inset, andBottomSheet.doc.mjs(line 98), the Container Padding story and a few comments still describe the old float.
[Automated review]
…ection escapes From CodeBunny's review at c65c74a: publishing the floored inset let a lone Section (Showcase, Tall Sheet, Hug Height, Text Only) escape the whole band, so its first line still started 12-17px under the bar. The band under the bar is no longer container padding. The Content area publishes only the block-start padding past it (`max(padding - --spacing-6, 0)`) and applies the band on top (`calc(published + --spacing-6)`), so its applied inset is still max(padding, the bar) and what a lone Section or Layout escapes ends at the band: a lone Section's first line now starts 37px below the bar's top (13px before). Every other edge applies and publishes the same inset. - Lab's MobileTokenizer and MobilePowerSearch sheets (`padding={0}`) no longer double the band: the tokenizer's body keeps its 32px start, and the search sheets' sticky header sits over the band at rest, clearing the bar only once stuck. - component:BottomSheet's inset and compatibility lines, architecture:container-padding, Popover's DEC-8 wording, BottomSheet's doc, the Container Padding story and comments describe the band. - The Chromium spec's at-rest check now includes Hug Height.
|
/approve-spec 812b064 |
There was a problem hiding this comment.
The grab-bar rule is approved for this head and the core change works as described, but a few fixes are needed before it can merge. Please address these; the new head then needs a fresh /approve-spec from an engineering owner:
- The
table-filterandtable-inboxpage templates inpackages/clistill add their own 24px top band inside their bottom sheets (SHEET_TOP_INSETand the composer'spaddingBlockStart={3}), so they now open with a second empty band; drop it as Core and Lab do here, and name the CLI update in the changeset. component:BottomSheetFR4 and its verification row still say the published inset equals the applied padding and that a lone padded Section keeps its geometry, so they need the same band exception as the new Content area inset.- The changeset says default-padding content moves 8 px, but a sheet whose only child is a
Sectionmoves 24 px and grows by the same amount, and the changeset should say so.
[Automated review]
… FR4 states the band exception From CodeBunny's review at 812b064: - The CLI's table-filter and table-inbox page templates reserved their own 24px band inside their sheets (`SHEET_TOP_INSET`, the composer's `paddingBlockStart={3}`); the sheet keeps that band now, so they drop it and table-filter's sheets open on the same line as before. - component:BottomSheet FR4 and its verification row state the block-start exception: the Content area publishes only the padding past the band, so a child escapes the padding but never the band. - The changeset says a sheet whose only child is a Section moves that Section 24px and grows by the same amount, and names the CLI update.
|
/approve-spec 1c54a3a |
There was a problem hiding this comment.
Thanks: the grab-bar rule is approved for this head and works as described, with resting content now starting below the bar and scrolled content still passing beneath it. One record fix is needed before merge: the INV2 verification row in docs/architecture/container-padding.md still fails the Content area when it publishes a different block-start inset than it applies, which this change now does by design, so it needs the same band exception you added to FR4's row. Any new commit also needs a fresh /approve-spec <full head SHA> from an engineering owner, which you can record yourself.
[Automated review]
…w state the block-start band exception From CodeBunny's review at 1c54a3a: architecture:container-padding's host-side rule and its INV2 verification row for BottomSheetPanel still required the published block-start inset to equal the applied one; both now name the exception the Content area inset decides (the block start publishes only the padding past the grab bar's band).
…Tokenizer sheets stop doubling the band FR4 again says the Content area publishes only the block-start inset past the grab bar's band. PowerSearch's sticky sheet header rises into the band at rest and keeps its own padding, so it clears the bar at rest and while stuck. Tokenizer's sheet body keeps its first row --spacing-8 below the sheet's top. The changeset names both sheets.
|
/approve-spec da92a84 |
There was a problem hiding this comment.
Changes requested. An engineering owner approved the grab-bar band rule for this head, and in Chromium resting content now starts below the bar in every BottomSheet while scrolled content still passes beneath it. FR4, the Tokenizer sheet, PowerSearch's value step and the Chromium spec's fit check are fixed. One fix remains:
- PowerSearch's Filters and Add filter sheets now paint their header over the top 24px of the list, because their wrapper's
overflow: hiddenholds the sticky header at its top despite the new negative margin (PowerSearchBottomSheet.tsx:386-401), so the Filters heading moves from 27px to 51px below the bar, the first filter row is clipped and Add filter's "General" heading is hidden; dropping the negative margin and the header's top padding in those two sheets fixes it and makes the changeset's "PowerSearch ... look the same" true.
Non-blocking: two comments still say the block start is applied and published alike (BottomSheetPanel.test.tsx:949-951, BottomSheetPanel.tsx:483-484).
[Automated review]
…ar band The Filters and Add filter sheets hold their header inside a wrapper that clips its overflow, so a sticky header there stays at the wrapper's top and the negative margin pushed it over the list. Those two headers drop the margin and their top padding: the sheet's band alone clears the bar. The value sheet, which scrolls its whole content, keeps both. Two BottomSheet comments now say the block start publishes only the padding past the band.
|
/approve-spec 71bdae5 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is still a draft, and it runs once the pull request is marked ready for review. The grab-bar band rule has an engineering owner's approval for this head, and in Chromium resting content now starts below the bar in every sheet measured while scrolled content still passes beneath it. PowerSearch's Filters and Add filter sheets are back to their base layout, with the header no longer covering the first row.
Optional follow-ups, none blocking:
- INV11 in
docs/architecture/container-padding.mdstill calls a published/applied mismatch a conformance gap, which the new BottomSheet block-start exception now makes intended. - The new comment at
PowerSearchBottomSheet.tsx:402-406could be shorter (suggestion inline).
[Automated review]
| // the sheet's top. The header rises into the band that the sheet keeps | ||
| // under its grab bar and keeps its own padding there, so it clears the bar | ||
| // at rest and while stuck. The Filters and Add filter sheets do not scroll |
There was a problem hiding this comment.
Non-blocking (comment style): this sentence runs 30 words and covers two topics. A shorter version: "Only the value sheet scrolls its header to the sheet's top. That header rises into the grab-bar band and keeps its own padding, so it clears the bar at rest and while stuck."
…-sheet-clears-grab-bar
|
/approve-spec 84b659e |
There was a problem hiding this comment.
Approved pending CI: one WebKit interaction shard failed and needs a rerun, and one unit-test shard is still running.
An engineering owner approved the grab-bar band rule for this exact head, and the change does what it says: in Chromium at 390×844 a default sheet's first line moves from 16px to 24px below the grab bar's top, a sheet whose only child is a Section from 17px to 41px, and the DropdownMenu sheet's heading from 17px to 25px, while scrolled content still passes under the bar. The merge of main brings in nothing that touches the band, and the BottomSheet, menu, picker, PowerSearch, Tokenizer, Popover, Layout and CLI template suites pass on this head. The WebKit failure is a touch-pacing stall (TouchPageStallError) in the unchanged BottomSheetDetent test "a softer downward flick from the tall detent lands on the half detent"; this change adds no code on the drag path, and every Chromium interaction shard passes.
Non-blocking:
docs/architecture/container-padding.mdINV11 still calls any published/applied mismatch a conformance gap, while the host-side rule now makes BottomSheet's block-start split intended; naming the exception there would keep the record consistent.- The earlier comment-length suggestions on
PowerSearchBottomSheet.tsxandmenuBottomSheet.stylex.tsstill apply.
[Automated review]
…-sheet-clears-grab-bar
|
/approve-spec 584b789 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is still a draft; it runs once the pull request is marked ready for review.
An engineering owner approved the grab-bar band rule for this exact head, and the change does what it says: in Chromium at 390×844 a default sheet's first line moves from 16px to 24px below the grab bar's top, a sheet whose only child is a Section from 17px to 41px, and the DropdownMenu sheet's heading from 17px to 25px, while the date and time picker sheets look exactly as on main. The merge of main brings in nothing that touches the band, and the BottomSheet, menu, picker, PowerSearch, Tokenizer, Popover, Layout and CLI template suites pass on this head.
Non-blocking:
docs/architecture/container-padding.mdINV11 still calls any published/applied mismatch a conformance gap, while the host-side rule now makes BottomSheet's block-start split intended; naming the exception there would keep the record consistent.- The earlier comment-length suggestions on
PowerSearchBottomSheet.tsxandmenuBottomSheet.stylex.tsstill apply.
[Automated review]
User impact
A person opening a bottom sheet on a phone saw the top of its first line drawn through the grab bar. The bar floats over the content (24 px, opaque behind the pill, fading out below it). At the default padding the first line started inside the fade, and in a Popover's sheet (12 px padding) it started under the opaque part, so the line's top was cut.
Now, at rest, the content starts below the bar whatever the sheet's
padding. Scrolled content still passes beneath the bar.Problem and solution fit
max(padding, --spacing-6), the bar's height. The band under the bar isn't container padding: the sheet publishes only the padding past it (max(padding - --spacing-6, 0)) and applies the band on top. A loneSectionorLayoutthat escapes its padding therefore still starts below the bar. Every other edge applies and publishes the same inset. It's the content box's own padding, so it scrolls away with the content.table-filterandtable-inboxtemplates drop theirs, so the band isn't doubled. PowerSearch's value sheet, which scrolls its whole content, has a sticky header that rises into the band at rest and keeps its own padding, so it clears the bar at rest and while stuck. Its Filters and Add filter sheets don't scroll their header, so the band alone clears the bar there; in Chrome at 390×844, every heading and row in those two sheets sits at the same offset as on main. Tokenizer's sheet body keeps its first row--spacing-8below the sheet's top, as before. (Lab's MobileTokenizer and MobilePowerSearch, which this touched before, are gone from main.)padding={0}sheets: The touch date, date-time and time pickers drop their 24 px top padding, so they look the same. The DropdownMenu and ContextMenu sheet content drops its 16 px top, so the first row sits 8 px lower, below the bar.component:BottomSheet's Content area inset and compatibility line record the rule; the doc andpaddingJSDoc describe it. Changeset:[feat](spec:AST-017FR7), a visible layout change.Credit: vjeux's #8514 found and measured the problem and proposed shortening the fade instead. This change takes the other direction its body lists (reserving the band), and its Chromium spec is adapted from #8514's measurements (co-authored).
Before and after
Chromium, 390×844 at 3×, the sheet's top 120 px. Left: before. Right: after.
A sheet whose only child is a
Section(Showcase, Tall Sheet, Hug Height and Text Only in Storybook). The Section escapes the sheet's padding but not the band:Core's own
padding={0}sheets, which no longer reserve the band themselves:Measured (first line's top, from the bar's top; the bar is 24 px):
Evidence
component:BottomSheetFR4 states the block-start exception: the Content area appliesmax(inset, --spacing-6)and publishes onlymax(inset - --spacing-6, 0).BottomSheetPanel.test.tsx's padding tests pin the applied block-start inset tomax(<published padding>, --spacing-6)for the default chain,padding={0}andpadding={2}. All three fail on main.BottomSheetGrabBar.a11y.chromium.spec.ts. At rest the first line starts below the whole bar (showcase, tall-sheet, text-only). Sheets whose content fits still don't scroll; the Nested Popover sheet, now detent-sized on main, is left out of that check. Scrolled content passes under the bar.check:knowledgeand the changeset check pass.git merge-treeagainst each head).Writing rubric results