Files
archie/ui/src/components/topbar/NavGroup.vue
T
sam 2bddb9f36a feat(webui): grouped topbar navigation, built from components
Five top-level items instead of eleven flat ones: Dashboard as a link, then
Work, Agent, Events and System as dropdowns, with each item's one-line
description on a hover tooltip. Configuration dissolves into /system/{status,
appearance,tasks,models,repos,advanced} and /settings redirects to the first of
them, so existing bookmarks still land somewhere. Logs gets a nav entry for the
first time.

The bar is composed from named components rather than one file: Brand (Logo,
BrandName), Nav (NavTrigger, NavGroup, NavItem), SearchBar, SupportLink,
ThemeToggle, ProfileDropdown. The nav model reads the route table, so a route
and its nav entry cannot disagree, and a group whose every child is gated off
is dropped while a group left with one child stays a dropdown.

The Go page registry moves with it, which its parse-the-route-table test
enforces.
2026-09-20 18:46:11 +10:00

27 lines
917 B
Vue

<script setup lang="ts">
import { ChevronDown } from "@lucide/vue";
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
import type { NavEntry } from "@/lib/nav";
import NavItem from "./NavItem.vue";
import NavTrigger from "./NavTrigger.vue";
const props = defineProps<{ label: string; items: NavEntry[]; activePath: string }>();
const holds = (path: string) => props.activePath === path;
</script>
<template>
<DropdownMenu>
<DropdownMenuTrigger as-child>
<NavTrigger :current="items.some((item) => holds(item.path))">
{{ label }}
<ChevronDown :size="14" class="opacity-60" />
</NavTrigger>
</DropdownMenuTrigger>
<DropdownMenuContent align="start" class="w-52">
<NavItem v-for="item in items" :key="item.path" :entry="item" :current="holds(item.path)" />
</DropdownMenuContent>
</DropdownMenu>
</template>