From 98d7166ab3706b64ed377b32483a1149f7b6eb32 Mon Sep 17 00:00:00 2001 From: lofyer Date: Tue, 11 Aug 2026 23:04:41 +0800 Subject: [PATCH] feat: organize MCP settings into tabs --- src/renderer/src/McpSettingsSection.tsx | 107 ++++++++++++++---- src/renderer/src/SettingsPanel.test.tsx | 52 +++++++-- .../src/i18n/locales/en-US/integrations.ts | 10 +- .../src/i18n/locales/zh-CN/integrations.ts | 10 +- src/renderer/src/styles.css | 1 + 5 files changed, 143 insertions(+), 37 deletions(-) diff --git a/src/renderer/src/McpSettingsSection.tsx b/src/renderer/src/McpSettingsSection.tsx index 554c297..5ae3fd2 100644 --- a/src/renderer/src/McpSettingsSection.tsx +++ b/src/renderer/src/McpSettingsSection.tsx @@ -32,8 +32,10 @@ import type { } from '../../shared/capability-contracts' import { trapTabFocus } from './dialog-focus' import { SettingsCategoryHeader } from './SettingsPrimitives' +import { PageTabs } from './WorkspacePrimitives' const configurableMcpTargets: RuntimeTarget[] = ['model'] +type McpSettingsTab = 'builtin' | 'computer' | 'custom' type McpEditor = { id?: string @@ -120,6 +122,8 @@ export function McpSettingsSection(): React.JSX.Element { const [profileNames, setProfileNames] = useState>( {} ) + const [activeTab, setActiveTab] = + useState('builtin') const editorDialogRef = useRef(null) const editorNameRef = useRef(null) const editorTriggerRef = useRef( @@ -370,6 +374,12 @@ export function McpSettingsSection(): React.JSX.Element { } const computerCapabilities = snapshot?.computerCapabilities ?? [] + const visibleComputerCapabilities = computerCapabilities.filter( + (capability) => + activeTab === 'builtin' + ? capability.id === 'host-browser-control' + : capability.id !== 'host-browser-control' + ) const browserProfiles = snapshot?.browserProfiles ?? { profiles: [], defaultProfileId: null @@ -385,48 +395,86 @@ export function McpSettingsSection(): React.JSX.Element { <> - openEditor({ ...emptyEditor }, event.currentTarget) - } - type="button" - > -