Navigation Ownership

Each application variant has its own route registry.

Where routes are registered

Variant Router Root and shell Apps destination
mogo-src createHashRouter when VITE_MOGO_HASH_ROUTER is '1'; otherwise createBrowserRouter / → MogoHomePage; /project → MainLayout /apps → AppsHubPage
Mogo Robot/src createHashRouter / → MainLayout /apps → AppsHubPage
Mogo Robot/Mogo Moving createBrowserRouter / → MainLayout /apps → AppsHubPage

In mogo-src, App passes appRoutes to its router factory. The two Mogo Robot variants each provide their own router to RouterProvider.

[!NOTE] The source identifies each variant’s router and routes, but not which one a particular installed build selects. Verify the target entrypoint before changing navigation.

In mogo-src, /project resolves to MainLayout, which renders Navbar. Its workspace-route buttons call navigate with the selected route; its landing-section buttons call scrollTo with the selected section ID. These are different actions: route navigation versus scrolling within the landing page. PageHeader also varies by application: for example, Mogo Robot/src dispatches its Apps menu choice through goApps, while Mogo Robot/Mogo Moving sends Back to /.

WorkspaceShell selects a child-specific link list for the child area and the parent/control list otherwise; this visible-list selection is separate from route-access enforcement.

Role checks are selective

In mogo-src/app/routes.tsx, the lazy-page wrapper places AccessGuard around page content. The guard checks the current path against a specific role map and, for mapped paths, fetches the session. It shows a loading fallback while that check is pending, renders for an allowed role, or redirects to /login with the current pathname and query string as returnTo when no allowed role is found.

The map requires admin for /idea-feedback, /control, and paths beginning /care/control; parent or admin for /parent; and child, parent, or admin for /child and /today. Paths that do not match those predicates pass through the guard without a role check. Separately, createParentDashboardRoutes registers /care/parent to ParentWorkspacePage, and appRoutes includes those returned routes; registration does not add that path to the role map.

[!WARNING] A parent-oriented route name or sign-in link is not evidence of route-access enforcement. For another destination, inspect the target route or page caller for its session/role predicate and redirect behavior.

Native Apps forwarding

flowchart TD
    subgraph current["Current Expo navigation"]
        appsRoute["Current /apps route"] -->|"redirects to /web with path=/apps"| webRoute["Native WebView route"]
        webRoute -->|"retrieves the optional path parameter"| pathParam["Optional path parameter: /apps"]
        pathParam -.->|"whether it selects the loaded SPA route in a target build is unresolved"| webview["Loaded SPA route"]
    end
    subgraph legacy["Legacy callback/helper declaration; not used by current Apps route"]
        screen["AppsHubScreen callback"] -->|"passes selected route"| helper["openWebApp"]
        helper -->|"only when destination is Apps"| replacement["Local route replacement"]
    end

The separate isNativeHubRoute helper classifies the Apps destination as a native-hub route.

[!NOTE] The native Web route retrieves the optional path parameter, and its source uses that parameter when constructing the WebView URI and syncing the SPA hash. Whether this selects the intended SPA screen in a particular installed build remains unresolved; verify the target build before relying on the route. Whether callers use isNativeHubRoute across entrypoints or installed builds is also unresolved; inspect its caller and the target entrypoint/build before relying on it for reachability.