fix(desktop): clarify MCP configuration title

Replace the editable MCP server heading with neutral configuration copy so the settings page does not imply an update action is running.

Fixes #763

Tested: cd desktop && bun run test -- src/__tests__/mcpSettings.test.tsx
Tested: cd desktop && bun run lint
Not-tested: full verify and coverage, scoped desktop copy/test change only
Confidence: high
Scope-risk: narrow
This commit is contained in:
程序员阿江(Relakkes) 2026-06-12 12:46:05 +08:00
parent 9238481e86
commit 8a0eef4ad4
6 changed files with 39 additions and 5 deletions

View File

@ -339,6 +339,40 @@ describe('McpSettings', () => {
expect(deleteServer).toHaveBeenCalledWith(server, '/workspace/project')
})
it('uses a neutral title when configuring an editable MCP server', async () => {
const server = {
name: 'filesystem',
scope: 'user',
transport: 'stdio',
enabled: true,
status: 'connected',
statusLabel: 'Connected',
configLocation: '/tmp/config',
summary: 'npx @modelcontextprotocol/server-filesystem',
canEdit: true,
canRemove: true,
canReconnect: true,
canToggle: true,
config: {
type: 'stdio',
command: 'npx',
args: ['@modelcontextprotocol/server-filesystem'],
env: {},
},
} as const
useMcpStore.setState({ servers: [server] })
await renderLoadedMcpSettings()
await act(async () => {
fireEvent.click(screen.getByRole('button', { name: 'Open filesystem' }))
})
expect(screen.getByRole('heading', { name: 'Configure filesystem MCP' })).toBeInTheDocument()
expect(screen.queryByRole('heading', { name: 'Update filesystem MCP' })).not.toBeInTheDocument()
})
it('uses the active cwd when toggling a server', async () => {
const toggleServer = vi.fn().mockResolvedValue(undefined)
const server = {

View File

@ -586,7 +586,7 @@ export const en = {
'settings.mcp.form.back': 'Back to servers',
'settings.mcp.form.createTitle': 'Connect to a custom MCP',
'settings.mcp.form.createHint': 'Set up a custom MCP server with the fields supported by Claude Code today.',
'settings.mcp.form.editTitle': 'Update {name} MCP',
'settings.mcp.form.editTitle': 'Configure {name} MCP',
'settings.mcp.form.editHint': 'Review connection details, save changes, or reconnect this server from the desktop app.',
'settings.mcp.form.transportLocked': 'If you would like to switch MCP server type, uninstall first.',
'settings.mcp.form.uninstall': 'Uninstall',

View File

@ -588,7 +588,7 @@ export const jp: Record<TranslationKey, string> = {
'settings.mcp.form.back': 'サーバー一覧に戻る',
'settings.mcp.form.createTitle': 'カスタム MCP に接続',
'settings.mcp.form.createHint': '現在 Claude Code がサポートするフィールドでカスタム MCP サーバーをセットアップします。',
'settings.mcp.form.editTitle': '{name} MCP を更新',
'settings.mcp.form.editTitle': '{name} MCP を設定',
'settings.mcp.form.editHint': '接続の詳細を確認し、変更を保存するか、このサーバーをデスクトップアプリから再接続します。',
'settings.mcp.form.transportLocked': 'MCP サーバーの種類を切り替えるには、まずアンインストールしてください。',
'settings.mcp.form.uninstall': 'アンインストール',

View File

@ -588,7 +588,7 @@ export const kr: Record<TranslationKey, string> = {
'settings.mcp.form.back': '서버 목록으로 돌아가기',
'settings.mcp.form.createTitle': '사용자 지정 MCP에 연결',
'settings.mcp.form.createHint': '현재 Claude Code가 지원하는 필드로 사용자 지정 MCP 서버를 설정합니다.',
'settings.mcp.form.editTitle': '{name} MCP 업데이트',
'settings.mcp.form.editTitle': '{name} MCP 설정',
'settings.mcp.form.editHint': '연결 세부 정보를 확인하고 변경 사항을 저장하거나 데스크톱 앱에서 이 서버를 다시 연결합니다.',
'settings.mcp.form.transportLocked': 'MCP 서버 유형을 전환하려면 먼저 제거하세요.',
'settings.mcp.form.uninstall': '제거',

View File

@ -588,7 +588,7 @@ export const zh: Record<TranslationKey, string> = {
'settings.mcp.form.back': '返回服務列表',
'settings.mcp.form.createTitle': '連線自定義 MCP',
'settings.mcp.form.createHint': '按當前 Claude Code 支援的欄位新增一個自定義 MCP 服務。',
'settings.mcp.form.editTitle': '更新 {name} MCP',
'settings.mcp.form.editTitle': '設定 {name} MCP',
'settings.mcp.form.editHint': '檢視連線資訊、儲存修改,或直接在桌面端重連這個服務。',
'settings.mcp.form.transportLocked': '如果你想切換 MCP 服務型別,請先解除安裝後重新新增。',
'settings.mcp.form.uninstall': '解除安裝',

View File

@ -588,7 +588,7 @@ export const zh: Record<TranslationKey, string> = {
'settings.mcp.form.back': '返回服务列表',
'settings.mcp.form.createTitle': '连接自定义 MCP',
'settings.mcp.form.createHint': '按当前 Claude Code 支持的字段添加一个自定义 MCP 服务。',
'settings.mcp.form.editTitle': '更新 {name} MCP',
'settings.mcp.form.editTitle': '配置 {name} MCP',
'settings.mcp.form.editHint': '查看连接信息、保存修改,或直接在桌面端重连这个服务。',
'settings.mcp.form.transportLocked': '如果你想切换 MCP 服务类型,请先卸载后重新添加。',
'settings.mcp.form.uninstall': '卸载',