Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: group Models navigation destinations (#7792)
[._.]/ Adam Eivyde4b5fa7caf9
diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsxindex d57b433ea6..c9c6311e88 100644--- a/client/src/components/Layout.jsx+++ b/client/src/components/Layout.jsx@@ -55,7 +55,7 @@ import {SECTIONS_BELOW_MORE,} from '../lib/navPresentation.js';import { isFullWidthRoute } from '../lib/layoutRoutes.js';-import { NAV_COMMANDS } from '../../../server/lib/navManifest.js';+import { getNavCommandForPath, getSectionNavGroups, NAV_COMMANDS } from '../../../server/lib/navManifest.js';import { useSidebarApps } from '../hooks/useSidebarApps.js';import { useSidebarSeries } from '../hooks/useSidebarSeries.js';import { useSidebarUniverses } from '../hooks/useSidebarUniverses.js';@@ -67,6 +67,7 @@ import CmdKSearch from './CmdKSearch';import KeyboardHelp from './KeyboardHelp';import VoiceWidget from './voice/VoiceWidget';import { openCmdKSearch } from '../hooks/useCmdKSearch.js';+import SidebarContext from './SidebarContext.jsx';function ThemeModeToggle({ className = '' }) {const { theme, toggleMode } = useThemeContext();@@ -125,6 +126,7 @@ const navRowForPath = (path) => {label: command.label,section: command.section,feature: command.feature,+ ...(command.navGroup ? { navGroup: command.navGroup } : {}),...NAV_PRESENTATION[path],};};@@ -140,7 +142,11 @@ const sectionNavItem = (section) => {&& children.every((child) => child.feature === children[0].feature)? children[0].feature: undefined;- return { label: section, feature: sharedFeature, children, ...SECTION_PRESENTATION[section] };+ const childByPath = new Map(children.filter((child) => child.to).map((child) => [child.to, child]));+ const groups = getSectionNavGroups(section)+ .map((group) => ({ ...group, children: group.tabs.map((tab) => childByPath.get(tab.to)).filter(Boolean) }))+ .filter((group) => group.children.length > 0);+ return { label: section, feature: sharedFeature, children, groups, ...SECTION_PRESENTATION[section] };};const mainRows = ['/', '/review', '/eidoverse'].map(navRowForPath);@@ -541,6 +547,11 @@ export default function Layout() {const isActive = (path) => {if (path === '/') return location.pathname === '/';+ const declaredPath = commandByPath.has(path);+ const matchedCommand = declaredPath ? getNavCommandForPath(location.pathname) : null;+ if (matchedCommand?.section === 'Models') {+ return matchedCommand.path === path;+ }return location.pathname === path || location.pathname.startsWith(path + '/');};@@ -698,7 +709,17 @@ export default function Layout() {{/* Children items */}{expandedSections[item.label] && !sidebarCollapsed && (<div className="ml-4 mt-1 min-w-0">- {item.children.map((child, childIndex) => {+ {(item.groups?.length+ ? item.groups.flatMap((group) => [{ groupLabel: group.label }, ...group.children])+ : item.children+ ).map((child, childIndex) => {+ if (child.groupLabel) {+ return (+ <div key={`child-group-${child.groupLabel}`} className="px-3 pt-3 pb-1 text-[10px] font-semibold uppercase tracking-wide text-gray-500" role="heading" aria-level="3">+ {child.groupLabel}+ </div>+ );+ }if (child.separator) {return <div key={`child-sep-${childIndex}`} className="mx-3 my-1 border-t border-port-border" />;}@@ -792,7 +813,8 @@ export default function Layout() {};return (- <div className="h-dvh-screen print:h-auto print:min-h-screen w-full max-w-full overflow-x-hidden bg-port-bg flex">+ <SidebarContext.Provider value={{ collapsed: sidebarCollapsed, desktop: desktopNav }}>+ <div className="h-dvh-screen print:h-auto print:min-h-screen w-full max-w-full overflow-x-hidden bg-port-bg flex">{/* Skip to main content link for keyboard users */}<ahref="#main-content"@@ -955,6 +977,9 @@ export default function Layout() {{collapsed && flyoutSection && (() => {const item = resolvedNavItems.find((i) => i.label === flyoutSection);if (!item || !item.children || item.children.length === 0) return null;+ const flyoutChildren = item.groups?.length+ ? item.groups.flatMap((group) => [{ groupLabel: group.label }, ...group.children])+ : item.children;// A list of navigation links, not a command menu — so <nav> + <ul>/<li>,// NOT role="menu"/"menuitem": those roles promise arrow-key roving// focus between items that this flyout doesn't implement (#7265).@@ -974,7 +999,16 @@ export default function Layout() {{item.label}</div><ul>- {item.children.map((child, childIndex) => {+ {flyoutChildren.map((child, childIndex) => {+ if (child.groupLabel) {+ return (+ <li key={`flyout-group-${child.groupLabel}`} role="presentation">+ <div className="px-3 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wide text-gray-500" role="heading" aria-level="3">+ {child.groupLabel}+ </div>+ </li>+ );+ }if (child.separator) {// Decorative rule, not an item — hidden so it doesn't pad the// list's "N items" count for screen readers.@@ -1091,6 +1125,7 @@ export default function Layout() {<KeyboardHelp />{/* Push-to-talk voice widget — self-hides when voice.enabled is false */}<VoiceWidget />- </div>+ </div>+ </SidebarContext.Provider>);}diff --git a/client/src/components/SidebarContext.jsx b/client/src/components/SidebarContext.jsxnew file mode 100644index 0000000000..55b6828e92--- /dev/null+++ b/client/src/components/SidebarContext.jsx@@ -0,0 +1,7 @@+import { createContext, useContext } from 'react';++const SidebarContext = createContext({ collapsed: false, desktop: false });++export const useSidebarContext = () => useContext(SidebarContext);++export default SidebarContext;diff --git a/client/src/components/models/JevPanel.jsx b/client/src/components/models/JevPanel.jsxindex 6b0c6eb4b8..139069dc4a 100644--- a/client/src/components/models/JevPanel.jsx+++ b/client/src/components/models/JevPanel.jsx@@ -209,7 +209,7 @@ export default function JevPanel() {<sectionid="llm-management-panel-jev"role="tabpanel"- aria-labelledby="tab-jev"+ aria-labelledby="jev-heading"data-testid="jev-card"className="max-w-6xl bg-port-card border border-port-border rounded-xl p-4 sm:p-6 space-y-5">@@ -217,7 +217,7 @@ export default function JevPanel() {<div className="flex items-start gap-2"><Scale size={18} className="text-port-accent mt-0.5" aria-hidden="true" /><div>- <h2 className="text-lg font-semibold text-white">jev decision scorer</h2>+ <h2 id="jev-heading" className="text-lg font-semibold text-white">jev decision scorer</h2><p className="text-xs text-port-accent mt-0.5">Optional · local entailment model · no provider quota</p></div></div>diff --git a/client/src/components/models/JevPanel.test.jsx b/client/src/components/models/JevPanel.test.jsxindex 59115d3efa..808776214c 100644--- a/client/src/components/models/JevPanel.test.jsx+++ b/client/src/components/models/JevPanel.test.jsx@@ -78,7 +78,9 @@ const headRow = (overrides = {}) => ({const renderPanel = async () => {render(<JevPanel />);- expect(await screen.findByRole('heading', { name: 'jev decision scorer' })).toBeInTheDocument();+ const heading = await screen.findByRole('heading', { name: 'jev decision scorer' });+ expect(heading).toBeInTheDocument();+ expect(screen.getByRole('tabpanel')).toHaveAttribute('aria-labelledby', heading.id);};describe('JevPanel install', () => {diff --git a/client/src/components/models/ModelAbuseGuardPanel.jsx b/client/src/components/models/ModelAbuseGuardPanel.jsxindex fef76eecf8..ab51ea14e3 100644--- a/client/src/components/models/ModelAbuseGuardPanel.jsx+++ b/client/src/components/models/ModelAbuseGuardPanel.jsx@@ -109,7 +109,7 @@ export default function ModelAbuseGuardPanel() {<sectionid="llm-management-panel-abuse"role="tabpanel"- aria-labelledby="tab-abuse"+ aria-labelledby="model-abuse-guard-heading"data-testid="model-abuse-guard-card"className="max-w-6xl bg-port-card border border-port-border rounded-xl p-4 sm:p-6 space-y-5">diff --git a/client/src/components/models/ModelAbuseGuardPanel.test.jsx b/client/src/components/models/ModelAbuseGuardPanel.test.jsxindex 7c204fc588..1a9328f11b 100644--- a/client/src/components/models/ModelAbuseGuardPanel.test.jsx+++ b/client/src/components/models/ModelAbuseGuardPanel.test.jsx@@ -53,7 +53,9 @@ beforeEach(() => {const renderPanel = async () => {render(<ModelAbuseGuardPanel />);- expect(await screen.findByRole('heading', { name: 'Model-abuse guard' })).toBeInTheDocument();+ const heading = await screen.findByRole('heading', { name: 'Model-abuse guard' });+ expect(heading).toBeInTheDocument();+ expect(screen.getByRole('tabpanel')).toHaveAttribute('aria-labelledby', heading.id);};describe('ModelAbuseGuardPanel', () => {diff --git a/client/src/components/models/ModelsTabsHeader.jsx b/client/src/components/models/ModelsTabsHeader.jsxindex acba252733..abc4f44a1c 100644--- a/client/src/components/models/ModelsTabsHeader.jsx+++ b/client/src/components/models/ModelsTabsHeader.jsx@@ -1,5 +1,13 @@-import { getSectionNavTabs } from '../../../../server/lib/navManifest.js';+import { NavLink, useLocation } from 'react-router';+import {+ getSectionNavGroups,+ getSectionNavTabForPath,+ getSectionNavTabs,+} from '../../../../server/lib/navManifest.js';import SectionTabsHeader from '../ui/SectionTabsHeader';+import { buildSectionNavTabs } from '../../lib/pageNavTabs.js';+import { NAV_PRESENTATION } from '../../lib/navPresentation.js';+import { useSidebarContext } from '../SidebarContext.jsx';// Shared sub-nav for the top-level Models section.//@@ -16,14 +24,79 @@ import SectionTabsHeader from '../ui/SectionTabsHeader';// Models is a gallery of generated meshes, and `/3d` is the render flow that// consumes the runtimes listed here.//-// Providers (`/ai`), Usage (`/devtools/usage`) and Playground-// (`/local-llm/playground`) keep their legacy paths, but render this header too,-// so selecting any Models destination does not strand the user outside the tab bar.+// Several destinations keep their legacy paths (`/ai/*`, `/devtools/*`, and+// `/local-llm/playground`) but render this header too, so selecting any Models+// destination does not strand the user outside the tab bar.//// The manifest owns this list. Keep the export for page tests and callers that// need to enumerate the section, but never hand-maintain a second route list.export const TABS = getSectionNavTabs('Models');+export const GROUPS = getSectionNavGroups('Models');-export default function ModelsTabsHeader({ activeTab }) {- return <SectionTabsHeader activeTab={activeTab} fallbackSection="Models" />;+const PRESENTED_TABS = buildSectionNavTabs(TABS, NAV_PRESENTATION, 'Models');+const PRESENTATION_BY_ID = new Map(PRESENTED_TABS.map((tab) => [tab.id, tab]));++const activeTabForPath = (pathname, fallback) => (+ getSectionNavTabForPath('Models', pathname)?.id || fallback+);++export function ModelsDesktopNavigator({ activeTab }) {+ const { pathname } = useLocation();+ const { collapsed, desktop } = useSidebarContext();+ const resolvedActiveTab = activeTabForPath(pathname, activeTab);++ if (!desktop || !collapsed) return null;++ return (+ <nav+ aria-label="Models destinations"+ className="hidden lg:flex w-56 shrink-0 flex-col border-r border-port-border bg-port-card/40 overflow-y-auto px-3 py-4"+ >+ <h2 className="sr-only">Models destinations</h2>+ {GROUPS.map((group) => (+ <div key={group.label} className="mb-4 last:mb-0">+ <h3 className="px-2 pb-1 text-[10px] font-semibold uppercase tracking-wide text-gray-500">+ {group.label}+ </h3>+ <div className="space-y-0.5">+ {group.tabs.map((tab) => {+ const presented = PRESENTATION_BY_ID.get(tab.id);+ const Icon = presented.icon;+ const active = tab.id === resolvedActiveTab;+ return (+ <NavLink+ key={tab.id}+ to={tab.to}+ end+ aria-current={active ? 'page' : undefined}+ className={`flex min-h-[44px] items-center gap-2 rounded-lg px-2 py-2 text-sm transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-port-accent ${+ active+ ? 'bg-port-accent/15 text-port-accent font-medium'+ : 'text-gray-400 hover:bg-port-border/50 hover:text-white'+ }`}+ >+ <Icon size={16} aria-hidden="true" className="shrink-0" />+ <span className="min-w-0 break-words leading-snug">{tab.label}</span>+ </NavLink>+ );+ })}+ </div>+ </div>+ ))}+ </nav>+ );+}++export default function ModelsTabsHeader({ activeTab, desktop = true }) {+ const { pathname } = useLocation();+ const resolvedActiveTab = activeTabForPath(pathname, activeTab);++ return (+ <>+ {desktop && <ModelsDesktopNavigator activeTab={resolvedActiveTab} />}+ <div className="lg:hidden">+ <SectionTabsHeader activeTab={resolvedActiveTab} fallbackSection="Models" />+ </div>+ </>+ );}diff --git a/client/src/components/settings/LocalLlmLibraryView.jsx b/client/src/components/settings/LocalLlmLibraryView.jsxindex e766cf67d1..e4933c1c79 100644--- a/client/src/components/settings/LocalLlmLibraryView.jsx+++ b/client/src/components/settings/LocalLlmLibraryView.jsx@@ -345,7 +345,7 @@ export default function LocalLlmLibraryView() {};return (- <section id="llm-management-panel-library" role="tabpanel" aria-labelledby="tab-library" className="space-y-4">+ <section id="llm-management-panel-library" role="tabpanel" aria-labelledby="llm-library-heading" className="space-y-4">{upgradeFlow && (<div className="bg-port-warning/10 border-2 border-port-warning/60 rounded-lg p-4 space-y-2" role="alert"><div className="flex items-start gap-3">@@ -381,7 +381,7 @@ export default function LocalLlmLibraryView() {{/* Models — backend picker + catalog/install + installed list */}<div className="bg-port-card border border-port-border rounded-xl p-4 sm:p-6 space-y-4"><div className="flex items-center justify-between gap-3 flex-wrap">- <h2 className="text-sm font-medium text-gray-300">Models</h2>+ <h2 id="llm-library-heading" className="text-sm font-medium text-gray-300">Models</h2><div className="flex items-center gap-2 flex-wrap justify-end"><div className="flex items-center gap-1.5">{['recommended', 'huggingface'].map((source) => (diff --git a/client/src/components/settings/LocalLlmLibraryView.test.jsx b/client/src/components/settings/LocalLlmLibraryView.test.jsxindex 4d59f90a1c..1080ca8f50 100644--- a/client/src/components/settings/LocalLlmLibraryView.test.jsx+++ b/client/src/components/settings/LocalLlmLibraryView.test.jsx@@ -86,6 +86,7 @@ const renderLibrary = async () => {</MemoryRouter>,);await waitFor(() => expect(screen.getByRole('tabpanel')).toHaveAttribute('id', 'llm-management-panel-library'));+ expect(screen.getByRole('tabpanel')).toHaveAttribute('aria-labelledby', 'llm-library-heading');await waitFor(() => expect(screen.getByText(/Installed on (Ollama|LM Studio)/)).toBeTruthy());await act(async () => {});await act(async () => {});diff --git a/client/src/components/settings/LocalLlmTab.jsx b/client/src/components/settings/LocalLlmTab.jsxindex e7c9a52632..860539cfa9 100644--- a/client/src/components/settings/LocalLlmTab.jsx+++ b/client/src/components/settings/LocalLlmTab.jsx@@ -1,57 +1,18 @@-import { useNavigate } from 'react-router';-import { Download, ShieldCheck } from 'lucide-react';-import TabPills from '../ui/TabPills.jsx';-import { useInstanceFeatures } from '../../hooks/useInstanceFeatures.js';+import JevPanel from '../models/JevPanel.jsx';import ModelAbuseGuardPanel from '../models/ModelAbuseGuardPanel.jsx';import LocalLlmLibraryView from './LocalLlmLibraryView.jsx';-export const LLM_VIEWS = [- { id: 'library', label: 'Model Library', icon: Download },- { id: 'abuse', label: 'Abuse Guard', icon: ShieldCheck },-];--// Palettable LLM drill-downs. Model Library stays a focused view of-// `/models/llms` (the Models → LLMs landing). Abuse Guard is a managed-// classifier lifecycle of its own, so ⌘K and voice need a dedicated path.-// Runtimes is deliberately absent: it is a SIBLING TAB now (#7414,-// `/models/llms-runtimes`), covered by `getSectionNavTabs('Models')`.-// Scraped by server/lib/navManifest.test.js.-export const LLM_NAV_SUBROUTES = [- { id: 'abuse' },-];--// Dispatcher only. The two working surfaces are entirely disjoint — different-// data, different sockets, different actions — so each owns its own file and-// only the selected one mounts. Nothing but the pills and the blurb is shared,-// which is why no status is threaded through here: the mounted view loads (and-// subscribes to) exactly what it renders, leaving one subscriber per event.+// Dispatcher only. These destinations are promoted into the Models navigator;+// this component keeps the existing routes and mounts only the selected panel.+>>>>>>> 25ec27953 (feat: group Models navigation destinations (#7792))export function LocalLlmTab({ view }) {- const navigate = useNavigate();- const { isFeatureEnabled } = useInstanceFeatures();- const activeView = LLM_VIEWS.some(({ id }) => id === view) ? view : 'library';- const visibleViews = LLM_VIEWS.filter((tab) => tab.id === activeView || isFeatureEnabled(tab.feature));+ const activeView = ['abuse', 'jev'].includes(view) ? view : 'library';return (- <div className="space-y-4">- <div className="space-y-2">- <TabPills- tabs={visibleViews}- activeTab={activeView}- onChange={(nextView) => navigate(`/models/llms/${nextView}`)}- variant="pills"- size="sm"- mobileCompact- ariaLabel="LLM management sections"- controlsIdPrefix="llm-management-panel"- />- <p className="text-xs text-gray-500">- {activeView === 'abuse'- ? 'Install and verify each stage of the pinned Prompt Guard classifier used to screen external content.'- : 'Find, install, compare, and remove the model weights available to Ollama and LM Studio.'}- </p>- </div>+ <div>{activeView === 'abuse' && <ModelAbuseGuardPanel />}{activeView === 'library' && <LocalLlmLibraryView />}+ {activeView === 'jev' && <JevPanel />}</div>);}diff --git a/client/src/components/settings/LocalLlmTab.test.jsx b/client/src/components/settings/LocalLlmTab.test.jsxindex ca0bd208b3..24aace30aa 100644--- a/client/src/components/settings/LocalLlmTab.test.jsx+++ b/client/src/components/settings/LocalLlmTab.test.jsx@@ -1,6 +1,6 @@import { describe, it, expect, vi, beforeEach } from 'vitest';-import { fireEvent, render, screen } from '@testing-library/react';-import { MemoryRouter, useLocation } from 'react-router';+import { render, screen } from '@testing-library/react';+import { MemoryRouter } from 'react-router';// The tab is a dispatcher: the assertion that matters is WHICH view mounts, so// the views themselves are stubbed. Their own behaviour is covered in@@ -19,33 +19,16 @@ vi.mock('../models/ModelAbuseGuardPanel.jsx', () => ({vi.mock('../models/JevPanel.jsx', () => ({default: () => <div data-testid="jev-view">jev</div>,}));-// Jev integrations are optional; management stays discoverable regardless.-// Which pills the bar-// advertises depends on live feature state rather than the static view list.-const disabledFeatures = new Set();-vi.mock('../../hooks/useInstanceFeatures.js', () => ({- useInstanceFeatures: () => ({- isFeatureEnabled: (featureId) => !featureId || !disabledFeatures.has(featureId),- }),-}));-import { LocalLlmTab } from './LocalLlmTab';-const LocationProbe = () => {- const location = useLocation();- return <output data-testid="location">{location.pathname}{location.search}</output>;-};-const renderTab = (view) => render(<MemoryRouter><LocalLlmTab view={view} />- <LocationProbe /></MemoryRouter>,);beforeEach(() => {vi.clearAllMocks();- disabledFeatures.clear();});describe('LocalLlmTab view dispatch', () => {@@ -68,27 +51,9 @@ describe('LocalLlmTab view dispatch', () => {}});- // The pill bar is what a user reaches these views by, so a Runtimes pill left- // behind would navigate to `/models/llms/runtimes` — a path that now only- // redirects away — instead of the tab that owns the page.- it('no longer advertises Runtimes as one of its pills', () => {- renderTab();-- expect(screen.getAllByRole('tab').map((t) => t.textContent)).toEqual(['Model Library', 'Abuse Guard']);- });-- it('navigates between the focused panels with a shareable URL', () => {- renderTab();-- fireEvent.click(screen.getByRole('tab', { name: 'Model Library' }));- expect(screen.getByTestId('location')).toHaveTextContent('/models/llms/library');- fireEvent.click(screen.getByRole('tab', { name: 'Abuse Guard' }));- expect(screen.getByTestId('location')).toHaveTextContent('/models/llms/abuse');- });-- it('describes the selected panel under the pills', () => {- renderTab('library');-- expect(screen.getByText(/Find, install, compare, and remove the model weights/)).toBeInTheDocument();+ it('dispatches every promoted route directly without a redundant local nav row', () => {+ renderTab('jev');+ expect(screen.getByTestId('jev-view')).toBeInTheDocument();+ expect(screen.queryAllByRole('tab')).toHaveLength(0);});});diff --git a/client/src/lib/navPresentation.js b/client/src/lib/navPresentation.jsindex 5816dd2a2c..05b449dfd3 100644--- a/client/src/lib/navPresentation.js+++ b/client/src/lib/navPresentation.js@@ -60,6 +60,7 @@ import {Server,Shield,ShieldCheck,+ ShieldAlert,KeyRound,Lock,Wand2,@@ -230,6 +231,8 @@ export const NAV_PRESENTATION = {'/models/decision-classifiers': { icon: Scale },'/models/embeddings': { icon: Braces },'/models/llms': { icon: Cpu },+ '/models/llms/abuse': { icon: ShieldAlert },+ '/models/llms/jev': { icon: Scale },'/models/llms-runtimes': { icon: Server },'/models/loras': { icon: Sparkles },'/models/media': { icon: HardDrive },diff --git a/client/src/pages/Models.jsx b/client/src/pages/Models.jsxindex 932ec502c6..200daf3651 100644--- a/client/src/pages/Models.jsx+++ b/client/src/pages/Models.jsx@@ -3,7 +3,7 @@ import { useParams, Navigate } from 'react-router';import { Cpu } from 'lucide-react';import PageHeader from '../components/PageHeader';import PageSkeleton from '../components/ui/PageSkeleton';-import ModelsTabsHeader from '../components/models/ModelsTabsHeader';+import ModelsTabsHeader, { ModelsDesktopNavigator } from '../components/models/ModelsTabsHeader';import Image3dRuntimes from '../components/models/Image3dRuntimes';import ModelStatusTab from '../components/models/ModelStatusTab';import SubscriptionsTab from '../components/models/SubscriptionsTab';@@ -103,17 +103,20 @@ export default function Models() {const TabContent = TAB_CONTENT[activeTab];return (- <div className="flex flex-col h-full min-w-0 overflow-hidden">- <PageHeader icon={Cpu} title="Models" />+ <div className="flex h-full min-w-0 overflow-hidden">+ <ModelsDesktopNavigator activeTab={activeTab} />+ <div className="flex flex-col h-full min-w-0 flex-1">+ <PageHeader icon={Cpu} title="Models" />- <ModelsTabsHeader activeTab={activeTab} />+ <ModelsTabsHeader activeTab={activeTab} desktop={false} />- <div className="flex-1 min-w-0 overflow-auto p-4">- {/* Local boundary rather than the App-level one: a lazy tab must not blank- out the section header and tab bar while its chunk loads. */}- <Suspense fallback={<PageSkeleton header="none" label="Loading models section" cards={3} sidebar={false} />}>- {DetailContent ? <DetailContent recordId={recordId} /> : <TabContent view={recordId} />}- </Suspense>+ <div className="flex-1 min-w-0 overflow-auto p-4">+ {/* Local boundary rather than the App-level one: a lazy tab must not blank+ the section header and tab bar while its chunk loads. */}+ <Suspense fallback={<PageSkeleton header="none" label="Loading models section" cards={3} sidebar={false} />}>+ {DetailContent ? <DetailContent recordId={recordId} /> : <TabContent view={recordId} />}+ </Suspense>+ </div></div></div>);diff --git a/client/src/pages/Models.test.jsx b/client/src/pages/Models.test.jsxindex d8774c0654..a64def7e0a 100644--- a/client/src/pages/Models.test.jsx+++ b/client/src/pages/Models.test.jsx@@ -8,9 +8,10 @@*/import { describe, it, expect, vi } from 'vitest';-import { render, screen, within } from '@testing-library/react';+import { fireEvent, render, screen, within } from '@testing-library/react';import { MemoryRouter, Route, Routes } from 'react-router';-import { TABS } from '../components/models/ModelsTabsHeader';+import { ModelsDesktopNavigator, TABS } from '../components/models/ModelsTabsHeader';+import SidebarContext from '../components/SidebarContext';vi.mock('../components/settings/LocalModelAssessments.jsx', () => ({ default: () => <div>assessments panel</div> }));vi.mock('../components/settings/LocalLlmTab', () => ({@@ -42,6 +43,8 @@ const PANEL_MARKER = {'decision-classifiers': 'classifiers panel',embeddings: 'embeddings panel',llms: 'llms panel',+ abuse: 'llms panel',+ jev: 'llms panel','llms-runtimes': 'runtimes panel',loras: 'loras panel',media: 'media models panel',@@ -53,7 +56,7 @@ const PANEL_MARKER = {// These destinations belong to Models in the sidebar but keep their own route// shells, so their pages render the shared header directly.-const EXTERNAL_TAB_IDS = ['playground', 'providers', 'usage'];+const EXTERNAL_TAB_IDS = ['harnesses', 'playground', 'providers', 'quota-burn', 'services', 'usage'];const ownTabs = TABS.filter((t) => !EXTERNAL_TAB_IDS.includes(t.id));const renderAt = (path) => render(@@ -66,10 +69,10 @@ const renderAt = (path) => render();describe('Models', () => {- it('names the one destination served outside /models', () => {- // Asserted by id, not as a count: the day a second external destination joins- // the header, this should say WHICH one appeared, not just that a number moved.- expect(TABS.filter((t) => !t.to.startsWith('/models/')).map((t) => t.id)).toEqual(EXTERNAL_TAB_IDS);+ it('names every destination served outside /models', () => {+ // Asserted by id, not as a count: a moved or newly promoted destination must+ // be identified here, not hidden by a count that still happens to match.+ expect(TABS.filter((t) => !t.to.startsWith('/models/')).map((t) => t.id).sort()).toEqual([...EXTERNAL_TAB_IDS].sort());});it('has a panel marker for every tab this page serves', () => {@@ -129,6 +132,31 @@ describe('Models', () => {expect(tabs.every((t) => t.querySelector('svg') && t.querySelector('.max-sm\\:sr-only'))).toBe(true);});+ it('renders grouped desktop destinations with one active link and keyboard-sized targets', () => {+ render(+ <MemoryRouter initialEntries={['/models/llms/abuse']}>+ <SidebarContext.Provider value={{ collapsed: true, desktop: true }}>+ <ModelsDesktopNavigator activeTab="llms" />+ </SidebarContext.Provider>+ </MemoryRouter>,+ );++ const nav = screen.getByRole('navigation', { name: 'Models destinations' });+ expect(within(nav).getByRole('heading', { name: 'Connect' })).toBeInTheDocument();+ expect(within(nav).getByRole('heading', { name: 'Evaluate' })).toBeInTheDocument();+ expect(within(nav).getByRole('heading', { name: 'Library' })).toBeInTheDocument();+ expect(within(nav).getByRole('heading', { name: 'Operate' })).toBeInTheDocument();+ expect(within(nav).getByRole('heading', { name: 'Policies' })).toBeInTheDocument();++ const abuse = within(nav).getByRole('link', { name: 'Abuse Guard' });+ expect(abuse).toHaveAttribute('aria-current', 'page');+ expect(within(nav).getByRole('link', { name: 'Model Library' })).not.toHaveAttribute('aria-current');+ expect(within(nav).getAllByRole('link').every((link) => link.getAttribute('class').includes('min-h-[44px]'))).toBe(true);++ fireEvent.click(within(nav).getByRole('link', { name: 'Jev decision scorer' }));+ expect(within(nav).getByRole('link', { name: 'Jev decision scorer' })).toHaveAttribute('aria-current', 'page');+ });+// A tab listed in the header but missing from TAB_CONTENT falls through to the// unknown-slug redirect and silently lands on LLMs. Selection state is what// distinguishes "rendered this tab" from "bounced to LLMs" — the@@ -154,10 +182,10 @@ describe('Models — tab drill-downs', () => {expect(screen.queryByTestId('llms-view')).not.toBeInTheDocument();});- it.each(['library', 'abuse'])('passes the LLM %s sub-route through to the focused LLM view', async (view) => {+ it.each(['library', 'abuse', 'jev'])('passes the LLM %s sub-route through to the focused LLM view', async (view) => {renderAt(`/models/llms/${view}`);expect(await screen.findByTestId('llms-view')).toHaveAttribute('data-view', view);- expect(screen.getByRole('tab', { name: 'LLMs' })).toHaveAttribute('aria-selected', 'true');+ expect(screen.getByRole('tab', { name: view === 'library' ? 'Model Library' : view === 'abuse' ? 'Abuse Guard' : 'Jev decision scorer' })).toHaveAttribute('aria-selected', 'true');});it('renders a tab detail view INSIDE the section shell, not as a bare page', async () => {diff --git a/server/lib/navManifest.js b/server/lib/navManifest.jsindex 2e03219c10..4c9ffeb635 100644--- a/server/lib/navManifest.js+++ b/server/lib/navManifest.js@@ -1,6 +1,6 @@// Single source of truth for PortOS navigation. Consumed by the sidebar,// server/services/voice/tools.js#ui_navigate, and the Cmd+K palette.-// Entry: { id, path, label, section, tabId?, tabGroup?, tabLabel?, aliases?, keywords?, previousPaths?, preservePreviousPathSuffix? }.+// Entry: { id, path, label, section, tabId?, tabGroup?, navGroup?, tabLabel?, aliases?, keywords?, previousPaths?, preservePreviousPathSuffix? }.// See AGENTS.md "Command Palette & Voice Nav" for the contract.//// `previousPaths` lists every path this page has ANSWERED TO BEFORE — including@@ -96,9 +96,9 @@ const RAW_NAV_COMMANDS = [// (instances of a service definition: plan, credential, catalog). Each is its// own URL so a card can be linked and reached from ⌘K and voice; the retired// Backend Connections drawer (#6369) redirects onto Services.- { id: 'nav.settings.providers', path: '/ai/presets', label: 'Providers', section: 'Models', tabId: 'providers', previousPaths: ['/ai'], aliases: ['providers', 'ai-providers', 'presets', 'ai-presets', 'provider-presets'], keywords: ['preset', 'harness', 'service', 'model', 'effort', 'compose', 'compatibility matrix', 'default provider'] },- { id: 'nav.ai.harnesses', path: '/ai/harnesses', label: 'Harnesses', section: 'Models', previousPaths: ['/models/harnesses'], aliases: ['harnesses', 'harness', 'ai-harnesses', 'agent-harnesses', 'coding-clis', 'cli-harnesses', 'provider-harnesses', 'harness-enablement', 'credential-bootstraps', 'bootstraps'], keywords: ['enable harness', 'disable harness', 'claude code', 'codex', 'opencode', 'pi', 'direct api', 'cli', 'tui', 'bootstrap', 'launch wrapper', 'sign in', 'quota', 'antigravity', 'agy', 'grok', 'kimi', 'cursor', 'install cli', 'update cli', 'upgrade', 'version', 'refresh models'] },- { id: 'nav.ai.services', path: '/ai/services', label: 'AI Services', section: 'Models', previousPaths: ['/ai/connections', '/ai/connections/:connectionId'], aliases: ['ai-services', 'services', 'provider-services', 'backends', 'connections', 'backend-connections', 'provider-connections', 'harness-connections'], keywords: ['endpoint', 'api key', 'plan', 'free', 'paid', 'subscription', 'model catalog', 'refresh catalog', 'ollama', 'nvidia', 'openrouter', 'add service'] },+ { id: 'nav.settings.providers', path: '/ai/presets', label: 'Providers', section: 'Models', tabId: 'providers', navGroup: 'Connect', previousPaths: ['/ai'], aliases: ['providers', 'ai-providers', 'presets', 'ai-presets', 'provider-presets'], keywords: ['preset', 'harness', 'service', 'model', 'effort', 'compose', 'compatibility matrix', 'default provider'] },+ { id: 'nav.ai.harnesses', path: '/ai/harnesses', label: 'Harnesses', section: 'Models', tabId: 'harnesses', navGroup: 'Connect', previousPaths: ['/models/harnesses'], aliases: ['harnesses', 'harness', 'ai-harnesses', 'agent-harnesses', 'coding-clis', 'cli-harnesses', 'provider-harnesses', 'harness-enablement', 'credential-bootstraps', 'bootstraps'], keywords: ['enable harness', 'disable harness', 'claude code', 'codex', 'opencode', 'pi', 'direct api', 'cli', 'tui', 'bootstrap', 'launch wrapper', 'sign in', 'quota', 'antigravity', 'agy', 'grok', 'kimi', 'cursor', 'install cli', 'update cli', 'upgrade', 'version', 'refresh models'] },+ { id: 'nav.ai.services', path: '/ai/services', label: 'AI Services', section: 'Models', tabId: 'services', navGroup: 'Connect', previousPaths: ['/ai/connections', '/ai/connections/:connectionId'], aliases: ['ai-services', 'services', 'provider-services', 'backends', 'connections', 'backend-connections', 'provider-connections', 'harness-connections'], keywords: ['endpoint', 'api key', 'plan', 'free', 'paid', 'subscription', 'model catalog', 'refresh catalog', 'ollama', 'nvidia', 'openrouter', 'add service'] },{ id: 'nav.settings.fleet-llm', path: '/ai/fleet', label: 'Fleet LLM Setup', section: 'Settings', aliases: ['fleet-llm', 'gpu-host', 'remote-ai-provider'], keywords: ['3090', 'tailscale', 'vllm', 'qwen', 'coding model', 'dedicated host'] },{ id: 'nav.brain.inbox', path: '/brain/inbox', label: 'Inbox', section: 'Brain', tabGroup: 'brain', tabId: 'inbox', aliases: ['brain', 'brain-inbox', 'inbox'] },@@ -205,9 +205,9 @@ const RAW_NAV_COMMANDS = [{ id: 'nav.devtools.image-clean', path: '/devtools/image-clean', label: 'Image Cleaner', section: 'Dev Tools', aliases: ['image-clean', 'image-cleaner'], keywords: ['metadata', 'c2pa', 'content-credentials', 'sharp', 'denoise'] },{ id: 'nav.devtools.jira', path: '/devtools/jira', label: 'JIRA', section: 'Dev Tools', feature: 'jira', previousPaths: ['/jira'], aliases: ['jira', 'devtools-jira'] },{ id: 'nav.devtools.jira-reports', path: '/devtools/jira/reports', label: 'JIRA Reports', section: 'Dev Tools', feature: 'jira', aliases: ['jira-reports'] },- { id: 'nav.devtools.quota-burn', path: '/devtools/quota-burn', label: 'Quota Burn', section: 'Models', aliases: ['quota-burn', 'burn-quota', 'quota'], keywords: ['subscription', 'usage', 'reset window', 'spend quota', 'claude', 'codex', 'grok', 'agy', 'burn'] },+ { id: 'nav.devtools.quota-burn', path: '/devtools/quota-burn', label: 'Quota Burn', section: 'Models', tabId: 'quota-burn', navGroup: 'Operate', aliases: ['quota-burn', 'burn-quota', 'quota'], keywords: ['subscription', 'usage', 'reset window', 'spend quota', 'claude', 'codex', 'grok', 'agy', 'burn'] },{ id: 'nav.shell', path: '/shell', label: 'Shell', section: 'Dev Tools', aliases: ['shell', 'terminal'] },- { id: 'nav.devtools.usage', path: '/devtools/usage', label: 'Usage', section: 'Models', tabId: 'usage', aliases: ['devtools-usage'] },+ { id: 'nav.devtools.usage', path: '/devtools/usage', label: 'Usage', section: 'Models', tabId: 'usage', navGroup: 'Operate', aliases: ['devtools-usage'] },{ id: 'nav.devtools.video-download', path: '/devtools/video-download', label: 'Video Downloader', section: 'Dev Tools', aliases: ['video-download', 'video-downloader', 'download-video'], keywords: ['youtube', 'x.com', 'twitter', 'yt-dlp', 'download', 'clip'] },{ id: 'nav.workspace-contexts', path: '/workspace-contexts', label: 'Workspaces', section: 'Dev Tools', aliases: ['workspaces', 'workspace-contexts', 'project-contexts', 'project-switcher'], keywords: ['project', 'context', 'switch project', 'branch', 'shell', 'tasks', 'restore', 'working context'] },@@ -318,32 +318,30 @@ const RAW_NAV_COMMANDS = [// image-to-3D runtimes. Several ids keep a `nav.settings.*` / `nav.media.*`// prefix: they are opaque and stored in palette history, so renaming them// would orphan those entries — only the path, label and section move.- { id: 'nav.models.comparison', path: '/models/comparison', label: 'Comparison', section: 'Models', tabId: 'comparison', aliases: ['model-comparison', 'model-cost', 'model-intelligence'], keywords: ['benchmark', 'effort', 'cost', 'quota', 'compare', 'intelligence'] },- { id: 'nav.models.3d', path: '/models/3d', label: '3D', section: 'Models', tabId: '3d', aliases: ['3d-runtimes', 'image-to-3d-runtimes', 'trellis-install', 'pixal3d-install'], keywords: ['trellis', 'pixal3d', 'install', 'repair', 'runtime', 'mesh', 'image to 3d', 'on-device'] },- { id: 'nav.models.code-reviewers', path: '/models/code-reviewers', label: 'Code Reviewers', section: 'Models', tabId: 'code-reviewers', previousPaths: ['/settings/code-reviewers'], aliases: ['code-reviewers', 'settings-code-reviewers', 'code-review', 'review-defaults', 'reviewers'], keywords: ['review loop', 'reviewer chain', 'codex', 'copilot', 'ollama', 'stop mode', 'max rounds', 'defaults'] },- { id: 'nav.settings.embeddings', path: '/models/embeddings', label: 'Embeddings', section: 'Models', tabId: 'embeddings', previousPaths: ['/settings/embeddings'], aliases: ['settings-embeddings', 'embeddings', 'embedding'], keywords: ['vector', 'pgvector', 'semantic search', 'nomic', 'ollama', 'lm studio'] },- { id: 'nav.settings.local-llm', path: '/models/llms', label: 'LLMs', section: 'Models', tabId: 'llms', previousPaths: ['/settings/local-llm'], aliases: ['local-llm', 'local-llms', 'llms', 'models-llms', 'ollama', 'lm-studio', 'lmstudio'], keywords: ['ollama', 'lm studio', 'local model', 'local llm', 'gguf', 'pull model', 'install model', 'migrate', 'switch backend', 'llama.cpp'] },- { id: 'nav.models.llms.abuse', path: '/models/llms/abuse', label: 'Abuse Guard', section: 'Models', aliases: ['abuse-guard', 'model-abuse', 'model-abuse-guard', 'prompt-guard', 'prompt guard'], keywords: ['classifier', 'prompt injection', 'security scan', 'llama prompt guard', 'install guard'] },- { id: 'nav.models.decision-classifiers', path: '/models/decision-classifiers', label: 'Decision Classifiers', section: 'Models', tabId: 'decision-classifiers', aliases: ['decision-classifiers', 'classifiers'], keywords: ['jev', 'laya', 'mlx', 'decision systems', 'experiments'] },- { id: 'nav.models.laya-mlx', path: '/models/decision-classifiers/laya-mlx', label: 'Laya-MLX', section: 'Models', aliases: ['laya', 'laya-mlx', 'layla'], keywords: ['classifier', 'apple silicon', 'typed decisions'] },- { id: 'nav.models.llms.jev', path: '/models/decision-classifiers/jev', previousPaths: ['/models/llms/jev'], label: 'Jev', section: 'Models', aliases: ['jev', 'openjev', 'entailment', 'nli', 'decision-scorer'], keywords: ['entailment', 'nli', 'closed set', 'abstain', 'margin', 'scorer', 'decision', 'install jev'] },+ { id: 'nav.models.comparison', path: '/models/comparison', label: 'Comparison', section: 'Models', tabId: 'comparison', navGroup: 'Evaluate', aliases: ['model-comparison', 'model-cost', 'model-intelligence'], keywords: ['benchmark', 'effort', 'cost', 'quota', 'compare', 'intelligence'] },+ { id: 'nav.models.3d', path: '/models/3d', label: '3D', section: 'Models', tabId: '3d', navGroup: 'Library', aliases: ['3d-runtimes', 'image-to-3d-runtimes', 'trellis-install', 'pixal3d-install'], keywords: ['trellis', 'pixal3d', 'install', 'repair', 'runtime', 'mesh', 'image to 3d', 'on-device'] },+ { id: 'nav.models.code-reviewers', path: '/models/code-reviewers', label: 'Code Reviewers', section: 'Models', tabId: 'code-reviewers', navGroup: 'Policies', previousPaths: ['/settings/code-reviewers'], aliases: ['code-reviewers', 'settings-code-reviewers', 'code-review', 'review-defaults', 'reviewers'], keywords: ['review loop', 'reviewer chain', 'codex', 'copilot', 'ollama', 'stop mode', 'max rounds', 'defaults'] },+ { id: 'nav.settings.embeddings', path: '/models/embeddings', label: 'Embeddings', section: 'Models', tabId: 'embeddings', navGroup: 'Library', previousPaths: ['/settings/embeddings'], aliases: ['settings-embeddings', 'embeddings', 'embedding'], keywords: ['vector', 'pgvector', 'semantic search', 'nomic', 'ollama', 'lm studio'] },+ { id: 'nav.settings.local-llm', path: '/models/llms', label: 'Model Library', section: 'Models', tabId: 'llms', navGroup: 'Library', previousPaths: ['/settings/local-llm'], aliases: ['local-llm', 'local-llms', 'llms', 'models-llms', 'ollama', 'lm-studio', 'lmstudio'], keywords: ['ollama', 'lm studio', 'local model', 'local llm', 'gguf', 'pull model', 'install model', 'migrate', 'switch backend', 'llama.cpp'] },+ { id: 'nav.models.llms.abuse', path: '/models/llms/abuse', label: 'Abuse Guard', section: 'Models', tabId: 'abuse', navGroup: 'Policies', aliases: ['abuse-guard', 'model-abuse', 'model-abuse-guard', 'prompt-guard', 'prompt guard'], keywords: ['classifier', 'prompt injection', 'security scan', 'llama prompt guard', 'install guard'] },+ { id: 'nav.models.llms.jev', path: '/models/llms/jev', label: 'Jev decision scorer', section: 'Models', tabId: 'jev', navGroup: 'Policies', aliases: ['jev', 'openjev', 'entailment', 'nli', 'decision-scorer'], keywords: ['entailment', 'nli', 'closed set', 'abstain', 'margin', 'scorer', 'decision', 'install jev'] },// Split out of the LLMs page (#7414): managing the SERVERS that run models is// a different job from browsing the weights they serve, and it was the LLMs// default view, not a drill-down — so it gets a sibling tab rather than a// pill. Declared AFTER `nav.settings.local-llm` on purpose: alias collisions// resolve first-declared-wins, so "ollama"/"llms" keep landing on the// catalog page even though this page starts those servers too.- { id: 'nav.models.llms-runtimes', path: '/models/llms-runtimes', label: 'Runtimes', section: 'Models', tabId: 'llms-runtimes', previousPaths: ['/models/llms/runtimes'], aliases: ['runtimes', 'llm-runtimes', 'local-runtimes', 'model-runtimes', 'llama-server', 'llama-cpp', 'slotstream', 'mtplx'], keywords: ['llama.cpp', 'llama-server', 'mtplx', 'slotstream', 'start server', 'stop server', 'local server', 'model server', 'speculative decoding', 'draft model', 'checkpoint', 'idle release'] },- { id: 'nav.media.loras', path: '/models/loras', label: 'LoRAs', section: 'Models', tabId: 'loras', previousPaths: ['/media/loras'], aliases: ['loras', 'lora', 'lora-manager', 'civitai'], keywords: ['lora', 'civitai', 'fine-tune', 'style adapter', 'realstagram', 'photoreal', 'flux lora'] },- { id: 'nav.media.training', path: '/models/training', label: 'Training', section: 'Models', tabId: 'training', previousPaths: ['/media/training', '/media/training/:datasetId'], aliases: ['training', 'lora-training', 'train-lora', 'datasets', 'character-lora'], keywords: ['fine-tune', 'dataset', 'caption', 'dreambooth', 'character consistency', 'train', 'flux lora'] },- { id: 'nav.media.models', path: '/models/media', label: 'Media', section: 'Models', tabId: 'media', previousPaths: ['/media/models', '/media-models'], aliases: ['media-models', 'image-models', 'video-models', 'huggingface'], keywords: ['hf cache', 'model storage', 'disk', 'add model', 'install model', 'custom model'] },- { id: 'nav.models.performance', path: '/models/performance', label: 'Performance', section: 'Models', tabId: 'performance', aliases: ['model-performance', 'performance', 'assessments', 'model-assessments', 'benchmark-models', 'tuning'], keywords: ['measure', 'assessment', 'benchmark', 'throughput', 'chars per second', 'ttft', 'context', 'tuning', 'llama.cpp', 'mtplx', 'vllm', 'which model', 'fastest model'] },+ { id: 'nav.models.llms-runtimes', path: '/models/llms-runtimes', label: 'Runtimes', section: 'Models', tabId: 'llms-runtimes', navGroup: 'Connect', previousPaths: ['/models/llms/runtimes'], aliases: ['runtimes', 'llm-runtimes', 'local-runtimes', 'model-runtimes', 'llama-server', 'llama-cpp', 'slotstream', 'mtplx'], keywords: ['llama.cpp', 'llama-server', 'mtplx', 'slotstream', 'start server', 'stop server', 'local server', 'model server', 'speculative decoding', 'draft model', 'checkpoint', 'idle release'] },+ { id: 'nav.media.loras', path: '/models/loras', label: 'LoRAs', section: 'Models', tabId: 'loras', navGroup: 'Library', previousPaths: ['/media/loras'], aliases: ['loras', 'lora', 'lora-manager', 'civitai'], keywords: ['lora', 'civitai', 'fine-tune', 'style adapter', 'realstagram', 'photoreal', 'flux lora'] },+ { id: 'nav.media.training', path: '/models/training', label: 'Training', section: 'Models', tabId: 'training', navGroup: 'Library', previousPaths: ['/media/training', '/media/training/:datasetId'], aliases: ['training', 'lora-training', 'train-lora', 'datasets', 'character-lora'], keywords: ['fine-tune', 'dataset', 'caption', 'dreambooth', 'character consistency', 'train', 'flux lora'] },+ { id: 'nav.media.models', path: '/models/media', label: 'Media', section: 'Models', tabId: 'media', navGroup: 'Library', previousPaths: ['/media/models', '/media-models'], aliases: ['media-models', 'image-models', 'video-models', 'huggingface'], keywords: ['hf cache', 'model storage', 'disk', 'add model', 'install model', 'custom model'] },+ { id: 'nav.models.performance', path: '/models/performance', label: 'Performance', section: 'Models', tabId: 'performance', navGroup: 'Evaluate', aliases: ['model-performance', 'performance', 'assessments', 'model-assessments', 'benchmark-models', 'tuning'], keywords: ['measure', 'assessment', 'benchmark', 'throughput', 'chars per second', 'ttft', 'context', 'tuning', 'llama.cpp', 'mtplx', 'vllm', 'which model', 'fastest model'] },// Absorbed the Dev Tools 'Model Resources' page (#4728), so its aliases and// keywords live here — 'model resources' and 'downloaded models' must keep// resolving after the fold.- { id: 'nav.models.status', path: '/models/status', label: 'Status', section: 'Models', tabId: 'status', previousPaths: ['/system-resources/models'], aliases: ['model-status', 'models-status', 'memory-management', 'resident-models', 'model-resources', 'loaded-models', 'downloaded-models', 'model-memory'], keywords: ['memory', 'resident', 'loaded', 'unload', 'ram', 'vram', 'free memory', 'what is loaded', 'ollama', 'lm studio', 'hugging face', 'lora', 'delete model', 'disk'] },- { id: 'nav.models.subscriptions', path: '/models/subscriptions', label: 'Subscriptions', section: 'Models', tabId: 'subscriptions', aliases: ['subscriptions', 'subscription', 'plans', 'ai-subscriptions', 'my-plans', 'model-subscriptions', 'billing', 'ai-billing'], keywords: ['plan', 'price', 'spend', 'cost', 'billing', 'enable', 'disable', 'claude max', 'chatgpt plus', 'pro', 'tier', 'savings', 'quota', 'usage', 'quotas'] },- { id: 'nav.settings.local-llm-playground', path: '/local-llm/playground', label: 'Playground', section: 'Models', tabId: 'playground', aliases: ['llm-playground', 'playground', 'model-playground', 'compare-models'], keywords: ['ollama', 'lm studio', 'compare', 'benchmark', 'chat', 'test model', 'ttft', 'tokens per second', 'local llm'] },+ { id: 'nav.models.status', path: '/models/status', label: 'Status', section: 'Models', tabId: 'status', navGroup: 'Operate', previousPaths: ['/system-resources/models'], aliases: ['model-status', 'models-status', 'memory-management', 'resident-models', 'model-resources', 'loaded-models', 'downloaded-models', 'model-memory'], keywords: ['memory', 'resident', 'loaded', 'unload', 'ram', 'vram', 'free memory', 'what is loaded', 'ollama', 'lm studio', 'hugging face', 'lora', 'delete model', 'disk'] },+ { id: 'nav.models.subscriptions', path: '/models/subscriptions', label: 'Subscriptions', section: 'Models', tabId: 'subscriptions', navGroup: 'Operate', aliases: ['subscriptions', 'subscription', 'plans', 'ai-subscriptions', 'my-plans', 'model-subscriptions', 'billing', 'ai-billing'], keywords: ['plan', 'price', 'spend', 'cost', 'billing', 'enable', 'disable', 'claude max', 'chatgpt plus', 'pro', 'tier', 'savings', 'quota', 'usage', 'quotas'] },+ { id: 'nav.settings.local-llm-playground', path: '/local-llm/playground', label: 'Playground', section: 'Models', tabId: 'playground', navGroup: 'Evaluate', aliases: ['llm-playground', 'playground', 'model-playground', 'compare-models'], keywords: ['ollama', 'lm studio', 'compare', 'benchmark', 'chat', 'test model', 'ttft', 'tokens per second', 'local llm'] },{ id: 'nav.settings.mortalloom', path: '/settings/mortalloom', label: 'MortalLoom', section: 'Settings', tabId: 'mortalloom', feature: 'health', aliases: ['settings-mortalloom', 'mortalloom'] },{ id: 'nav.settings.openclaw', path: '/openclaw', label: 'OpenClaw', section: 'Settings', tabId: 'openclaw', feature: 'openclaw', aliases: ['openclaw', 'settings-openclaw'], keywords: ['operator', 'chat', 'agent', 'runtime', 'sessions', 'streaming'] },{ id: 'nav.settings.orchestration', path: '/settings/orchestration', label: 'Orchestration Profiles', section: 'Settings', tabId: 'orchestration', aliases: ['orchestration', 'orchestration-profiles', 'cos-orchestration', 'agent-roles'], keywords: ['orchestration', 'roles', 'architect', 'implementer', 'reviewer', 'profiles', 'cos', 'reasoning'] },@@ -399,14 +397,32 @@ export const NAV_COMMANDS = RAW_NAV_COMMANDS.map((cmd) => {// or workflow overlays rather than section-level tabs.export const getSectionNavTabs = (section) => NAV_COMMANDS.filter((command) => command.section === section && command.tabId && !command.tabGroup)- .sort((a, b) => a.label.localeCompare(b.label) || a.path.localeCompare(b.path))- .map(({ tabId, label, path, feature }) => ({+ .sort((a, b) => (a.navGroup || '').localeCompare(b.navGroup || '') || a.label.localeCompare(b.label) || a.path.localeCompare(b.path))+ .map(({ tabId, label, path, feature, navGroup }) => ({id: tabId,label,to: path,...(feature ? { feature } : {}),+ ...(navGroup ? { navGroup } : {}),}));+// Grouped section navigation is derived from the same tab records as the flat+// section bar. A group is presentation metadata, never a route or a second+// destination list. Groups and their destinations are alphabetized so the+// desktop navigator, expanded sidebar, and mobile row share one stable order.+export const getSectionNavGroups = (section) => {+ const groups = new Map();+ getSectionNavTabs(section).forEach((tab) => {+ if (!tab.navGroup) return;+ const groupTabs = groups.get(tab.navGroup) || [];+ groupTabs.push(tab);+ groups.set(tab.navGroup, groupTabs);+ });+ return [...groups.entries()]+ .sort(([a], [b]) => a.localeCompare(b))+ .map(([label, tabs]) => ({ label, tabs }));+};+// `tabGroup` marks the destinations that make up ONE page's own local tab bar// (Brain, Calendar, CoS, Digital Twin, Goals, Insights, Media Gen, MeatSpace,// Messages, Music, Privacy, Sharing, System Resources, Wiki) — a different axis@@ -428,6 +444,15 @@ export const getPageNavTabs = (group) => NAV_COMMANDS...(feature ? { feature } : {}),}));+export const getSectionNavTabForPath = (section, pathname) => {+ const normalizedPath = normalizedNavPath(pathname);+ const tabs = getSectionNavTabs(section);+ return tabs.find((tab) => normalizedNavPath(tab.to) === normalizedPath)+ || [...tabs]+ .sort((a, b) => normalizedNavPath(b.to).length - normalizedNavPath(a.to).length)+ .find((tab) => pathContainsNavRoute(normalizedPath, normalizedNavPath(tab.to)));+};+const normalizedNavPath = (pathname) => {const barePath = String(pathname || '').split(/[?#]/)[0];if (!barePath || barePath === '/') return '/';@@ -459,6 +484,8 @@ const navCommandForPath = (pathname, predicate) => {?.command;};+export const getNavCommandForPath = (pathname) => navCommandForPath(pathname, () => true);+// Find the section whose tab owns a routed page, intentionally ignoring workflow// commands such as `/ai/fleet` that do not carry a `tabId`.export const getNavSectionForPath = (pathname) => (@@ -518,6 +545,9 @@ for (const cmd of NAV_COMMANDS) {if (cmd.tabGroup !== undefined && !cmd.tabId) {throw new Error(`navManifest: tabGroup requires tabId — ${cmd.id} declares tabGroup "${cmd.tabGroup}" with no tabId`);}+ if (cmd.navGroup !== undefined && (typeof cmd.navGroup !== 'string' || !cmd.navGroup.trim())) {+ throw new Error(`navManifest: navGroup must be a non-empty string — got "${cmd.navGroup}" for ${cmd.id}`);+ }if (cmd.tabLabel !== undefined && (typeof cmd.tabLabel !== 'string' || !cmd.tabLabel.trim())) {throw new Error(`navManifest: tabLabel must be a non-empty string — got "${cmd.tabLabel}" for ${cmd.id}`);}diff --git a/server/lib/navManifest.test.js b/server/lib/navManifest.test.jsindex a774137c49..edca2cbda8 100644--- a/server/lib/navManifest.test.js+++ b/server/lib/navManifest.test.js@@ -9,6 +9,8 @@ import {getNavAliasMap,getNavPageForPath,getNavSectionForPath,+ getSectionNavGroups,+ getSectionNavTabForPath,getSectionNavTabs,resolveNavCommand,} from './navManifest.js';@@ -35,11 +37,7 @@ const SETTINGS_PAGE = path.join(REPO_ROOT, 'client/src/pages/Settings.jsx');// every manifest tab in its `tabGroup` instead.const TABBED_PAGES = [{ prefix: '/settings', section: 'Settings', file: 'client/src/components/settings/SettingsTabsHeader.jsx', kind: 'section', constName: 'TABS' },- { prefix: '/models', section: 'Models', file: 'client/src/components/models/ModelsTabsHeader.jsx', kind: 'section', constName: 'TABS',- nestedIdSources: [- { parent: 'decision-classifiers', file: 'client/src/components/models/DecisionClassifiers.jsx', constName: 'CLASSIFIERS' },- { parent: 'llms', file: 'client/src/components/settings/LocalLlmTab.jsx', constName: 'LLM_NAV_SUBROUTES' },- ] },+ { prefix: '/models', section: 'Models', file: 'client/src/components/models/ModelsTabsHeader.jsx', kind: 'section', constName: 'TABS' },// POST's morse tab has routed `:mode` sub-pages (/post/morse/copy|send) and the// memory tab has the Elements study sub-page (/post/memory/elements) plus its// own routed practice modes — none are top-level switch cases, so declare their@@ -158,12 +156,28 @@ describe('nav contract — generated section child navigation', () => {it('keeps moved Providers and Usage destinations in the Models child nav', () => {expect(getSectionNavTabs('Models').filter((tab) => ['providers', 'usage'].includes(tab.id))).toEqual([- { id: 'providers', label: 'Providers', to: '/ai/presets' },- { id: 'usage', label: 'Usage', to: '/devtools/usage' },+ { id: 'providers', label: 'Providers', to: '/ai/presets', navGroup: 'Connect' },+ { id: 'usage', label: 'Usage', to: '/devtools/usage', navGroup: 'Operate' },]);expect(getSectionNavTabs('Settings').some((tab) => tab.id === 'providers')).toBe(false);});+ it('keeps Models groups and destinations in the design order', () => {+ expect(getSectionNavGroups('Models').map(({ label, tabs }) => [label, tabs.map((tab) => tab.label)])).toEqual([+ ['Connect', ['AI Services', 'Harnesses', 'Providers', 'Runtimes']],+ ['Evaluate', ['Comparison', 'Performance', 'Playground']],+ ['Library', ['3D', 'Embeddings', 'LoRAs', 'Media', 'Model Library', 'Training']],+ ['Operate', ['Quota Burn', 'Status', 'Subscriptions', 'Usage']],+ ['Policies', ['Abuse Guard', 'Code Reviewers', 'Jev decision scorer']],+ ]);+ });++ it('resolves a promoted drill-down as itself instead of its LLM parent', () => {+ expect(getSectionNavTabForPath('Models', '/models/llms/abuse')).toMatchObject({ id: 'abuse', label: 'Abuse Guard' });+ expect(getSectionNavTabForPath('Models', '/models/llms/jev')).toMatchObject({ id: 'jev', label: 'Jev decision scorer' });+ expect(getSectionNavTabForPath('Models', '/models/training/dataset-abc')).toMatchObject({ id: 'training' });+ });+it.each([['/ai/presets', 'Models'],['/ai/presets/example-provider', 'Models'],@@ -186,7 +200,7 @@ describe('nav contract — generated section child navigation', () => {// they still hold on the old pill — has to keep landing on the same page.describe('nav contract — Models → Runtimes', () => {it('is a Models section tab at its canonical path', () => {- expect(getSectionNavTabs('Models')).toContainEqual({ id: 'llms-runtimes', label: 'Runtimes', to: '/models/llms-runtimes' });+ expect(getSectionNavTabs('Models')).toContainEqual({ id: 'llms-runtimes', label: 'Runtimes', to: '/models/llms-runtimes', navGroup: 'Connect' });});it.each(['runtimes', 'llm runtimes', 'local runtimes', 'llama server'])(@@ -222,7 +236,7 @@ describe('nav contract — Models → Runtimes', () => {// the parent's name) would put the neutral fallback wording on every card.describe('getNavPageForPath', () => {it.each([- ['/models/llms', 'Models → LLMs', 'LLMs'],+ ['/models/llms', 'Models → Model Library', 'Model Library'],['/models/llms-runtimes', 'Models → Runtimes', 'Runtimes'],// Longest-match: a drill-down names itself, not the tab that hosts it.['/models/llms/abuse', 'Models → Abuse Guard', 'Abuse Guard'],