ui: drop Graph page, add host switcher to left nav

The System Map subsumes the read-only Graph diagnostic, so remove the page,
its route, and nav entry (the /graph API + useGraph stay — the map and palette
consume them).

Add a host switcher under the sidebar brand: it shows which castle host you're
driving (the is_local node) and, when peers are present, jumps to a peer's
dashboard at castle.<domain>, preserving the current view. Node summaries now
carry gateway_domain so the switcher can build each host's URL.
This commit is contained in:
2026-07-07 06:44:48 -07:00
parent ee7e5cc825
commit c525e154da
7 changed files with 108 additions and 152 deletions

View File

@@ -14,7 +14,6 @@ import {
Server,
Share2,
Map as MapIcon,
Network,
Wrench,
X,
type LucideIcon,
@@ -23,6 +22,7 @@ import { cn } from "@/lib/utils"
import { useEventStream } from "@/services/api/hooks"
import { AssistantDock } from "@/components/AssistantDock"
import { CommandPalette } from "@/components/CommandPalette"
import { HostSwitcher } from "@/components/HostSwitcher"
type NavLeaf = { to: string; label: string; icon: LucideIcon; end?: boolean }
type NavGroup = { label: string; icon: LucideIcon; children: NavLeaf[] }
@@ -42,7 +42,6 @@ const NAV: (NavLeaf | NavGroup)[] = [
],
},
{ to: "/programs", label: "Programs", icon: Package },
{ to: "/graph", label: "Graph", icon: Network },
{ to: "/map", label: "System Map", icon: MapIcon },
{ to: "/mesh", label: "Mesh", icon: Share2 },
]
@@ -202,6 +201,7 @@ export function Layout() {
<X size={20} />
</button>
</div>
<HostSwitcher collapsed={false} />
<NavItems collapsed={false} onNavigate={() => setMobileOpen(false)} />
</aside>
</div>
@@ -222,6 +222,7 @@ export function Layout() {
>
<Brand collapsed={collapsed} />
</div>
<HostSwitcher collapsed={collapsed} />
<NavItems collapsed={collapsed} />
<button
onClick={() => setCollapsed((c) => !c)}