diff --git a/src/presentation/layouts/app-shell.tsx b/src/presentation/layouts/app-shell.tsx index 1c698e2e..bf59bebe 100644 --- a/src/presentation/layouts/app-shell.tsx +++ b/src/presentation/layouts/app-shell.tsx @@ -3,11 +3,7 @@ import { NavLink, Outlet, useLocation } from "react-router-dom"; import type { SessionState } from "../../application/ports/in/application-api.ts"; import { normalizeColorSchemePreference } from "../../application/policies/color-scheme.ts"; -import { - NAVIGATION_ROUTES, - ROUTE_FEATURE_OWNER, - routePath, -} from "../../features/installed-feature-contracts.ts"; +import { routePath } from "../../features/installed-feature-contracts.ts"; import { Button, Drawer, @@ -26,6 +22,7 @@ import { useSessionAction, } from "../providers/session-provider.tsx"; import { useTheme } from "../providers/theme-provider.tsx"; +import { activeNavigationRoutes } from "../routes/navigation-policy.ts"; const SESSION_MESSAGE_KEYS = Object.freeze({ authenticated: "shell.session.authenticated", @@ -196,10 +193,9 @@ function PrimaryNavigation({ const runtime = useApplicationRuntime(); // §3.5. A feature the runtime document disabled does not advertise itself. // The router refuses its routes too, so this is presentation, not the switch. - const routes = NAVIGATION_ROUTES.filter((definition) => { - const owner = ROUTE_FEATURE_OWNER[definition.routeId]; - return owner === undefined || runtime.isFeatureActive(owner); - }); + const routes = activeNavigationRoutes((featureId) => + runtime.isFeatureActive(featureId), + ); return (