diff --git a/web/src/App.svelte b/web/src/App.svelte index 0e499a7a3..ce4bd17f9 100644 --- a/web/src/App.svelte +++ b/web/src/App.svelte @@ -26,6 +26,7 @@ import Rail from './lib/Rail.svelte'; import { sessions } from './lib/sessions.svelte'; import { mcp } from './lib/settings/mcp.svelte'; + import { settingsNav } from './lib/settingsNav.svelte'; import { slotOf, type Board } from './lib/board.svelte'; import Tabs from './lib/Tabs.svelte'; import { lazy } from './lib/lazy'; @@ -46,7 +47,8 @@ /** What the palette opens with typed: `>` from ⌘⇧P, for commands only. */ let paletteStart = $state(''); let settingsOpen = $state(false); - function openSettings() { + function openSettings(section?: string) { + if (section) settingsNav.request = section; if (layout.phone) settingsOpen = true; else boards.openSettings(); } @@ -95,8 +97,8 @@ $effect(() => localStorage.setItem(RAIL_KEY, railOpen ? 'open' : 'closed')); - // The MCP store owns sign-ins beyond Settings' lifetime; a reload - // mid-sign-in resumes. + // The MCP store stays fresh even with Settings closed, so the gear button + // can show the servers that need a sign-in; a reload mid-sign-in resumes. $effect(() => { const stop = mcp.watch(); mcp.resume(); @@ -453,7 +455,15 @@ category: 'settings', label: 'open', hint: shortcut(','), - run: openSettings, + run: () => openSettings(), + }, + { + category: 'settings', + label: 'MCP servers', + detail: mcp.attention.length + ? `${mcp.attention.length} need sign-in` + : 'add, edit and sign in', + run: () => openSettings('mcp'), }, { category: 'usage', @@ -1088,10 +1098,14 @@ class="icon" class:on={!!boards.board?.windows.settings} data-settings-toggle - aria-label="Settings" + aria-label={mcp.attention.length + ? `Settings · ${mcp.attention.length} MCP server${mcp.attention.length === 1 ? '' : 's'} need you to sign in` + : 'Settings'} aria-pressed={boards.board?.selected === 'settings'} - title="Settings ({shortcut(',')})" - onclick={openSettings} + title={mcp.attention.length + ? `Settings · ${mcp.attention.length} MCP server${mcp.attention.length === 1 ? '' : 's'} need you to sign in` + : `Settings (${shortcut(',')})`} + onclick={() => openSettings()} > + {#if mcp.attention.length} + + {/if} @@ -1311,6 +1328,16 @@ width: 30px; height: 30px; padding: 0; + position: relative; + } + .attention { + position: absolute; + top: 2px; + right: 2px; + width: 7px; + height: 7px; + border-radius: 999px; + background: var(--danger); } .about { width: 24px; diff --git a/web/src/lib/Phone.svelte b/web/src/lib/Phone.svelte index d175baf7c..fe8abab75 100644 --- a/web/src/lib/Phone.svelte +++ b/web/src/lib/Phone.svelte @@ -3,6 +3,7 @@ import { layout } from './layout.svelte'; import SessionPicker from './SessionPicker.svelte'; import { sessions } from './sessions.svelte'; + import { mcp } from './settings/mcp.svelte'; // The client on a narrow screen: the session list, or one session's chat // filling the screen. A review opens inside the chat. @@ -320,7 +321,9 @@ {/if} @@ -457,6 +463,16 @@ border: 0; border-radius: 10px; cursor: pointer; + position: relative; + } + .attention { + position: absolute; + top: 4px; + right: 4px; + width: 7px; + height: 7px; + border-radius: 999px; + background: var(--danger); } .icon:active { background: var(--hover); diff --git a/web/src/lib/Settings.svelte b/web/src/lib/Settings.svelte index 89e379460..f0f776705 100644 --- a/web/src/lib/Settings.svelte +++ b/web/src/lib/Settings.svelte @@ -4,6 +4,7 @@ import ConfigurationSettings from './settings/ConfigurationSettings.svelte'; import McpSettings from './settings/McpSettings.svelte'; import { mcp } from './settings/mcp.svelte'; + import { settingsNav } from './settingsNav.svelte'; import ExtensionsView from './views/ExtensionsView.svelte'; import { sessions } from './sessions.svelte'; import WebSearchSettings from './settings/WebSearchSettings.svelte'; @@ -103,6 +104,14 @@ content?.scrollTo({ top: 0 }); } + // Another surface (the palette) can ask to open Settings on a section. + $effect(() => { + if (settingsNav.request) { + choose(settingsNav.request as Section); + settingsNav.request = null; + } + }); + export function canClose(): boolean { if (saving) return false; if (dirty || mcp.formDirty) { @@ -169,6 +178,12 @@ onclick={() => choose(section.id)} > {section.label} + {#if section.id === 'mcp' && mcp.attention.length}, {mcp.attention.length} need sign-in{/if} {#if section.id === 'configuration' && configurationDirty}●({ + request: null, +});