From f86f20dacfbdc2472c064d589815a17e7a1580b4 Mon Sep 17 00:00:00 2001 From: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Date: Tue, 28 Jul 2026 10:17:59 +0200 Subject: [PATCH] =?UTF-8?q?refactor(chrome):=20Drawer=20primitive=20?= =?UTF-8?q?=E2=80=94=20unify=20the=203=20edge=20overlays?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The edge-overlay sibling of . 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 --- CLAUDE.md | 13 ++- .../dashboard/DashboardMobileNav.tsx | 44 ++----- src/components/layout/MobileMenu.tsx | 71 ++---------- src/components/messaging/MessageSidebar.tsx | 9 +- src/components/ui/Drawer.tsx | 107 ++++++++++++++++++ 5 files changed, 141 insertions(+), 103 deletions(-) create mode 100644 src/components/ui/Drawer.tsx diff --git a/CLAUDE.md b/CLAUDE.md index 3d2642c4f..c65d2a24a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -154,6 +154,8 @@ the primitive, not N components. | Full-bleed page hero (centered) | `` | `components/layout/PageHero.tsx` | a one-off `
` with a bespoke `

` type string | | Page-section vertical rhythm / tinted band | `
` | `components/layout/Section.tsx` | hardcoded `py-16 sm:py-20 …` | | Mobile bottom tab bar (`` | `components/layout/BottomNav.tsx` | a `fixed bottom-0 … flex` `