From ccb36a1ca991ab2ff1775e0a47a00654f241bf4b Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Fri, 27 Nov 2026 16:32:06 +1100 Subject: [PATCH] refactor(ui): drive sidebar and topbar breadcrumbs from file-based routes --- ui/src/App.vue | 28 +++++++++----------- ui/src/lib/nav-icons.ts | 4 ++- ui/src/lib/nav.ts | 2 +- ui/src/pages/controls/action-types/[id].vue | 2 +- ui/src/pages/controls/action-types/index.vue | 2 +- ui/src/pages/controls/guards/[id].vue | 2 +- ui/src/pages/controls/guards/index.vue | 2 +- 7 files changed, 20 insertions(+), 22 deletions(-) diff --git a/ui/src/App.vue b/ui/src/App.vue index 1f6e7d094..51aeda7ff 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -37,12 +37,16 @@ const route = useRoute(); const router = useRouter(); const workflowsPage = computed(() => route.name === "workflow"); const hidden = computed(() => hiddenPaths(session.sections)); -const sectionLink = computed(() => ({ - workflow: "/workflows", - run: "/runs", - "controls-guard": "/controls/guards", - "controls-action-type": "/controls/action-types", -})[String(route.name)]); +const sectionLink = computed(() => + route.meta.nav === false && typeof route.meta.navPath === "string" + ? route.meta.navPath + : undefined, +); +const detailCrumb = computed(() => { + if (route.meta.nav !== false || !("id" in route.params) || !route.params.id) return ""; + const id = String(route.params.id); + return route.name === "run" ? id.slice(0, 8) : id; +}); // The redirect below must not run during the router's first navigation: route // is still the start location then, so a deep link would be replaced by the // landing page before it resolves. @@ -127,17 +131,9 @@ watch(() => accounts.status?.user, (user) => { -