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) => {
-
+
- {{ route.params.id }}
-
-
-
- {{ String(route.params.id).slice(0, 8) }}
-
-
-
- {{ route.params.id }}
+ {{ detailCrumb }}
diff --git a/ui/src/lib/nav-icons.ts b/ui/src/lib/nav-icons.ts
index ad0027a33..0a876077f 100644
--- a/ui/src/lib/nav-icons.ts
+++ b/ui/src/lib/nav-icons.ts
@@ -1,4 +1,4 @@
-import { Building2, FileCheck2, LayoutDashboard, ListChecks, Play, Server, ShieldCheck, Workflow, Zap, type LucideIcon } from "@lucide/vue";
+import { Building2, FileCheck2, LayoutDashboard, ListChecks, Play, Server, Shield, ShieldCheck, SlidersHorizontal, Workflow, Zap, type LucideIcon } from "@lucide/vue";
export const navIcons: Record = {
"/": LayoutDashboard,
@@ -8,6 +8,8 @@ export const navIcons: Record = {
"/workflows": Workflow,
"/events": Zap,
"/controls": ShieldCheck,
+ "/controls/guards": Shield,
+ "/controls/action-types": SlidersHorizontal,
"/org": Building2,
"/settings": Server,
};
diff --git a/ui/src/lib/nav.ts b/ui/src/lib/nav.ts
index 206066fec..cd09984af 100644
--- a/ui/src/lib/nav.ts
+++ b/ui/src/lib/nav.ts
@@ -28,7 +28,7 @@ const specs: NavSpec[] = [
{
kind: "group",
label: "Governance",
- sections: [{ paths: ["/controls"] }],
+ sections: [{ paths: ["/controls", "/controls/guards", "/controls/action-types"] }],
},
{
kind: "group",
diff --git a/ui/src/pages/controls/action-types/[id].vue b/ui/src/pages/controls/action-types/[id].vue
index a9d481e62..b4ef80780 100644
--- a/ui/src/pages/controls/action-types/[id].vue
+++ b/ui/src/pages/controls/action-types/[id].vue
@@ -20,7 +20,7 @@ definePage({
meta: {
label: "Action type",
nav: false,
- navPath: "/controls",
+ navPath: "/controls/action-types",
section: "controls",
},
});
diff --git a/ui/src/pages/controls/action-types/index.vue b/ui/src/pages/controls/action-types/index.vue
index 6a887b4e6..b15792827 100644
--- a/ui/src/pages/controls/action-types/index.vue
+++ b/ui/src/pages/controls/action-types/index.vue
@@ -19,7 +19,7 @@ definePage({
meta: {
label: "Action types",
description: "Approval levels each action type has earned.",
- navPath: "/controls",
+ navPath: "/controls/action-types",
section: "controls",
},
});
diff --git a/ui/src/pages/controls/guards/[id].vue b/ui/src/pages/controls/guards/[id].vue
index fcf1096eb..2f8382e47 100644
--- a/ui/src/pages/controls/guards/[id].vue
+++ b/ui/src/pages/controls/guards/[id].vue
@@ -20,7 +20,7 @@ definePage({
meta: {
label: "Guard",
nav: false,
- navPath: "/controls",
+ navPath: "/controls/guards",
section: "controls",
},
});
diff --git a/ui/src/pages/controls/guards/index.vue b/ui/src/pages/controls/guards/index.vue
index ad5df2c55..a8d6a82d1 100644
--- a/ui/src/pages/controls/guards/index.vue
+++ b/ui/src/pages/controls/guards/index.vue
@@ -17,7 +17,7 @@ definePage({
meta: {
label: "Guards",
description: "Judges that inspect actions before they run.",
- navPath: "/controls",
+ navPath: "/controls/guards",
section: "controls",
},
});