feat(ai-chat): inline Test button per external MCP server row (#170) #208
Closed
Ghost
wants to merge 2 commits from
feat/170-mcp-test-button into develop
pull from: feat/170-mcp-test-button
merge into: vvzvlad:develop
vvzvlad:main
vvzvlad:test/244-part-b
vvzvlad:fix/255-ws-redis-adapter-leak
vvzvlad:feat/251-intentional-clear
vvzvlad:fix/252-e2e-open-handles
vvzvlad:feat/184-autonomous-agent-runs
vvzvlad:feat/221-image-captions
vvzvlad:feat/git-sync
vvzvlad:refactor/193-tool-spec-registry
vvzvlad:fix/244-dataloss-bugs
vvzvlad:fix/embeddings-reindex-progress
vvzvlad:develop
vvzvlad:feature/offline-sync
vvzvlad:feat/229-catalog-yaml
vvzvlad:feat/243-blob-sandbox
vvzvlad:feat/228-inline-footnotes
vvzvlad:fix/qa-ui-bugs-216-218
vvzvlad:feature/agent-roles-catalog
vvzvlad:fix/share-alias-rename
vvzvlad:fix/ai-chat-empty-render
vvzvlad:feat/191-chat-doc-binding
vvzvlad:feat/201-temporary-notes
vvzvlad:feat/198-interrupt-agent
vvzvlad:feat/ai-chat-full-history
vvzvlad:feat/199-ai-generate-title
vvzvlad:feat/205-share-aliases
vvzvlad:batch/issues-189-187-170
vvzvlad:feat/189-context-badge
vvzvlad:feat/198-interrupt-agent-send-now
vvzvlad:fix/issues-190-159
vvzvlad:fix/ai-chat-new-chat-during-stream
vvzvlad:fix/ai-chat-stream-perf
vvzvlad:batch/issues-2026-06-25
vvzvlad:feat/ai-chat-persistent-history
vvzvlad:fix/ai-chat-copy-chat-wysiwyg
vvzvlad:fix/ai-stream-reset-resilience
vvzvlad:fix/ai-stream-undici-timeout
vvzvlad:fix/footnote-review-1227-followup
vvzvlad:fix/ai-chat-token-counter-realtime
vvzvlad:docs/manual-qa-test-plan
2 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
34995ca85c |
fix(ai-mcp): address PR #208 review for inline Test button (#170)
- CHANGELOG: add an [Unreleased]/Added bullet for the per-row "Test" button
(idle Test -> OK · N / Failed, tooltip, isolated per-row state).
- ai-mcp-server-row: show a red "Failed" when the request itself rejects
(401/403/500/network), reading testMutation.isError — previously only a
server-reported {ok:false} was surfaced and a real reject silently reverted
to "Test". Tooltip uses error.response?.data?.message or the i18n fallback.
- ai-mcp-server-row: clarify the reset-effect comment (hasHeaders is a
presence flag, so value-only token rotation is intentionally not reset).
- ai-mcp-server-row: drop the redundant disabled={isPending} (Mantine already
disables a loading button).
- ru-RU: add the "No tools available" translation.
- tests: cover the request-reject failure, the empty tool list (OK · 0), and
the reset-on-change effect (url / transport / hasHeaders) via rerender.
Note: kept the `"error" in result` guard instead of the suggested bare
`else if (result)` — optional chaining on `result?.ok` doesn't narrow the
discriminated union in the else branch, so the bare form fails tsc.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
||
|
|
c28d8cc648 |
feat(ai-chat): inline Test button per external MCP server row (#170)
Add a per-row "Test" button to the external MCP servers list so admins can
check a server's connection straight from the list, without opening the edit
modal.
- Extract each list row into its own AiMcpServerRow component, each owning a
dedicated useTestAiMcpServerMutation instance. This isolates loading/result
state per row — a single list-level mutation would make every row's spinner
and colour jump on any test.
- Button reflects the outcome with both colour AND label (a11y / colour-blind
safe): idle "Test", loading, green "OK · {n}" (tool count), red "Failed".
Fixed miw so the row does not jump as the label changes. A tooltip surfaces
the tools list (success) or the sanitized error (failure).
- Reset the mutation when url/transport/hasHeaders change so a stale result
does not stick on the non-remounting (keyed-by-id) row.
- Reuse the existing /workspace/ai-mcp-servers/test endpoint and mutation;
backend/service/query unchanged.
- i18n: add "Failed" and "OK · {{count}}" (en + ru); add the missing "Test"
key to ru-RU.
- Add a vitest suite covering idle/success/failure states and per-row
isolation.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|