Skip to content

refactor(site): reimplement CreateTemplatePage build logs drawer on Base UI - #28010

Closed
jakehwll wants to merge 2 commits into
mainfrom
jakehwll/DEVEX-251-drawer-base-ui
Closed

jakehwll wants to merge 2 commits into
mainfrom
jakehwll/DEVEX-251-drawer-base-ui

Conversation

@jakehwll

Copy link
Copy Markdown
Contributor

🤖 This PR was written by Coder Agents on behalf of Jake Howell.

Replaces the unmaintained vaul dependency with a shared Drawer primitive built on Base UI's Dialog, then migrates the Create Template BuildLogsDrawer onto it. This is an alternative to #27798 that answers the review question about whether Base UI can cover this one drawer use case.

What changed

  • Adds @base-ui-components/react and drops vaul.
  • New site/src/components/Drawer/Drawer.tsx keeps the shadcn-derived public API (Drawer, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription) but is implemented on Base UI's Dialog parts.
  • direction (top | bottom | left | right) is preserved via context, with slide/fade animations driven by tailwindcss-animate off Base UI's data-open/data-closed attributes.
  • BuildLogsDrawer keeps the 800px desktop panel and min(800px, 100%) mobile clamp.
  • Storybook stories exercise open and close paths via play functions, covering the controlled close callback.

Notes for reviewers

  • Base UI composes via the render prop rather than Radix/Vaul's asChild, so DrawerClose/DrawerTrigger consumers use render={<Button .../>}.
  • Base UI's Dialog is modal by default (focus trap + scroll lock) and closes on outside click / Escape, matching the previous behavior.
Decision log
  • Why Base UI Dialog, not a bespoke component: Base UI has no dedicated drawer, but its Dialog provides the portal, backdrop, focus management, and controlled open state a drawer needs. Layering slide-in styling on top keeps the same footprint shadcn's drawer had, without a maintenance-orphaned dependency.
  • API parity: Kept every exported part name so the migration is a drop-in for the existing BuildLogsDrawer and any future consumers, aside from the asChild -> render composition change that Base UI mandates.
  • Animations: Reused tailwindcss-animate (already in the repo) and mapped shadcn's data-[state=open|closed] selectors onto Base UI's data-open/data-closed, so the visual behavior is unchanged.
  • Direction: Implemented via React context + a data-drawer-direction attribute on the popup, replacing Vaul's automatic data-vaul-drawer-direction.
  • Validation: tsc, Biome, and the Drawer + BuildLogsDrawer Storybook interaction tests all pass locally.

Related: #27798 · DEVEX-251

Replaces the unmaintained vaul dependency with Base UI's Dialog primitive, keeping the same shadcn-derived public API. Adds Base UI, drops vaul, and switches consumers/stories to the render prop.
@linear-code

linear-code Bot commented Aug 11, 2026

Copy link
Copy Markdown

DEVEX-251

@jakehwll

Copy link
Copy Markdown
Contributor Author

Meh, Radix can do this just fine, we're writing our own Vaul here but atleast we own it.

@jakehwll jakehwll closed this Aug 11, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant