Skip to content

feat(webui): Server Config tab parity with macOS tray#424

Merged
Dumbris merged 1 commit into
mainfrom
fix/webui-config-tab-parity
Apr 26, 2026
Merged

feat(webui): Server Config tab parity with macOS tray#424
Dumbris merged 1 commit into
mainfrom
fix/webui-config-tab-parity

Conversation

@Dumbris
Copy link
Copy Markdown
Member

@Dumbris Dumbris commented Apr 26, 2026

Summary

Brings the Web UI's /server-detail/:name Config tab to information parity with the macOS tray. Previously the Web UI showed only Name, Protocol, URL, Command, Enabled, Quarantined, Tool Count — the macOS tray (ServerDetailView.swift) already shows full Process / Docker Isolation / Status / Health detail from the same /api/v1/servers/{id} response.

Why

User inspected obsidian-pilot in the Web UI Config tab, didn't see the Docker isolation override (image, extra_args, vault mount), and reported "macOS app shows config right, but web UI shows only part of it". The data was in the API; the UI just didn't render it.

Sections (mirroring native/macos/MCPProxy/.../ServerDetailView.swift)

Section Fields
General Name, Protocol, Enabled, Quarantined
Connection (HTTP/SSE) URL
Process (stdio) Command, Args, Working Dir
Environment Variables keys with masked values (••••<last2> (N chars))
Docker Isolation Overrides Image, Network Mode, Extra Args, Container Working Dir, Memory/CPU Limit, Runtime — with isolation_defaults rendered as italic default: <value> placeholders when no override is set
Status Connected, Connected At, Reconnect Count, Tool Count, Tool List Tokens, Last Error
Health Level, Admin State, Summary, Detail, Suggested Action

Approach

  • No new components. Inline daisyUI cards + dl/dt/dd grid layout. The Edit page remains the dedicated mutation surface; this tab is an information dashboard.
  • No backend changes. All fields already in /api/v1/servers/{id}.
  • Env values masked, keys visible — users can confirm which variables are set without leaking secrets to a shoulder-surfer.
  • Isolation defaults shown as placeholders (italic default: ...) so the "empty = inherit" semantic is discoverable.

Type updates

  • frontend/src/types/api.ts: Server gains args, working_dir, env, connected_at, last_reconnect_at, reconnect_count, isolation, isolation_defaults. New ServerIsolationConfig + ServerIsolationDefaults mirror internal/contracts/types.go.
  • frontend/src/types/contracts.ts: same additions to the auto-generated mirror.

Test plan

  • npm run type-check clean.
  • npm run build clean (ServerDetail.vue 63 KB → 63 KB, no regression).
  • Manual: render an HTTP server, a stdio server with Docker isolation, and a quarantined server to confirm all sections gracefully hide their cards when fields are absent.

🤖 Generated with Claude Code

The Web UI's Configuration tab on /server-detail/:name showed only a
narrow slice of server state (Name, Protocol, URL, Command, Enabled,
Quarantined, Tool Count). The macOS tray (native/macos/MCPProxy/
ServerDetailView.swift) already shows much more — Process details, full
Docker isolation overrides, runtime status, unified Health — and pulled
the same data from the same /api/v1/servers/{id} endpoint.

The bug case that surfaced this: user inspected obsidian-pilot in the
Web UI Config tab, didn't see the Docker isolation override (image,
extra_args, vault mount), and concluded "Web UI shows only part of it"
even though the same fields were in the API response.

This commit restructures the Config tab into the same six sections the
macOS tray uses:

  General                — Name, Protocol, Enabled, Quarantined
  Connection             — URL (HTTP/SSE only)
  Process                — Command, Args, Working Dir (stdio only)
  Environment Variables  — keys with masked values
  Docker Isolation       — Image, Network Mode, Extra Args, Container
  Overrides                Working Dir, Memory/CPU Limit, Runtime —
                           with isolation_defaults shown as italic
                           placeholder when no override is set
  Status                 — Connected, Connected At, Reconnect Count,
                           Tool Count, Tool List Tokens, Last Error
  Health                 — Level, Admin State, Summary, Detail,
                           Suggested Action

Implementation notes:

  - No new components were introduced — the Config tab uses inline
    daisyUI cards + dl/dt/dd grid layout for read-only fields. The
    edit affordances stay on the existing Edit page; the Config tab
    is now an information dashboard, matching the macOS tray.
  - Env values are masked ("••••<last2> (N chars)"). Keys are visible
    so users can confirm WHICH variables are set without exposing
    secrets to a casual viewer.
  - Docker isolation defaults render as "default: <value>" italic
    placeholders when no per-server override is set, matching the
    macOS tray's behavior. Lets users see what's actually in effect.
  - All fields are populated by the existing /api/v1/servers/{id}
    response — no backend changes.

Type updates:

  - frontend/src/types/api.ts: Server gains args, working_dir, env,
    connected_at, last_reconnect_at, reconnect_count, isolation,
    isolation_defaults. Adds ServerIsolationConfig + ServerIsolation
    Defaults to mirror internal/contracts/types.go.
  - frontend/src/types/contracts.ts: same additions to the auto-
    generated mirror.

Tests: type-check + build pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 26, 2026

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: aa81342
Status: ✅  Deploy successful!
Preview URL: https://0319d146.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-webui-config-tab-parity.mcpproxy-docs.pages.dev

View logs

@github-actions
Copy link
Copy Markdown

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/webui-config-tab-parity

Available Artifacts

  • archive-darwin-amd64 (26 MB)
  • archive-darwin-arm64 (23 MB)
  • archive-linux-amd64 (15 MB)
  • archive-linux-arm64 (13 MB)
  • archive-windows-amd64 (26 MB)
  • archive-windows-arm64 (23 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (19 MB)
  • installer-dmg-darwin-arm64 (18 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 24960069712 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris Dumbris merged commit 9e530c4 into main Apr 26, 2026
24 checks passed
@Dumbris Dumbris deleted the fix/webui-config-tab-parity branch April 26, 2026 15:47
electrolobzik added a commit to HaloCollar/mcpproxy-go that referenced this pull request May 16, 2026
Adds TestContractsInSync, which runs the generator's content function
and asserts byte-equality with the committed frontend/src/types/contracts.ts.
The next time a contributor hand-edits contracts.ts (or hand-edits the
hardcoded TS string in main.go) without updating both sides, CI fails
with a clear message pointing at the fix:

  Either run \`go run ./cmd/generate-types\` from the module root
  (if the generator is the source of truth) or update the string
  literals in main.go (if contracts.ts is the source of truth).

The drift this test guards against is what allowed PRs smart-mcp-proxy#424 and smart-mcp-proxy#463
to silently leave the generator out of sync.

Refactors main.go to factor out generateFileContent() so the test
can compare without re-implementing the header concat.
Dumbris added a commit that referenced this pull request May 17, 2026
…edes #472) (#475)

* fix(generate-types): re-sync hardcoded TS output with contracts.ts

The TypeScript-as-Go-string literal in cmd/generate-types/main.go drifted
from frontend/src/types/contracts.ts when PR #424 (Server Config tab
parity) and PR #463 (per-tool enable/disable) edited contracts.ts
directly without updating the generator. Running `go run ./cmd/generate-types`
(invoked by Makefile's `frontend-build` target) silently reverts those
fields, producing a dirty working tree on every `make build`:

  - Server.isolation_defaults
  - IsolationConfig.network_mode, IsolationConfig.extra_args
  - IsolationDefaults (entire interface)
  - Tool.disabled, Tool.approval_status

The reverted contracts.ts also feeds back into Vite's bundle hashes,
which is the likely reason web/frontend/dist/* also churns on rebuilds.

This commit catches the generator up to the actual contracts.ts content.
After this, `go run ./cmd/generate-types` is idempotent against HEAD.

Verified: generator output is byte-identical to contracts.ts.

* test(generate-types): catch future contracts.ts drift in CI

Adds TestContractsInSync, which runs the generator's content function
and asserts byte-equality with the committed frontend/src/types/contracts.ts.
The next time a contributor hand-edits contracts.ts (or hand-edits the
hardcoded TS string in main.go) without updating both sides, CI fails
with a clear message pointing at the fix:

  Either run \`go run ./cmd/generate-types\` from the module root
  (if the generator is the source of truth) or update the string
  literals in main.go (if contracts.ts is the source of truth).

The drift this test guards against is what allowed PRs #424 and #463
to silently leave the generator out of sync.

Refactors main.go to factor out generateFileContent() so the test
can compare without re-implementing the header concat.

* fix(generate-types): make TestContractsInSync CRLF-safe on Windows

The new TestContractsInSync did a raw byte comparison of the committed
contracts.ts against generator output. On Windows CI (core.autocrlf=true)
git checks out contracts.ts with CRLF endings while the generator emits
LF, so the test failed on windows-amd64 even though the contract was in
sync (observed on PR #472).

Two-layer fix:
- .gitattributes pins frontend/src/types/contracts.ts to `text eol=lf`
  so it is checked out identically on every platform (the real fix).
- The test now normalizes CRLF->LF before comparing, keeping it green
  regardless of a contributor's local git config (defense in depth).

Verified: test passes with both LF and CRLF checkouts of contracts.ts;
`go run ./cmd/generate-types` remains idempotent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Roman Chernyak <electrolobzik@gmail.com>
Co-authored-by: Claude Code <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants