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: hide the jev tab pill while the jev feature is disabled

[._.]/ Adam Eivyc0c19ac45763
diff --git a/client/src/components/settings/LocalLlmTab.jsx b/client/src/components/settings/LocalLlmTab.jsx
index 283c993bf6..5fbd486e00 100644
--- a/client/src/components/settings/LocalLlmTab.jsx
+++ b/client/src/components/settings/LocalLlmTab.jsx
@@ -1,6 +1,7 @@
import { useNavigate } from 'react-router';
import { Download, Scale, 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';
@@ -8,7 +9,7 @@ import LocalLlmLibraryView from './LocalLlmLibraryView.jsx';
export const LLM_VIEWS = [
{ id: 'library', label: 'Model Library', icon: Download },
{ id: 'abuse', label: 'Abuse Guard', icon: ShieldCheck },
- { id: 'jev', label: 'jev', icon: Scale },
+ { id: 'jev', label: 'jev', icon: Scale, feature: 'jev' },
];
// Palettable LLM drill-downs. Model Library stays a focused view of
@@ -29,13 +30,22 @@ export const LLM_NAV_SUBROUTES = [
// subscribes to) exactly what it renders, leaving one subscriber per event.
export function LocalLlmTab({ view }) {
const navigate = useNavigate();
+ const { isFeatureEnabled } = useInstanceFeatures();
+ // Resolved against the FULL list, never the visible one: a disabled feature
+ // hides the pill but leaves the route live, so a bookmark, a shared link, or
+ // voice `ui_navigate` still lands on the panel (client/src/lib/navFeatures.js)
+ // — and the pill stays visible while that panel is the one on screen.
const activeView = LLM_VIEWS.some(({ id }) => id === view) ? view : 'library';
+ // The same gate the sidebar and ⌘K apply to the manifest. Without it a
+ // default-off feature still advertises itself here — for jev, a ~9 GB
+ // download the install has not opted into.
+ const visibleViews = LLM_VIEWS.filter((tab) => tab.id === activeView || isFeatureEnabled(tab.feature));
return (
<div className="space-y-4">
<div className="space-y-2">
<TabPills
- tabs={LLM_VIEWS}
+ tabs={visibleViews}
activeTab={activeView}
onChange={(nextView) => navigate(`/models/llms/${nextView}`)}
variant="pills"
diff --git a/client/src/components/settings/LocalLlmTab.test.jsx b/client/src/components/settings/LocalLlmTab.test.jsx
index 72f52be4ad..2548179dc3 100644
--- a/client/src/components/settings/LocalLlmTab.test.jsx
+++ b/client/src/components/settings/LocalLlmTab.test.jsx
@@ -19,6 +19,14 @@ vi.mock('../models/ModelAbuseGuardPanel.jsx', () => ({
vi.mock('../models/JevPanel.jsx', () => ({
default: () => <div data-testid="jev-view">jev</div>,
}));
+// jev is an optional, default-OFF instance feature, so 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';
@@ -36,6 +44,7 @@ const renderTab = (view) => render(
beforeEach(() => {
vi.clearAllMocks();
+ disabledFeatures.clear();
});
describe('LocalLlmTab view dispatch', () => {
@@ -78,6 +87,29 @@ describe('LocalLlmTab view dispatch', () => {
expect(screen.getByTestId('location')).toHaveTextContent('/models/llms/jev');
});
+ // Settings > Features ships jev OFF, precisely so a fresh install does not
+ // advertise a page whose model is a ~9 GB download. The manifest entry is
+ // feature-tagged, so the sidebar and ⌘K already drop it; the pill bar is the
+ // third browse surface and has to apply the same gate or the opt-out leaks.
+ it('drops the jev pill while the feature is disabled', () => {
+ disabledFeatures.add('jev');
+ renderTab();
+
+ expect(screen.getAllByRole('tab').map((t) => t.textContent)).toEqual(['Model Library', 'Abuse Guard']);
+ });
+
+ // Gating covers BROWSE surfaces only. A bookmark, a shared link, or voice
+ // `ui_navigate` still resolves /models/llms/jev, so the panel must mount —
+ // and its pill must stay visible while it is the one on screen, or the tab
+ // bar would render with nothing selected.
+ it('still mounts jev from a direct URL while the feature is disabled', () => {
+ disabledFeatures.add('jev');
+ renderTab('jev');
+
+ expect(screen.getByTestId('jev-view')).toBeInTheDocument();
+ expect(screen.getAllByRole('tab').map((t) => t.textContent)).toEqual(['Model Library', 'Abuse Guard', 'jev']);
+ });
+
it('describes the selected panel under the pills', () => {
renderTab('library');