Summary
The current Drawer component (app_crates/registry/src/ui/drawer.rs) delegates all behavior to the JavaScript implementation in public/app_components/vaul_drawer.js. A full Rust/Leptos port exists in app/src/domain/tests/drawer_tofix.rs but was reverted because it didn't match the JS behavior correctly.
Goal
Make drawer_tofix.rs behavior-identical to the JS implementation, then promote it to replace drawer.rs (eliminating the JS dependency).
What needs fixing
- Verify open/close animation sequencing matches JS (
data-state, hidden, transform transitions)
- Verify drag-to-close behavior (velocity threshold, close threshold, damping on reverse drag)
- Verify overlay opacity animation during drag
- Verify body scroll lock / unlock
- Verify focus trap (Tab/Shift+Tab cycling, focus restore on close)
- Verify wrapper scale animation (
[data-vaul-drawer-wrapper])
- Verify all positions:
Bottom, Left, Right
- Verify both variants:
Inset, Floating
Test demos needed
Add demos in app/src/domain/tests/ that exercise the Rust impl in isolation:
- Basic open/close (bottom)
- Side drawers (left, right) — both inset and floating
- Non-dismissible drawer
- Nested drawer
- Scrollable content (drag prevention while scrolled)
- Focus trap
Files
- Rust port:
app/src/domain/tests/drawer_tofix.rs
- Current JS-backed impl:
app_crates/registry/src/ui/drawer.rs
- Existing demos (using JS impl):
app_crates/registry/src/demos/demo_drawer*.rs
- Test page:
app/src/domain/tests/page_test.rs
Summary
The current
Drawercomponent (app_crates/registry/src/ui/drawer.rs) delegates all behavior to the JavaScript implementation inpublic/app_components/vaul_drawer.js. A full Rust/Leptos port exists inapp/src/domain/tests/drawer_tofix.rsbut was reverted because it didn't match the JS behavior correctly.Goal
Make
drawer_tofix.rsbehavior-identical to the JS implementation, then promote it to replacedrawer.rs(eliminating the JS dependency).What needs fixing
data-state,hidden, transform transitions)[data-vaul-drawer-wrapper])Bottom,Left,RightInset,FloatingTest demos needed
Add demos in
app/src/domain/tests/that exercise the Rust impl in isolation:Files
app/src/domain/tests/drawer_tofix.rsapp_crates/registry/src/ui/drawer.rsapp_crates/registry/src/demos/demo_drawer*.rsapp/src/domain/tests/page_test.rs