Files
archie/ui/src/components/topbar/ThemeToggle.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

26 lines
892 B
Vue

<script setup lang="ts">
import { computed } from "vue";
import { Moon, Sun } from "@lucide/vue";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { theme, toggleTheme } from "@/lib/theme";
const label = computed(() => (theme.value === "dark" ? "Switch to light" : "Switch to dark"));
</script>
<template>
<Tooltip>
<TooltipTrigger as-child>
<button
type="button"
class="text-muted-foreground hover:text-foreground hover:bg-accent focus-visible:ring-ring/50 inline-flex size-8 items-center justify-center rounded-md outline-none focus-visible:ring-[3px]"
:aria-label="label"
@click="toggleTheme()"
>
<component :is="theme === 'dark' ? Moon : Sun" :size="16" />
</button>
</TooltipTrigger>
<TooltipContent :side-offset="8">{{ label }}</TooltipContent>
</Tooltip>
</template>