Move Sidenav keyboard shortcut into Leptos - #47
Conversation
max-wells
left a comment
There was a problem hiding this comment.
LGTM — clean port of keyboard shortcut into Leptos lifecycle, tests pass, docs/changelog/registry synced.
|
Merged — thanks for the clean port and thorough test coverage @JamesbbBriz! 🙌 |
|
Thanks for the review and merge. I really appreciate it. I would love to keep contributing to Rust/UI. I think it has a lot of potential for admin and internal products, where a Rust frontend and backend fit naturally. My next idea is a backend-agnostic SaaS Admin Shell built from the existing components. It would cover responsive navigation, route-aware page chrome, common page states, and a realistic dashboard, while leaving auth, RBAC, tenancy, billing, and database choices to each application. Most of my work is client delivery, so I want to use this shell in real projects, find the friction, and contribute the fixes upstream. I see the shell as a starting point, not a one-off PR. I hope to keep contributing across the repository, including components, the registry and CLI, and framework-level improvements that make Rust frontend development easier. My preference is to keep the canonical template in this monorepo and expose it through Would you be open to this? If so, I can open a focused design issue before I start coding. |
Problem
The Sidenav keyboard shortcut was owned by a globally loaded JavaScript sidecar. That bypassed the Leptos component lifecycle, queried the DOM globally, and required the application shell to load component-specific JavaScript.
What changed
Ctrl+B/Cmd+Bhandling intoSidenavWrapperRwSignal<bool>throughSidenavContextcontenteditablefocus targetssidenav.jsfile and shell script tagSecurity impact
No network listeners, telemetry, remote state, permissions, or background data transfer were added. The change removes a globally loaded script and scopes the keyboard handler to the mounted component lifecycle.
Verification
A clean standalone consumer fixture containing the distributed Sidenav source also passes
cargo checkwith the dependencies resolved byui initplus the registry-declaredleptos_routerandstrum/derivedependencies.The unrestricted
cargo test --workspacereaches two pre-existingleptos_uidoctest failures (voidreferences an undefinedurl, and onevariantsexample omits the macro import). Both failures are outside this change; all workspace library, binary, integration, and unit tests pass.Fixture and migration notes
Closes #28