VAPP-4: Replace router debug route dump with friendly 404 page for unmatched paths #7
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/not-found-page-vapp-4"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
VAPP-4: Replace router debug route dump with friendly 404 page for unmatched paths
Any URL that matches no defined route now renders a friendly "Page not found" page inside the normal app
Layout(sidebar and topbar stay visible and clickable), instead of the Dioxus router's built-in failure renderer dumping "Failed to parse route ... Attempted Matches: ..." as raw text on a black page.Changes
NotFound { segments: Vec<String> }variant to theRouteenum insrc/routes.rs, declared last and under#[layout(Layout)]so it renders inside the app chrome. A one-linerNotFoundwrapper component delegates toNotFoundPage, matching the existing per-route pattern.src/components/pages/not_found.rswithNotFoundPage(segments: Vec<String>): reconstructs the attempted path as/{segments.join("/")}, shows it in monospace, renders heading "Page not found" and body copy, and offers aLink { to: Route::Dashboard {} }styled asvc-btn. Uses thevc-card/vc-card-headeridiom fromsettings.rs.src/components/pages/mod.rsand importedNotFoundPageinsrc/routes.rs.Route::NotFound { .. }arm totopbar::title_forso the title match stays exhaustive (topbar shows "Page not found").Verification
cargo check(default) passes.cargo check --features serverpasses.cargo check --target wasm32-unknown-unknownpasses.just build-csssucceeds.All nine existing routes are unchanged.
#VAPP-4
Add a final catch-all `NotFound { segments: Vec<String> }` variant to the `Route` enum under `#[layout(Layout)]`, so any URL that matches no defined route renders a friendly "Page not found" page inside the normal app shell (sidebar and topbar stay visible and navigable) instead of the Dioxus router's debug route dump. The new `NotFoundPage` (`src/components/pages/not_found.rs`) reconstructs the attempted path, shows it in monospace, and offers a "Go to Dashboard" link styled as `vc-btn`, following the existing `vc-card` page idiom. `topbar::title_for` gains a matching arm so the match stays exhaustive. #VAPP-4