refactor(chrome): Drawer primitive — unify the 3 edge overlays - #253
Closed
catomean wants to merge 1 commit into
Closed
refactor(chrome): Drawer primitive — unify the 3 edge overlays#253catomean wants to merge 1 commit into
catomean wants to merge 1 commit into
Conversation
The edge-overlay sibling of <Modal>. SSOT for right-side sheets and bottom sheets: owns the portal, useFocusTrap (Escape / initial focus / Tab cycle / focus restore), body scroll-lock, and the bg-black/40 backdrop-blur-xs scrim. - components/ui/Drawer.tsx — new. side='right'|'bottom'; isOpen/onClose/ ariaLabel; className (panel size) + rootClassName (viewport gating). - MobileMenu -> Drawer side=right rootClassName=xl:hidden (scaffolding extracted verbatim from the reference impl). - MessageSidebar -> Drawer side=right. GAINS focus-trap, scroll-lock, Escape, click-to-close; drops deprecated bg-opacity-50. - DashboardMobileNav sheet -> Drawer side=bottom rootClassName=lg:hidden; removes its duplicated createPortal + useFocusTrap + scroll-lock. Docs: CLAUDE.md chrome table gains Drawer/Modal rows; deferred note replaced. verify green (typecheck, lint 0 err). Browser-verified: mobile menu opens via Drawer, Escape closes, scroll-lock applies then releases, no console errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
|
Shipped to main via fast-forward (rebased onto the current main atop #252). Live + prod-verified. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #251 (base
refactor/chrome-ssot). This is the deferred follow-up: the shared<Drawer>overlay primitive.What
components/ui/Drawer.tsx— the edge-anchored sibling of<Modal>. One SSOT for right-side sheets and bottom sheets. It owns the parts that were hand-rolled (and drifting) in three places: the portal,useFocusTrap(Escape / initial focus / Tab cycle / focus restore), body scroll-lock, and thebg-black/40 backdrop-blur-xsclick-to-close scrim.API:
isOpen/onClose/side='right'|'bottom'/ariaLabel,className(panel size),rootClassName(viewport gating likexl:hidden).Migrated
MobileMenu<Drawer side="right" rootClassName="xl:hidden">— scaffolding extracted verbatimMessageSidebarbg-opacity-50<Drawer side="right">— gains all of it; deprecatedbg-opacity-50goneDashboardMobileNavsheetcreatePortal+useFocusTrap+ scroll-lock<Drawer side="bottom" rootClassName="lg:hidden">— duplication removed (also drops asetState-in-effectlint warning)Verification
typecheckclean ·lint0 errors.Docs
CLAUDE.md chrome decision-table gains
Drawer+Modalrows; the "deferred drawer" note is replaced with the Drawer rule.🤖 Generated with Claude Code