Skip to content

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

fix(client): remove non-standard secondary desktop sidebar nav for Models section

[._.]/ Adam Eivy6a987421baa5
diff --git a/client/src/components/models/ModelsTabsHeader.jsx b/client/src/components/models/ModelsTabsHeader.jsx
index 100fdad0ea..2c32e3b6aa 100644
--- a/client/src/components/models/ModelsTabsHeader.jsx
+++ b/client/src/components/models/ModelsTabsHeader.jsx
@@ -1,13 +1,9 @@
-import { NavLink, useLocation } from 'react-router';
+import { 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.
//
@@ -24,94 +20,25 @@ import { useSidebarContext } from '../SidebarContext.jsx';
// Models is a gallery of generated meshes, and `/3d` is the render flow that
// consumes the runtimes listed here.
//
-// 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');
-
-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;
-
+export function ModelsSectionLayout({ children }) {
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>
- );
-}
-
-// Keep the collapsed-sidebar destination list beside the route's content.
-// Legacy Models destinations render their own page shells, so this layout is
-// shared with `/models` to keep the desktop navigation from becoming a tall
-// block above the page body.
-export function ModelsSectionLayout({ activeTab, children }) {
- return (
- <div className="flex h-full min-h-0 min-w-0 overflow-hidden">
- <ModelsDesktopNavigator activeTab={activeTab} />
- <div className="flex h-full min-h-0 min-w-0 flex-1 flex-col">
- {children}
- </div>
+ <div className="flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden">
+ {children}
</div>
);
}
-export default function ModelsTabsHeader({ activeTab, desktop = true }) {
+export default function ModelsTabsHeader({ activeTab }) {
const { pathname } = useLocation();
const resolvedActiveTab = activeTabForPath(pathname, activeTab);
- return (
- <>
- {desktop && <ModelsDesktopNavigator activeTab={resolvedActiveTab} />}
- <div className="lg:hidden">
- <SectionTabsHeader activeTab={resolvedActiveTab} fallbackSection="Models" />
- </div>
- </>
- );
+ return <SectionTabsHeader activeTab={resolvedActiveTab} fallbackSection="Models" />;
}
diff --git a/client/src/pages/AIProviders.jsx b/client/src/pages/AIProviders.jsx
index b353e6a699..07c01f69fb 100644
--- a/client/src/pages/AIProviders.jsx
+++ b/client/src/pages/AIProviders.jsx
@@ -763,7 +763,7 @@ export default function AIProviders() {
return (
<ModelsSectionLayout activeTab="providers">
<PageHeader icon={Bot} title="AI Providers" />
- <ModelsTabsHeader activeTab="providers" desktop={false} />
+ <ModelsTabsHeader activeTab="providers" />
<div className="min-h-0 min-w-0 flex-1 overflow-auto p-4">
<PageSkeleton header="none" label="Loading providers" layout="grid" cards={4} />
</div>
@@ -823,7 +823,7 @@ export default function AIProviders() {
<ModelsSectionLayout activeTab="providers">
<PageHeader icon={Bot} title="AI Providers" actions={headerActions} />
- <ModelsTabsHeader activeTab="providers" desktop={false} />
+ <ModelsTabsHeader activeTab="providers" />
<div className="px-4 pt-3">
<ProviderPageTabs activeTab={activeTab} />
</div>
diff --git a/client/src/pages/LocalLlmPlayground.jsx b/client/src/pages/LocalLlmPlayground.jsx
index 30a92807cc..af6746171c 100644
--- a/client/src/pages/LocalLlmPlayground.jsx
+++ b/client/src/pages/LocalLlmPlayground.jsx
@@ -533,7 +533,7 @@ export default function LocalLlmPlayground() {
{/* This page keeps its own `/local-llm/playground` path (it predates the
Models section and lives in ⌘K history), so without the section's tab
bar arriving here would strand the user outside it. */}
- <ModelsTabsHeader activeTab="playground" desktop={false} />
+ <ModelsTabsHeader activeTab="playground" />
<div className="min-h-0 min-w-0 flex-1 overflow-auto p-4 space-y-4">
<div className="grid grid-cols-1 xl:grid-cols-[320px_1fr] gap-4">
diff --git a/client/src/pages/Models.jsx b/client/src/pages/Models.jsx
index d30184fb10..cc4c0ecd41 100644
--- a/client/src/pages/Models.jsx
+++ b/client/src/pages/Models.jsx
@@ -119,7 +119,7 @@ export default function Models({ fixedTab, fixedRecordId } = {}) {
<ModelsSectionLayout activeTab={activeTab}>
<PageHeader icon={DestinationIcon} title={destination?.label || 'Models'} />
- <ModelsTabsHeader activeTab={activeTab} desktop={false} />
+ <ModelsTabsHeader activeTab={activeTab} />
<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
diff --git a/client/src/pages/Models.test.jsx b/client/src/pages/Models.test.jsx
index be5c63a625..479838c8d2 100644
--- a/client/src/pages/Models.test.jsx
+++ b/client/src/pages/Models.test.jsx
@@ -8,10 +8,9 @@
*/
import { describe, it, expect, vi } from 'vitest';
-import { fireEvent, render, screen, within } from '@testing-library/react';
+import { render, screen, within } from '@testing-library/react';
import { MemoryRouter, Route, Routes } from 'react-router';
-import { ModelsDesktopNavigator, TABS } from '../components/models/ModelsTabsHeader';
-import SidebarContext from '../components/SidebarContext';
+import { TABS } from '../components/models/ModelsTabsHeader';
vi.mock('../components/settings/LocalModelAssessments.jsx', () => ({
default: ({ taskView, assessmentKey }) => (
@@ -175,31 +174,6 @@ 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: 'Decision Classifiers' }));
- expect(within(nav).getByRole('link', { name: 'Decision Classifiers' })).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
diff --git a/client/src/pages/UsagePage.jsx b/client/src/pages/UsagePage.jsx
index f0f8c2b8ab..6bf017407d 100644
--- a/client/src/pages/UsagePage.jsx
+++ b/client/src/pages/UsagePage.jsx
@@ -900,7 +900,7 @@ function InternalUsageMetrics() {
export function UsagePage() {
return (
<ModelsSectionLayout activeTab="usage">
- <ModelsTabsHeader activeTab="usage" desktop={false} />
+ <ModelsTabsHeader activeTab="usage" />
<div className="min-h-0 min-w-0 flex-1 space-y-6 overflow-auto">
<ProviderQuotaSection />
<InternalUsageMetrics />