Commit 10f173b25 for llama.cpp
commit 10f173b253173e9cca4e81a4803a0f01989d1b29
Author: Emanuil Rusev <hello@erusev.com>
Date: Wed Nov 18 14:26:31 2026 +0200
ui: hide Models and MCP behind settings, off by default (#32527)
* ui: hide Models and MCP behind settings, off by default
Two new settings in General, "Show Models" and "Show MCP", both off by default, like "Enable Discover Models". The WebUI is often the first thing people new to local models see, and most of them don't need a models manager or know what MCP is.
"Show MCP" only hides the way to manage MCP; servers already added keep working. Turning MCP off for real would mean gating every place that reads the server list (health checks, tool groups, prompts, avatars). Anyone who already has servers saved gets MCP shown, so they don't lose the way to manage them.
With Models hidden, every entry point to the manager goes: the sidebar, search, the shortcut and "Manage models" in the selector -- it opens the same full manager. The /models page still opens by its URL, which apps link to. On a single-model server the selector chip used to open the manager; with it hidden, the chip is a plain label.
* ui: keep Models shown while Discover Models is on
Discover opens only from the Models page (its header button and the manager's row actions), so with Models hidden by default, checking Discover showed nothing. Checking Discover now shows Models too and locks its checkbox, the same way it already locks the Hugging Face Hub API one; unchecking Discover leaves Models as it is. Saved configs with Discover on get Models turned on when they load, so people who use Discover don't lose it.
diff --git a/ui/apps/chat/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionAdd/ChatFormActionAddToolsSubmenu.svelte b/ui/apps/chat/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionAdd/ChatFormActionAddToolsSubmenu.svelte
index 3e152f44c..ce32bdf31 100644
--- a/ui/apps/chat/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionAdd/ChatFormActionAddToolsSubmenu.svelte
+++ b/ui/apps/chat/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActionAdd/ChatFormActionAddToolsSubmenu.svelte
@@ -6,7 +6,7 @@
import { Check, ChevronDown, ChevronRight, Info, Loader2, PencilRuler } from '@lucide/svelte';
import { ATTACHMENT_MENU_TEXT, CLI_FLAGS, ICON_CLASS_DEFAULT } from '#lib/constants/index.ts';
import { useToolsPanel } from '#lib/hooks/use-tools-panel.svelte.ts';
- import { mcpStore, toolsStore } from '#lib/stores/index.ts';
+ import { mcpStore, toolsStore, uiStore } from '#lib/stores/index.ts';
import type { ToolGroup } from '#lib/types/index.ts';
const toolsPanel = useToolsPanel();
@@ -40,15 +40,18 @@
</span>
</span>
- <span class="flex gap-2">
- <Info class="mt-0.5 {ICON_CLASS_DEFAULT} shrink-0" />
+ <!-- only while MCP shows: with it hidden, there is nowhere to add a server -->
+ {#if uiStore.isMcpShown}
+ <span class="flex gap-2">
+ <Info class="mt-0.5 {ICON_CLASS_DEFAULT} shrink-0" />
- <span>
- {hasMcpServersAvailable ? 'Enable' : 'Add'} MCP Server(s) to access
+ <span>
+ {hasMcpServersAvailable ? 'Enable' : 'Add'} MCP Server(s) to access
- <strong>MCP Tools</strong>.
+ <strong>MCP Tools</strong>.
+ </span>
</span>
- </span>
+ {/if}
</div>
{:else if toolsStore.error}
<div class="px-3 py-4 text-center text-sm text-muted-foreground">Failed to load tools</div>
diff --git a/ui/apps/chat/src/lib/components/app/dialogs/DialogSearch.svelte b/ui/apps/chat/src/lib/components/app/dialogs/DialogSearch.svelte
index 9df54c530..2b4e0b71d 100644
--- a/ui/apps/chat/src/lib/components/app/dialogs/DialogSearch.svelte
+++ b/ui/apps/chat/src/lib/components/app/dialogs/DialogSearch.svelte
@@ -11,7 +11,7 @@
} from '#lib/constants/index.ts';
import { KeyboardKey, SidebarAction } from '#lib/enums/index.ts';
import { RouterService } from '#lib/services/router.service.ts';
- import { conversationsStore, deviceStore } from '#lib/stores/index.ts';
+ import { conversationsStore, deviceStore, uiStore } from '#lib/stores/index.ts';
import { formatRelativeTime, isIMEComposing } from '#lib/utils/index.ts';
import { goto } from '$app/navigation';
import type { Component } from 'svelte';
@@ -71,13 +71,14 @@
);
const actionEntries = $derived.by((): SearchEntry[] =>
- // every sidebar action but Search itself, which is what opened this dialog, and the models
- // manager on a phone, which picks its models in the selector
+ // every sidebar action the sidebar shows but Search itself, which is what opened this
+ // dialog, and the models manager on a phone, which picks its models in the selector
[...SIDEBAR_ACTIONS_ITEMS, ...SIDEBAR_FOOTER_ITEMS]
.filter(
(item) =>
item.action &&
item.action !== SidebarAction.SEARCH &&
+ uiStore.isSidebarActionShown(item.action) &&
(item.action !== SidebarAction.MANAGE_MODELS || !deviceStore.isMobile)
)
.map((item) => ({
diff --git a/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelector.svelte b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelector.svelte
index ba8741883..3b24b83a0 100644
--- a/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelector.svelte
+++ b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelector.svelte
@@ -388,7 +388,8 @@
</ModelsSelectorDrawer>
{:else}
<!-- a lone llama.cpp server has nothing to choose from: the trigger opens the
- manager instead, so the button is its own affordance -->
+ manager instead, so the button is its own affordance. With the manager hidden
+ there is nothing to open, so it is only a label: no pointer, hover or focus -->
<Tooltip.Root>
<Tooltip.Trigger>
<!-- prevent another nested button element -->
@@ -396,7 +397,10 @@
<button
{...props}
class={[
- `inline-flex cursor-pointer items-center gap-1.5 rounded-sm bg-background px-1.5 py-1 text-xs shadow-(--chat-form-key-shadow) transition hover:bg-muted-foreground/20 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60 dark:bg-muted-foreground/15 dark:text-secondary-foreground`,
+ `inline-flex items-center gap-1.5 rounded-sm bg-background px-1.5 py-1 text-xs shadow-(--chat-form-key-shadow) transition focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60 dark:bg-muted-foreground/15 dark:text-secondary-foreground`,
+ uiStore.isModelsManagerShown
+ ? 'cursor-pointer hover:bg-muted-foreground/20'
+ : 'cursor-default',
!ms.isCurrentModelInCache
? 'bg-surface-danger text-fg-danger! hover:bg-surface-danger/80 hover:text-fg-danger'
: forceForegroundText
@@ -405,8 +409,9 @@
isOpen && 'text-foreground'
]}
disabled={disabled || ms.updating}
- onclick={() => ms.handleOpenChange(true)}
+ onclick={uiStore.isModelsManagerShown ? () => ms.handleOpenChange(true) : undefined}
style="max-width: min(calc(100cqw - 6.5rem), 32rem)"
+ tabindex={uiStore.isModelsManagerShown ? undefined : -1}
>
<ModelsSelectorTriggerIcon
class="mr-0.375 size-icon-sm shrink-0"
diff --git a/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorDropdown.svelte b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorDropdown.svelte
index c8900aa64..7372f366a 100644
--- a/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorDropdown.svelte
+++ b/ui/apps/chat/src/lib/components/app/models/ModelsSelector/ModelsSelectorDropdown.svelte
@@ -194,6 +194,7 @@
>
<DropdownMenuSearchable
emptyMessage={ms.emptyMessage}
+ footer={uiStore.isModelsManagerShown ? manageModelsFooter : undefined}
isEmpty={ms.isEmpty && ms.isCurrentModelInCache}
onSearchChange={(v) => ms.setSearchTerm(v)}
{onSearchKeyDown}
@@ -204,20 +205,21 @@
<!-- Option list; the search header sticks to the top and the actions
footer to the bottom of the content scrollport. -->
{@render pickerContent('px-1.5')}
-
- {#snippet footer()}
- <DropdownMenu.Group class="px-2">
- <DropdownMenu.Item class="gap-2" onSelect={handleManageModels}>
- <MODEL_ICON class="size-icon-md shrink-0 text-muted-foreground" />
-
- Manage models
- </DropdownMenu.Item>
- </DropdownMenu.Group>
- {/snippet}
</DropdownMenuSearchable>
</DropdownMenu.Content>
</DropdownMenu.Root>
+<!-- the way into the full manager, so it hides with the manager's other entry points -->
+{#snippet manageModelsFooter()}
+ <DropdownMenu.Group class="px-2">
+ <DropdownMenu.Item class="gap-2" onSelect={handleManageModels}>
+ <MODEL_ICON class="size-icon-md shrink-0 text-muted-foreground" />
+
+ Manage models
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+{/snippet}
+
{#snippet pickerContent(listClass: string)}
<div class={['models-list', listClass]}>
{#if !ms.isCurrentModelInCache && currentModel}
diff --git a/ui/apps/chat/src/lib/components/app/navigation/SidebarNavigation/SidebarNavigationActions.svelte b/ui/apps/chat/src/lib/components/app/navigation/SidebarNavigation/SidebarNavigationActions.svelte
index 165fb0ebe..c9c6c2bc5 100644
--- a/ui/apps/chat/src/lib/components/app/navigation/SidebarNavigation/SidebarNavigationActions.svelte
+++ b/ui/apps/chat/src/lib/components/app/navigation/SidebarNavigation/SidebarNavigationActions.svelte
@@ -8,7 +8,7 @@
SIDEBAR_ACTIONS_ITEMS
} from '#lib/constants/index.ts';
import { SidebarAction } from '#lib/enums/index.ts';
- import { deviceStore } from '#lib/stores/index.ts';
+ import { deviceStore, uiStore } from '#lib/stores/index.ts';
import type { DesktopIconStripItem } from '#lib/types/index.ts';
import { hapticTap } from '#lib/utils/index.ts';
import { goto } from '$app/navigation';
@@ -30,12 +30,14 @@
let { class: className, items = SIDEBAR_ACTIONS_ITEMS, onAction, onNavigate }: Props = $props();
// the models manager stays desktop-only: a phone picks its models in the selector; a phone
- // reaches search from the round key at the top of the sidebar instead
+ // reaches search from the round key at the top of the sidebar instead. Models and MCP
+ // wait behind their settings
const actions = $derived(
items.filter(
(item) =>
- !deviceStore.isMobile ||
- (item.action !== SidebarAction.MANAGE_MODELS && item.action !== SidebarAction.SEARCH)
+ uiStore.isSidebarActionShown(item.action) &&
+ (!deviceStore.isMobile ||
+ (item.action !== SidebarAction.MANAGE_MODELS && item.action !== SidebarAction.SEARCH))
)
);
let initialized = $state(false);
diff --git a/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChat.svelte b/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChat.svelte
index 1ced25e50..38452cbb9 100644
--- a/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChat.svelte
+++ b/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChat.svelte
@@ -97,6 +97,10 @@
// unchecking it turns the hub back off, so the checkbox never lies
if (key === SETTINGS_KEYS.ENABLE_DISCOVER_MODELS) {
localConfig[SETTINGS_KEYS.USE_HUGGING_FACE_HUB] = value === true;
+
+ // it opens from the Models page, so checking it shows Models too; unchecking it
+ // leaves Models as it is, since Models is useful without it
+ if (value === true) localConfig[SETTINGS_KEYS.SHOW_MODELS_MANAGER] = true;
}
}
diff --git a/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChatFields.svelte b/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChatFields.svelte
index 324fc5219..4dc97756d 100644
--- a/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChatFields.svelte
+++ b/ui/apps/chat/src/lib/components/app/settings/SettingsChat/SettingsChatFields.svelte
@@ -27,11 +27,15 @@
let { fields, localConfig, onConfigChange, onThemeChange }: Props = $props();
- // discover needs the hub metadata reads, so its checkbox is read-only while discover is on
- let hubLocked = $derived(Boolean(localConfig[SETTINGS_KEYS.ENABLE_DISCOVER_MODELS]));
+ // discover needs the hub metadata reads, and opens from the Models page, so both checkboxes
+ // are read-only while discover is on
+ let discoverOn = $derived(Boolean(localConfig[SETTINGS_KEYS.ENABLE_DISCOVER_MODELS]));
function isLockedField(key: string): boolean {
- return hubLocked && key === SETTINGS_KEYS.USE_HUGGING_FACE_HUB;
+ return (
+ discoverOn &&
+ (key === SETTINGS_KEYS.USE_HUGGING_FACE_HUB || key === SETTINGS_KEYS.SHOW_MODELS_MANAGER)
+ );
}
let currentModelParams = $derived.by(() => {
diff --git a/ui/apps/chat/src/lib/constants/settings-keys.constants.ts b/ui/apps/chat/src/lib/constants/settings-keys.constants.ts
index c94f97ff7..03e9a39d5 100644
--- a/ui/apps/chat/src/lib/constants/settings-keys.constants.ts
+++ b/ui/apps/chat/src/lib/constants/settings-keys.constants.ts
@@ -57,6 +57,7 @@ export const SETTINGS_KEYS = {
SHOW_AGENTIC_TURN_STATS: 'showAgenticTurnStats',
SHOW_BUILD_VERSION: 'showBuildVersion',
SHOW_FULL_PATH_IN_MENTIONS: 'showFullPathInMentions',
+ SHOW_MCP: 'showMcp',
// Display
SHOW_MESSAGE_STATS: 'showMessageStats',
SHOW_MODEL_CAPABILITIES_IN_SELECTOR: 'showModelCapabilitiesInSelector',
@@ -64,6 +65,7 @@ export const SETTINGS_KEYS = {
SHOW_MODEL_ORG_NAME_ON_MOBILE: 'showModelOrgNameOnMobile',
SHOW_MODEL_QUANTIZATION: 'showModelQuantization',
SHOW_MODEL_TAGS: 'showModelTags',
+ SHOW_MODELS_MANAGER: 'showModelsManager',
SHOW_RAW_MODEL_NAMES: 'showRawModelNames',
SHOW_RAW_OUTPUT_SWITCH: 'showRawOutputSwitch',
SHOW_SYSTEM_MESSAGE: 'showSystemMessage',
diff --git a/ui/apps/chat/src/lib/constants/settings.constants.ts b/ui/apps/chat/src/lib/constants/settings.constants.ts
index 669ccd6ec..f3b4b2af4 100644
--- a/ui/apps/chat/src/lib/constants/settings.constants.ts
+++ b/ui/apps/chat/src/lib/constants/settings.constants.ts
@@ -149,7 +149,14 @@ export const SETTINGS_REGISTRY: SettingsSectionEntry[] = [
},
{
defaultValue: false,
- help: 'Show the Discover Models sidebar action to browse and download HuggingFace GGUF models. Turns the Hugging Face Hub API on while it is enabled. Only available in router mode.',
+ help: 'Show Models in the sidebar and "Manage models" in the model selector, to see, load and configure the models on the server.',
+ key: SETTINGS_KEYS.SHOW_MODELS_MANAGER,
+ label: 'Show Models',
+ type: SettingsFieldType.CHECKBOX
+ },
+ {
+ defaultValue: false,
+ help: 'Show Discover Models on the Models page, to browse and download HuggingFace GGUF models. Turns Models and the Hugging Face Hub API on while it is enabled. Only available in router mode.',
key: SETTINGS_KEYS.ENABLE_DISCOVER_MODELS,
label: 'Enable Discover Models',
type: SettingsFieldType.CHECKBOX
@@ -161,6 +168,13 @@ export const SETTINGS_REGISTRY: SettingsSectionEntry[] = [
label: 'Use the Hugging Face Hub API',
type: SettingsFieldType.CHECKBOX
},
+ {
+ defaultValue: false,
+ help: 'Show MCP in the sidebar, to add and manage MCP servers. Servers already added keep working while it is hidden.',
+ key: SETTINGS_KEYS.SHOW_MCP,
+ label: 'Show MCP',
+ type: SettingsFieldType.CHECKBOX
+ },
{
defaultValue: true,
help: 'Choose how conversation titles are generated. The first non-empty line uses a fast deterministic rule; the LLM option uses a model-generated title from the first message exchange.',
diff --git a/ui/apps/chat/src/lib/hooks/use-tools-panel.svelte.ts b/ui/apps/chat/src/lib/hooks/use-tools-panel.svelte.ts
index c5f1303ab..b420d3937 100644
--- a/ui/apps/chat/src/lib/hooks/use-tools-panel.svelte.ts
+++ b/ui/apps/chat/src/lib/hooks/use-tools-panel.svelte.ts
@@ -1,6 +1,6 @@
import { CLI_FLAGS } from '#lib/constants/index.ts';
import { ToolSource } from '#lib/enums/index.ts';
-import { conversationsStore, mcpStore, toolsStore } from '#lib/stores/index.ts';
+import { conversationsStore, mcpStore, toolsStore, uiStore } from '#lib/stores/index.ts';
import type { ToolEntry, ToolGroup } from '#lib/types/index.ts';
import { SvelteSet } from 'svelte/reactivity';
@@ -47,15 +47,20 @@ export function useToolsPanel(): UseToolsPanelReturn {
if (toolsStore.toolGroups.length > 0) return null;
+ // the MCP half only while MCP shows: with it hidden, there is nowhere to add a server
+ const mcpHint = uiStore.isMcpShown
+ ? ' To see MCP Tools you need to add / enable MCP Server(s).'
+ : '';
+
// Tools endpoint unreachable (403) — server started without tools
if (toolsStore.isToolsEndpointUnreachable) {
- return `To enable Server Tools you need to run llama-server with ${CLI_FLAGS.TOOLS} all or ${CLI_FLAGS.TOOLS} <name> flag. To see MCP Tools you need to add / enable MCP Server(s).`;
+ return `To enable Server Tools you need to run llama-server with ${CLI_FLAGS.TOOLS} all or ${CLI_FLAGS.TOOLS} <name> flag.${mcpHint}`;
}
// Other errors — return null so UI shows "Failed to load tools"
if (toolsStore.error) return null;
- return `To enable Server Tools you need to run llama-server with ${CLI_FLAGS.TOOLS} all or ${CLI_FLAGS.TOOLS} <name> flag. To see MCP Tools you need to add / enable MCP Server(s).`;
+ return `To enable Server Tools you need to run llama-server with ${CLI_FLAGS.TOOLS} all or ${CLI_FLAGS.TOOLS} <name> flag.${mcpHint}`;
});
function isGroupChecked(group: ToolGroup): boolean {
diff --git a/ui/apps/chat/src/lib/stores/settings/index.svelte.ts b/ui/apps/chat/src/lib/stores/settings/index.svelte.ts
index 0e7ad019b..4cdc095f8 100644
--- a/ui/apps/chat/src/lib/stores/settings/index.svelte.ts
+++ b/ui/apps/chat/src/lib/stores/settings/index.svelte.ts
@@ -19,6 +19,7 @@ import {
configToParameterRecord,
getConfigValue,
normalizeFloatingPoint,
+ parseMcpServerSettings,
setConfigValue
} from '#lib/utils/index.ts';
import { browser } from '$app/env';
@@ -421,15 +422,18 @@ class SettingsStore {
}
/**
- * Discover needs the hub metadata reads, so a checked Discover Models keeps
- * the hub setting on; call wherever stored or reset state may disagree.
+ * Discover needs the hub metadata reads and opens from the Models page, so a
+ * checked Discover Models keeps the hub setting and Models on; call wherever
+ * stored or reset state may disagree.
*/
private enforceDiscoverCoupling(): void {
if (
this.config[SETTINGS_KEYS.ENABLE_DISCOVER_MODELS] &&
- !this.config[SETTINGS_KEYS.USE_HUGGING_FACE_HUB]
+ (!this.config[SETTINGS_KEYS.USE_HUGGING_FACE_HUB] ||
+ !this.config[SETTINGS_KEYS.SHOW_MODELS_MANAGER])
) {
setConfigValue(this.config, SETTINGS_KEYS.USE_HUGGING_FACE_HUB, true);
+ setConfigValue(this.config, SETTINGS_KEYS.SHOW_MODELS_MANAGER, true);
this.saveConfig();
}
}
@@ -517,6 +521,15 @@ class SettingsStore {
}
}
+ // MCP shows by default for someone who already added a server, from before it moved
+ // behind its setting, so they keep the way to manage their servers
+ if (
+ !(SETTINGS_KEYS.SHOW_MCP in savedVal) &&
+ parseMcpServerSettings(savedVal[SETTINGS_KEYS.MCP_SERVERS]).length > 0
+ ) {
+ this.config[SETTINGS_KEYS.SHOW_MCP] = true;
+ }
+
// Load user overrides
this.userOverrides = new Set(savedOverrides);
}
diff --git a/ui/apps/chat/src/lib/stores/ui.svelte.ts b/ui/apps/chat/src/lib/stores/ui.svelte.ts
index a817a73ea..707648d06 100644
--- a/ui/apps/chat/src/lib/stores/ui.svelte.ts
+++ b/ui/apps/chat/src/lib/stores/ui.svelte.ts
@@ -17,6 +17,7 @@ import {
SIDEBAR_SECTION_ORDER_LOCALSTORAGE_KEY,
SIDEBAR_WIDTH_LOCALSTORAGE_KEY
} from '#lib/constants/index.ts';
+import { SidebarAction } from '#lib/enums/index.ts';
import { deviceStore } from '#lib/stores/device.svelte.ts';
import { settingsStore } from '#lib/stores/settings/index.svelte.ts';
import type { Group } from '#lib/types/groups.js';
@@ -114,11 +115,29 @@ class UiStore {
return Boolean(settingsStore.getConfig(SETTINGS_KEYS.ENABLE_DISCOVER_MODELS));
}
+ /**
+ * Whether MCP shows in the sidebar. Off by default: most people have never heard of MCP,
+ * so it waits behind its setting. Hiding it only hides the entry point: servers already
+ * added keep working.
+ */
+ get isMcpShown(): boolean {
+ return Boolean(settingsStore.getConfig(SETTINGS_KEYS.SHOW_MCP));
+ }
+
/** Whether the model details drawer is open. */
get isModelDetailsOpen(): boolean {
return this.modelDetailsFocus !== null;
}
+ /**
+ * Whether the models manager has its entry points: Models in the sidebar, "Manage models"
+ * in the selector, its shortcut. Off by default, for the same reason as MCP: the selector
+ * already picks and loads models. The page itself stays reachable by its URL.
+ */
+ get isModelsManagerShown(): boolean {
+ return Boolean(settingsStore.getConfig(SETTINGS_KEYS.SHOW_MODELS_MANAGER));
+ }
+
/** Whether the models manager route is the current page. */
get isModelsPageOpen(): boolean {
return page.route.id === MODELS_ROUTE_ID;
@@ -166,6 +185,15 @@ class UiStore {
if (this.collapsedSidebarSections.has(id)) this.toggleSidebarSection(id);
}
+ /** Whether a sidebar action shows: Models and MCP wait behind their settings. */
+ isSidebarActionShown(action: SidebarAction | undefined): boolean {
+ if (action === SidebarAction.MANAGE_MODELS) return this.isModelsManagerShown;
+
+ if (action === SidebarAction.MCP) return this.isMcpShown;
+
+ return true;
+ }
+
isSidebarSectionExpanded(id: string): boolean {
return this.expandedSidebarSections.has(id);
}
@@ -197,9 +225,9 @@ class UiStore {
this.discoverModelsOpen = true;
}
- /** Navigate to the models manager. */
+ /** Navigate to the models manager; a no-op while it is hidden. */
openModelsManager(): void {
- if (this.isModelsPageOpen) return;
+ if (!this.isModelsManagerShown || this.isModelsPageOpen) return;
void goto(ROUTES.MODELS);
}
diff --git a/ui/apps/chat/tests/client/nested-surfaces.svelte.test.ts b/ui/apps/chat/tests/client/nested-surfaces.svelte.test.ts
index f5ce33d08..302c1b6f3 100644
--- a/ui/apps/chat/tests/client/nested-surfaces.svelte.test.ts
+++ b/ui/apps/chat/tests/client/nested-surfaces.svelte.test.ts
@@ -6,7 +6,12 @@
import '../../src/app.css';
import SidebarNavigationActions from '#lib/components/app/navigation/SidebarNavigation/SidebarNavigationActions.svelte';
import SidebarNavigationFooter from '#lib/components/app/navigation/SidebarNavigation/SidebarNavigationFooter.svelte';
-import { SIDEBAR_ACTIONS_ITEMS, SIDEBAR_FOOTER_ITEMS } from '#lib/constants/index.ts';
+import {
+ SETTINGS_KEYS,
+ SIDEBAR_ACTIONS_ITEMS,
+ SIDEBAR_FOOTER_ITEMS
+} from '#lib/constants/index.ts';
+import { settingsStore } from '#lib/stores/index.ts';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { page } from 'vitest/browser';
import { render } from 'vitest-browser-svelte';
@@ -32,6 +37,10 @@ describe('nested surfaces', () => {
// the footer is a desktop's and a tablet's: a phone lists its items with the sidebar's actions
beforeEach(async () => {
await page.viewport(1280, 900);
+
+ // Models and MCP wait behind their settings: show them, so every footer row is measured
+ settingsStore.updateConfig(SETTINGS_KEYS.SHOW_MODELS_MANAGER, true);
+ settingsStore.updateConfig(SETTINGS_KEYS.SHOW_MCP, true);
});
it('round the footer group from its tokens', async () => {