From b60bdb685dd0afc1614b7dbb99037c03486a5cd8 Mon Sep 17 00:00:00 2001 From: Test Date: Sat, 7 Mar 2026 11:58:46 +0100 Subject: [PATCH] fix: MCP install command always visible in Cmd+K regardless of mcpStatus The command was gated on `mcpStatus !== 'checking'` which meant it was hidden during the initial async status check. Changed enabled to always be true so users can find and run the command immediately on app start. Co-Authored-By: Claude Opus 4.6 --- src/hooks/useCommandRegistry.test.ts | 8 ++++---- src/hooks/useCommandRegistry.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hooks/useCommandRegistry.test.ts b/src/hooks/useCommandRegistry.test.ts index a35ebdd1..b7dbafbc 100644 --- a/src/hooks/useCommandRegistry.test.ts +++ b/src/hooks/useCommandRegistry.test.ts @@ -215,18 +215,18 @@ describe('install-mcp command', () => { expect(cmd!.label).toBe('Restore MCP Server') }) - it('is disabled when mcpStatus is checking', () => { + it('is enabled even when mcpStatus is checking', () => { const config = makeConfig({ mcpStatus: 'checking', onInstallMcp: vi.fn() }) const { result } = renderHook(() => useCommandRegistry(config)) const cmd = findCommand(result.current, 'install-mcp') - expect(cmd!.enabled).toBe(false) + expect(cmd!.enabled).toBe(true) }) - it('is disabled when no handler provided', () => { + it('is enabled even when no handler provided', () => { const config = makeConfig({ mcpStatus: 'not_installed' }) const { result } = renderHook(() => useCommandRegistry(config)) const cmd = findCommand(result.current, 'install-mcp') - expect(cmd!.enabled).toBe(false) + expect(cmd!.enabled).toBe(true) }) it('has restore keyword for discoverability', () => { diff --git a/src/hooks/useCommandRegistry.ts b/src/hooks/useCommandRegistry.ts index 31115ba7..122cd1f9 100644 --- a/src/hooks/useCommandRegistry.ts +++ b/src/hooks/useCommandRegistry.ts @@ -258,7 +258,7 @@ export function useCommandRegistry(config: CommandRegistryConfig): CommandAction { id: 'remove-vault', label: 'Remove Vault from List', group: 'Settings', keywords: ['vault', 'remove', 'disconnect', 'hide'], enabled: (vaultCount ?? 0) > 1 && !!onRemoveActiveVault, execute: () => onRemoveActiveVault?.() }, { id: 'restore-getting-started', label: 'Restore Getting Started Vault', group: 'Settings', keywords: ['vault', 'restore', 'demo', 'getting started', 'reset'], enabled: !!isGettingStartedHidden && !!onRestoreGettingStarted, execute: () => onRestoreGettingStarted?.() }, { id: 'check-updates', label: 'Check for Updates', group: 'Settings', keywords: ['update', 'version', 'upgrade', 'release'], enabled: true, execute: () => onCheckForUpdates?.() }, - { id: 'install-mcp', label: mcpStatus === 'installed' ? 'Restore MCP Server' : 'Install MCP Server', group: 'Settings', keywords: ['mcp', 'claude', 'ai', 'tools', 'install', 'restore', 'fix', 'repair'], enabled: mcpStatus !== 'checking' && !!onInstallMcp, execute: () => onInstallMcp?.() }, + { id: 'install-mcp', label: mcpStatus === 'installed' ? 'Restore MCP Server' : 'Install MCP Server', group: 'Settings', keywords: ['mcp', 'claude', 'ai', 'tools', 'install', 'restore', 'fix', 'repair'], enabled: true, execute: () => onInstallMcp?.() }, { id: 'reindex-vault', label: 'Reindex Vault', group: 'Settings', keywords: ['reindex', 'index', 'search', 'rebuild', 'refresh'], enabled: !!onReindexVault, execute: () => onReindexVault?.() }, // Type-aware: "New [Type]" and "List [Type]"