From a5ba9739740116efcdfe9ebf8fb983968905c3f8 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Sun, 19 Jul 2026 12:22:15 -0400 Subject: [PATCH] Lean build: gate Displays links by staged route, not plugin-enabled state The Displays section is hardcoded in AppLayout (not plugin nav). TV Slideshow (/tv, slides) had no gate at all and Parts Kiosk (/parts-kiosk, printedparts) was gated on isPluginEnabled - which a registry copied from a full site reports true even when the plugin was never staged, so both showed on a lean site and dead-ended blank. Now each Displays link (Shopfloor, TV Slideshow, Parts Kiosk) is gated by whether its route is registered in this build (router.getRoutes), and the Displays header hides when none are present. Route existence is the true 'is it in this build' test. --- frontend/src/views/AppLayout.vue | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/AppLayout.vue b/frontend/src/views/AppLayout.vue index 24f0cd6..dd247a7 100644 --- a/frontend/src/views/AppLayout.vue +++ b/frontend/src/views/AppLayout.vue @@ -24,10 +24,10 @@ - - Shopfloor Dashboard - TV Slideshow - Displays + Shopfloor Dashboard + TV Slideshow + Parts Kiosk Settings @@ -111,11 +111,20 @@ import { currentTheme, toggleTheme } from '../stores/theme' import { dashboardApi, notificationsApi } from '../api' import { getFacilityName, getSiteLogo, getServicenowUrls } from '../utils/siteSettings' import { withBase } from '../utils/basePath' -import { isPluginEnabled } from '../composables/enabledPlugins' const router = useRouter() const route = useRoute() const authStore = useAuthStore() + +// The Displays links are hardcoded (not plugin-driven nav), so gate each by +// whether its route was actually staged into THIS build. A lean site without +// slides / printedparts must not show a TV Slideshow / Parts Kiosk link that +// dead-ends on a blank page. Route existence is the true "is it in this build" +// test - more reliable than plugin-enabled state, which a copied registry can +// report for a plugin that was never staged. +const stagedRoutePaths = new Set(router.getRoutes().map(r => r.path)) +const hasRoute = (path) => stagedRoutePaths.has(path) +const showDisplays = ['/shopfloor', '/tv', '/parts-kiosk'].some(hasRoute) const routeViewKey = computed(() => route.path.startsWith('/settings') ? '/settings' : route.path )