Repository navigation
feat(lab): Drawer is a container, like Dialog - #6885
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Thanks for the detailed proposal and evidence. The implementation reads cleanly and the behavior checks out — the default drawer is unchanged, an explicit padding value and a theme's drawer padding both reach the content area, and bleed children and Layout compositions align as described.
Approval needs a maintainer decision first: the current container-padding architecture does not yet admit Drawer as a container, and the Drawer record is still a draft, so a maintainer needs to provide or identify the governing spec for this addition (for example, approving the proposed container direction in the Drawer record and/or updating the container-padding record to list Drawer). The open choices you flagged — the default inset, the loose DrawerHeader composition under nonzero padding, and safe-area handling with an explicit padding — can be settled in that same decision.
No code changes are being requested for the missing spec itself. Once a maintainer settles the governing spec, this is ready for a final look.
[Automated review]
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression24 of 442 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 4 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
276bf55 to
6ba2ac7
Compare
There was a problem hiding this comment.
Thanks for the detailed proposal and evidence. The implementation reads cleanly and the behavior checks out — the default drawer is unchanged, an explicit padding value and a theme's drawer padding both reach the content area, and bleed children and Layout compositions align as described.
Approval needs a maintainer decision first: the current container-padding architecture does not yet admit Drawer as a container, and the Drawer record is still a draft, so a maintainer needs to provide or identify the governing spec for this addition (for example, approving the proposed container direction in the Drawer record and/or updating the container-padding record to list Drawer). The open choices you flagged — the default inset, the loose DrawerHeader composition under nonzero padding, and safe-area handling with an explicit padding — can be settled in that same decision.
No code changes are being requested for the missing spec itself. Once a maintainer settles the governing spec, this is ready for a final look.
[Automated review]
044af64 to
846bb3d
Compare
There was a problem hiding this comment.
Thanks for the detailed proposal and evidence. The behavior checks out as described: with nothing set, the drawer content is now inset by 16px like Dialog (a Layout inside keeps one content line, so the header isn't padded twice), an explicit padding and a theme's drawer padding both reach the content area, and a full-bleed Divider compensates against the published inset.
Approval needs a maintainer decision first: the current container-padding architecture doesn't yet admit Drawer as a container, and the Drawer record is still a draft, so a maintainer needs to provide or identify the governing spec for this addition — approving the proposed FR16/DEC-2 direction, including the new --spacing-4 default in place of the full-bleed default and the safe-area handling under an explicit padding, and/or updating the container-padding record to list Drawer. No code changes are being requested for the missing spec itself.
One correction to make in the meantime: three strings in the Drawer docs (the content-area anatomy line and its translation, and the compact description) still say the content area is unpadded by default — they should state the new --spacing-4 default, matching the padding prop entry in the same file.
Once the governing spec is settled and those strings are updated, this is ready for another look.
[Automated review]
846bb3d to
66e9d9b
Compare
|
Looked at 66e9d9b: this push moves the two sandbox audit drawers to the
[Automated review] |
The scrolling content area becomes a container publisher with Dialog's
contract: a padding prop on Dialog's spacing-step scale, theme padding on
'drawer' expanded to --astryx-drawer-padding* container tokens, and a
--spacing-4 default shared by the edge and Layout inset chains, exactly as
in Dialog. Headers compose as in Dialog: DrawerHeader sits in a Layout
header slot, and the Layout redistributes the inset to its regions, so the
header lines up with the body and is not inset twice. The docsite blocks,
stories, and doc snippets move to that composition, and padding={0} keeps a
full-bleed content area.
The two sandbox audit drawers still passed hasCloseButton, which #6877
removed, so their non-modal panels had no visible close button. They now
compose DrawerHeader with onOpenChange in a Layout header slot, keep the
title as the focus target on open and on row switch, and reset the
LayoutContent scroller when the selected row changes.
The block-end edge adds the home-indicator safe area on top of the
container inset in every mode, and the content area now paints the surface
so a dark-mode inset ring in --shadow-high no longer changes the panel edge
partway down (the #5305 treatment).
Core gains the drawer chains in container.stylex.ts and a drawer entry in
derivedVarRegistry (doc source of truth lives in packages/lab). Lab reads the
explicit-padding lowering maps from the existing
@astryxdesign/core/Layout/padding.stylex subpath, so the core root exports
are unchanged.
Drawer.spec.md records the contract as DEC-2 (owner decision) and FR16.
66e9d9b to
917be8a
Compare
|
Looked at 917be8a. The three code and record items from the earlier notes are resolved: What still needs the maintainers is unchanged: the Drawer record is a draft ( [Automated review] |
There was a problem hiding this comment.
Thanks for the detailed proposal and evidence. The behavior checks out as described: with nothing set, the drawer content is now inset by 16px like Dialog (a Layout inside keeps one content line, so the header isn't padded twice — the migrated showcase renders identically before and after), an explicit padding and a theme's drawer padding both reach the content area, a full-bleed Divider compensates against the published inset, and the sandbox audit drawers have their close button back through the new composition.
Approval needs a maintainer decision first: the current container-padding architecture doesn't yet admit Drawer as a container, and the Drawer record is still a draft, so a maintainer needs to provide or identify the governing spec for this addition — approving the proposed FR16/DEC-2 direction, including the new --spacing-4 default in place of the full-bleed default and the safe-area handling under an explicit padding, and/or updating the container-padding record to list Drawer. No code changes are being requested for the missing spec itself, and no other defects were found in this round.
Once the governing spec is settled, this is ready for another look.
[Automated review]
User need
Drawer is a full-bleed panel. Dialog is a container: its content is inset by
--spacing-4(16px) by default, by itspaddingprop, or by a theme'sdialogpadding, and aLayoutinside lines upDialogHeader, the body, and the footer on one content line with full-bleed dividers. Drawer has none of this, so there is no Drawerpaddingprop and no theme padding, and aLayoutinside a Drawer doesn't line up the way it does inside a Dialog. This continues aligning Drawer with Dialog after #6877.This PR also fixes a dark-mode edge bug a designer reported: the panel's edge changes partway down. The fix is on the same element as the container padding, so it ships here.
Problem and solution fit
padding?: SpacingStepprop on Dialog's spacing scale.paddingondrawerbecomes--astryx-drawer-padding*variables.--spacing-4(16px), as in Dialog.padding={0}gives a full-bleed content area.DrawerHeadergoes in aLayoutheader slot, the body inLayoutContent, and actions inLayoutFooter. TheLayoutcancels the drawer's inset and re-applies it to each region, so the header lines up with the body and isn't padded twice. The six docsite examples, the Storybook stories, and the doc snippets move fromDrawerHeader+Section padding={4}to that composition.hasCloseButton, which feat(lab): align Drawer dismissal and close control with Dialog #6877 removed, so their non-modal panels had no visible close button (and the sandbox typecheck failed onmain). They now composeDrawerHeaderwithonOpenChangein aLayout, keep the title as the focus target on open and on row switch, and reset theLayoutContentscroller when the selected row changes.--color-background-surface. The bundled themes add a faint inner highlight to--shadow-highin dark mode. An opaque child such asSectionpainted over it beside the content, so the panel edge changed where the content ended. Painting the surface on the content area hides the highlight evenly and leaves the attached-side border as the one edge. BottomSheet already does this (fix(BottomSheet): give the sheet one uniform edge against the scrim #5305).Current specification
architecture:container-padding(current) defines the container protocol. Drawer joins it exactly as Dialog does. That record still lists Dialog, Card, Section, and ScrollableArea as containers; adding Drawer to it is left to a separate record PR, the same split as BottomSheet's.component:Drawer(draft) records the contract as DEC-2 (owner decision: Dialog's contract, including the--spacing-4default and theLayoutheader composition) and FR16.Public delta and caller burden
Drawergainspadding?: SpacingStep. Themecomponents.drawer.base.paddingnow pads the content area instead of being ignored.paddingnow gets a 16px inset. Drawer is unreleased Lab, so there's no codemod. Callers either compose withLayoutas Dialog does, or passpadding={0}to stay full-bleed.drawerpadding variable chains incontainer.stylex.ts, ending at--spacing-4like Dialog's;drawerentry inderivedVarRegistry;@astryxdesign/core/Layout/padding.stylexsubpath.Open questions (not blocking)
padding: this PR adds the safe area on top ofpaddingin every mode. Dialog fullscreen instead lets an explicit value replace it.DrawerHeadersupply a default focus target and name the drawer, asDialogHeaderdoes? Carried over from feat(lab): align Drawer dismissal and close control with Dialog #6877.Evidence
DrawerHeadertitle sits 17px from the edge (16px plus the 1px attached-side border), not 33px.Layoutinside a Drawer: title inset 17px, the same as in Dialog plus the border.padding={6}: 24px inset, and anisFullBleedDivider spans the full panel line.drawerpadding of 24px: it reaches the content area without a prop.modal-close-visibility.js) passes for the modal, non-modal, and stacked stories.--spacing-4chain on the edges and the Layout insets;Scope
Testing
useSheetGestures"promotes a pull-down from the top of a nested scroller") fails the same way on unmodifiedmain.themingTargets: 421 passed.pnpm -F @astryxdesign/docsite test: 580 passed, 6 skipped. The docsite, Storybook, and Lab docs typechecks pass.pnpm build, docsite generation,pnpm check:knowledge,pnpm check:repo, and the Storybook build pass.hasCloseButtonerrors; the one remaining error (doc-preview/SectionRenderer.tsx) is unrelated and also fails onmain.Rebased onto
main(now 9613feb). #6883 (BottomSheet container) is merged; its entries and Drawer's sit side by side incontainer.stylex.tsanddefineTheme.test.ts.