Skip to content

fix(webui): forms & modals UX audit — F6, F8, F16 - #1050

Merged
github-actions[bot] merged 7 commits into
mainfrom
fix/ux-forms-modals
Aug 25, 2026
Merged

github-actions[bot] merged 7 commits into
mainfrom
fix/ux-forms-modals

Conversation

@Dumbris

@Dumbris Dumbris commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Three findings from the August 2026 Web UI UX audit, all in the forms-and-modals cluster.

F6 — Add Server modal: submit below the fold, Escape dead, focus never entered

The audit measured scrollHeight 1494 against a 900px viewport: 594px of the form — the submit row included — sat below the fold, with no sticky footer and no close affordance. Escape did nothing and document.activeElement was still the triggering button, because <dialog :open> (as opposed to showModal()) gives none of the modal affordances.

The box is now a flex column capped at 85vh: header (title + ✕), tabs, one scrolling body, and the action row pinned as a sticky footer — per tab, since the Manual and Import tabs each have their own. A new useModalA11y composable supplies the rest of the ARIA dialog contract: initial focus into the form (deliberately skipping the ✕), a Tab trap, Escape to close, and focus restored to the trigger on close. It is applied to AddSecretModal too, since F8 makes that the primary path into it. role / aria-modal / aria-labelledby on both boxes.

F8 — Secrets page could not add a secret

AddSecretModal was only reachable from a per-row Add Value button that renders when a secret is referenced in config but not yet set. With zero rows the page's stated purpose — "Manage secrets stored in your system's secure keyring" — was unreachable. The backend route (POST /api/v1/secrets) was fine; nothing led to it.

Adds a page-level + Add Secret button and the same CTA in the empty state, both opening the modal with no predefined name so a brand new secret can be named. The empty-state copy now explains what a secret is for instead of restating "no secrets available". No API change.

F16 — Settings promised instant apply; enable_code_execution did not apply

PATCH /api/v1/config {"enable_code_execution": true} answered applied_immediately: true, requires_restart: false, and GET reported the new value — yet code_execution kept answering "Code execution is disabled", including from a brand-new MCP session.

I took the hot-apply path rather than adding a restart badge, because the seam already existed and the handler-level gate was already live-reading. Two independent causes:

  • buildCodeExecutionTool read the construction-time p.config, so the routing-mode surfaces kept serving the "disabled" stub — whose handler refuses unconditionally and never reaches the live gate. It now reads currentConfig().
  • That stub was built once at init and never rebuilt. RefreshCallToolModeTools joins its direct/code-exec siblings, and RefreshCodeExecutionAvailability re-advertises the tool on every surface that carries it, driven from the config.reloaded listener — the same shape PR feat: Aggregate upstream MCP prompts through prompts/list #973 used for aggregate_upstream_prompts. The stdio surface is updated with AddTools, not SetTools, so registerTools' other tools survive.

DetectConfigChanges gains enable_code_execution as hot-reloadable; without it a lone toggle computed empty ChangedFields and was swallowed as "no changes detected", so config.reloaded never fired.

Also fixes the mislabelled changed_fields the audit noted alongside it. Servers were compared with reflect.DeepEqual, but handlePatchConfig round-trips the live config through JSON before merging, and neither Created/Updated (monotonic reading + *time.Location) nor omitempty empty slices survive that. Every PATCH therefore reported ["mcpServers"] — and, worse, drove a spurious full upstream reload/reconnect on every settings save. Now compared with jsonEqual, the helper docker_isolation and trusted_hosts already use for this exact reason, with a length guard so nil vs [] does not reintroduce it.

Restart honesty, since F16 asked for a real list rather than guesswork:

  • code_execution_pool_size gains the restart badge it always warranted (Go forces a restart for it).
  • tls.hsts joins the Go-side TLS restart check to match the badge TS already showed — HSTS wraps the handler chain once, at construction.
  • The Settings hints panel derives its "Requires restart" list from the fields that actually carry the badge, instead of hardcoded prose that had drifted: it named "Data directory", which has no settings field at all.

Verification

Live, on an isolated instance (127.0.0.1:18422, scratch config + data dir), Playwright at 1440×900:

F6 — modal scrollHeight 765 == clientHeight 765, bottom 832 < 900; submit row bottom 816 (above the fold); the body is the only scroll region (scrollHeight 1290 vs clientHeight 556); focus lands on the first radio inside the dialog; Tab ×40 never escapes; Escape closes and focus returns to the Add Server trigger. Repeated at 1280×700.

F8 — both CTAs render on an empty page, the modal opens with an editable name field, and the form reaches POST /api/v1/secrets carrying the typed payload. (The sandbox has no usable keyring backend, so the dialog shows the backend's refusal — the wiring is what F8 was about.)

F16 — toggled for real. /mcp, /mcp/call and /mcp/code all flip from the disabled stub to a working code_execution (6*7 → 42) on a brand-new MCP session with no restart, and back off again:

=== enable via PATCH ===
{"success":true,"applied_immediately":true,"requires_restart":false,"changed_fields":["enable_code_execution"]}
http://127.0.0.1:18422/mcp       ->  "{\"ok\":true,\"value\":42}"
http://127.0.0.1:18422/mcp/call  ->  "{\"ok\":true,\"value\":42}"
http://127.0.0.1:18422/mcp/code  ->  "{\"ok\":true,\"value\":42}"

=== an unrelated PATCH must NOT report mcpServers ===
{"success":true,...,"changed_fields":["tools_limit"]}

Before the fix the same probe returned Code Execution (Disabled) in tools/list and the refusal message from tools/call, with changed_fields: ["mcpServers"].

Suites: go test -race full tree with the CI skip regex (green) · go test -tags server -race ./internal/serveredition/... (green) · both-edition builds · golangci-lint v2 with .github/.golangci.yml (0 issues) · vitest 681/681 across 68 files, incl. 3 new specs · vue-tsc clean.

No new dependencies. No API-surface change, so no swagger regen.

Not addressed

F36's sub-items are all outside this cluster (Dashboard status chip, Sessions label clipping, Tools table Approval column, collapsed sidebar, telemetry banner) — none are forms or modals.

Modal a11y hardening

useModalA11y went through five cross-model review rounds; the follow-up commits are its findings, each with a regression test:

  • Only the topmost modal reacts to Escape and owns the Tab trap — the listener sits on document, and stopPropagation does not stop sibling listeners bound to the same node in the same phase, so one Escape used to close a whole stack.
  • A modal closing underneath another no longer restores its own trigger, which dragged focus behind the top dialog. Focus is restored only when the stack empties.
  • Focus restoration on unmount is deferred a tick so it runs after Vue detaches the subtree: a trigger torn down with the modal is left alone rather than taking a pointless focus/blur pair (which scrolls and is announced) on its way out, while a trigger that outlives the modal still gets focus back.
  • The focus-on-open tick checks it is still open and still topmost before grabbing focus.
  • visibleFocusables() now actually skips what it claimed to — checkVisibility({ checkVisibilityCSS: true }) where the browser has it, plus a disabled check — so a hidden or disabled control cannot bound the trap and make Tab appear to stick. jsdom has no checkVisibility, so the browser path is covered by a Playwright case that injects display:none / visibility:hidden decoys and sweeps Tab over them.
  • initialFocus resolves with its own query so it can target a tabindex="-1" heading (the standard ARIA pattern, outside the tab order), while the shared visibility/disabled predicate still prevents it handing focus to something that cannot take it. The option has no caller yet, so a dedicated spec holds the contract in both directions.

One residual is documented in the source rather than fixed: unwinding a stack bottom-up in a single tick lands focus on <body> rather than the original opener. Top-down (the normal order) restores correctly, and the reviewer confirmed no caller in this codebase stacks these modals.

Three findings from the August 2026 Web UI UX audit, all in the
forms-and-modals cluster.

F6 — Add Server modal
The box measured scrollHeight 1494 against a 900px viewport, so 594px of
the form — the submit row included — sat below the fold with no sticky
footer and no close affordance. Escape did nothing and focus stayed on
the triggering button, because `<dialog :open>` (as opposed to
showModal()) gives none of the modal affordances.

The box is now a flex column capped at 85vh: header (title + ✕),
tabs, a single scrolling body, and the action row pinned as a sticky
footer, per tab. A new `useModalA11y` composable supplies the rest of the
ARIA dialog contract — initial focus into the form (skipping the ✕),
a Tab trap, Escape to close, and focus restored to the trigger — and is
applied to AddSecretModal as well, since F8 makes that the primary path
into it. role/aria-modal/aria-labelledby are on both boxes.

F8 — Secrets page could not add a secret
`AddSecretModal` was only reachable from a per-row "Add Value" button
that renders when a secret is referenced in config but not yet set. With
zero rows the page's stated purpose was unreachable. The backend route
(POST /api/v1/secrets) was fine; nothing led to it.

Adds a page-level "+ Add Secret" button and the same CTA in the empty
state, both opening the modal with no predefined name so the user can
name a brand new secret. The empty-state copy now explains what a secret
is for instead of restating "no secrets available". No API change.

F16 — Settings promised instant apply; enable_code_execution did not apply
`PATCH /api/v1/config {"enable_code_execution": true}` answered
applied_immediately: true, requires_restart: false, and GET reported the
new value — yet `code_execution` kept answering "Code execution is
disabled", including from a brand-new MCP session.

Two independent causes, both fixed rather than papered over with a
restart badge, because the hot-reload seam already existed:

  * `buildCodeExecutionTool` read the construction-time `p.config`, so
    the routing-mode surfaces kept serving the "disabled" stub — whose
    handler refuses unconditionally, never reaching the handler-level
    gate that *had* already gone live. It now reads `currentConfig()`.
  * The stub was built once at init and never rebuilt.
    `RefreshCallToolModeTools` joins its direct/code-exec siblings, and
    `RefreshCodeExecutionAvailability` re-advertises the tool on every
    surface that carries it from the config.reloaded listener — the same
    shape PR #973 used for aggregate_upstream_prompts. The stdio surface
    is updated with AddTools, not SetTools, so registerTools' other tools
    survive.

`DetectConfigChanges` gains `enable_code_execution` as a hot-reloadable
field; without it a lone toggle computed empty ChangedFields and was
swallowed as "no changes detected".

Also fixes the mislabelled `changed_fields` the audit noted alongside it:
Servers were compared with reflect.DeepEqual, but handlePatchConfig
round-trips the live config through JSON before merging, and neither
`Created`/`Updated` (monotonic reading + *time.Location) nor omitempty
empty slices survive that. Every PATCH therefore reported ["mcpServers"]
— and, worse, drove a spurious full upstream reload on every settings
save. Now compared with jsonEqual, the same helper docker_isolation and
trusted_hosts already use for this exact reason, with a length guard so
nil vs [] does not reintroduce it.

Restart honesty, since F16 asked for a real list rather than guesswork:
`code_execution_pool_size` gains the restart badge it always warranted
(Go forces a restart for it), `tls.hsts` joins the Go-side TLS restart
check to match the badge TS already showed (HSTS wraps the handler chain
once, at construction), and the Settings hints panel derives its
"Requires restart" list from the fields that actually carry the badge
instead of hardcoding prose that had drifted — it named "Data directory",
which has no settings field at all.

Verified on an isolated instance (127.0.0.1:18422, scratch dirs):
  * F6 measured live at 1440x900 — modal scrollHeight 765 == clientHeight
    765, bottom 832 < 900, submit row bottom 816 (above the fold), body
    scrollHeight 1290 vs clientHeight 556, focus lands on the first radio
    inside the dialog, Tab x40 never escapes, Escape closes and focus
    returns to the Add Server trigger. Also checked at 1280x700.
  * F8 both CTAs render on an empty page, the modal opens with an
    editable name, and the form reaches POST /api/v1/secrets with the
    typed payload (this sandbox has no usable keyring backend, so the
    backend's refusal is what the dialog shows — the wiring is the point).
  * F16 toggled for real: /mcp, /mcp/call and /mcp/code all flip from the
    disabled stub to a working code_execution (6*7 -> 42) on a brand-new
    MCP session with no restart, and back off again; changed_fields now
    reads ["enable_code_execution"], and an unrelated tools_limit patch
    reads ["tools_limit"] instead of ["mcpServers"].
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 483ef8a
Status: ✅  Deploy successful!
Preview URL: https://838d34f9.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-ux-forms-modals.mcpproxy-docs.pages.dev

View logs

onBeforeUnmount only detached the keydown listener. A modal torn down
while open (route change, a v-if around it) therefore stranded focus
wherever the trap had put it. deactivate() does both, and its
document.contains guard makes the restore a no-op when the trigger left
with the same subtree.
Cross-model review (P2): the keydown listener sits on document, and
stopPropagation does not stop sibling listeners bound to the same node in
the same phase — so with two modals open one Escape closed both. The
composable now keeps a stack of open instances and the ones underneath
the top ignore the key entirely, giving up the Tab trap with it.
Cross-model review round 2: with the open-modal stack in place, a modal
that closes while another is still open restored focus to its own
trigger — dragging focus out of the top dialog and behind it. Focus is
now restored only when the stack empties; until then the top modal owns
it and restores to its own trigger when it goes.
Cross-model review round 3, three points on useModalA11y:

- The focus-on-open runs on nextTick, which may land after the modal
  closed again or after a second modal opened on top; it now checks it is
  still open and still topmost before grabbing focus.
- Focus restoration on unmount is deferred one tick so it runs after Vue
  detaches the subtree. A trigger torn down with the modal then fails the
  contains() check and is left alone, instead of taking a focus/blur pair
  (which scrolls and is announced) on its way out. A trigger that outlives
  the modal still gets focus back, which was the case worth keeping.
- visibleFocusables() claimed to skip hidden controls but did not. It now
  uses checkVisibility() where the browser has it, so a v-show-hidden
  control cannot bound the Tab trap and make Tab appear to stick; jsdom
  lacks the method and falls through, matching how the tests build the DOM.

Also documents the one residual: unwinding a stack bottom-up in a single
tick lands focus on <body> rather than the original opener. Top-down (the
normal order) restores correctly, and nothing in the app stacks these.
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/ux-forms-modals

Available Artifacts

  • archive-darwin-amd64 (29 MB)
  • archive-darwin-arm64 (26 MB)
  • archive-linux-amd64 (17 MB)
  • archive-linux-arm64 (15 MB)
  • archive-windows-amd64 (29 MB)
  • archive-windows-arm64 (25 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (23 MB)
  • installer-dmg-darwin-arm64 (20 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 32844667004 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

…Focus honours it

Cross-model review round 4:

- checkVisibility() on its own catches display:none and
  content-visibility:hidden but not visibility:hidden, whose options
  default to off. Pass checkVisibilityCSS so a visibility-hidden control
  cannot bound the Tab trap.
- The initialFocus option resolved through a raw querySelector, bypassing
  the filter entirely, so a configured selector could hand focus to a
  hidden or disabled control and silently focus nothing. It now matches
  against the same filtered candidate set. No caller passes the option
  today; this closes it before one does.
Cross-model review round 5: routing initialFocus through the Tab-order
list blocked the option's main use — the dialog heading carrying
tabindex="-1", which is programmatically focusable but deliberately
outside the tab order, the standard ARIA dialog pattern. The selector
resolves with its own query again, but the visibility/disabled predicate
is now shared with the trap (extracted as isFocusable), so a selector
still cannot hand focus to something that cannot take it.

isFocusable also gained the disabled check the trap was missing: a
disabled control matched [tabindex] or slipped past the :not([disabled])
selector variants and could bound the trap.

The option has no caller in the app yet, so a dedicated spec holds the
contract in both directions: a tabindex="-1" heading is honoured, and a
missing or disabled target falls back to the first tabbable control.
@codecov-commenter

codecov-commenter commented Aug 25, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved (Model B): Paperclip review verdicts = ACCEPT and qa-gate green at this head SHA. Arming auto-merge; GitHub merges when all required checks pass.

@github-actions
github-actions Bot merged commit 829448e into main Aug 25, 2026
41 checks passed
github-actions Bot pushed a commit that referenced this pull request Aug 25, 2026
…ve catalog (#1056)

PR #1050 marked the field restart-required in the Web UI one minute before
PR #1055 landed the widened settings-parity gate; neither branch saw the
other, and native-tests.yml is path-filtered to native/**, so main went red
on a job that had not run since 08-22. One-line catalog sync; parity now
reports 58 settings consistent.
Dumbris added a commit that referenced this pull request Aug 26, 2026
The document read as an open P0-P3 backlog, but eight PRs merged on 2026-08-25
(#1044, #1048, #1049, #1050, #1051, #1052, #1053, #1054) closed it. Anyone
opening this file against current main was being handed 36 stale defects.

Added a status banner and a Resolution section that separates four things:

- Re-checked live on v0.61.0 against a running isolated core with real /mcp
  traffic: F1, F4, F5, F6, F7, F8, F12, F13, F20, F24, F26, F33 confirmed fixed,
  each with the observed evidence rather than a PR reference.
- Not re-checked: named explicitly rather than implied, so the next reader knows
  which closures rest on a PR body and which on an observation. F28 is called
  out as partial - its "key called optional" half is fixed, its
  three-surfaces-at-once state is not.
- Corrections to the audit itself: F23 mis-diagnosed a per-request structural
  estimate as a stale aggregation, and F31's "Manual badge has no tooltip" half
  was wrong even at audit time (spec-088 trust-mode badge, already titled).
- Five defects found on main while re-checking, recorded separately since they
  are not regressions of anything in the audit. The first is security-relevant:
  quarantining a server through the config file leaves its tools in the search
  index, so retrieve_tools still hands the agent their names and descriptions -
  which is exactly what quarantine exists to prevent - before the call is
  refused. Runtime.QuarantineServer purges the index; the reload path detects
  the same transition (quarantined_changed: true) and does not.

F6 carries a methodology note. Re-checking it produced a false negative: Escape
driven through the browser-automation layer never reaches the page's document
keydown listener, so the dialog looked stuck open. Dispatched in-page it closes
at once, and #1050's useModalA11y is wired into all five <dialog :open> modals.
The sweep assertion this document proposes must dispatch in-page, or it tests
the automation layer instead of the app.

Also corrects the record on #1053: its body names F1-F16, which is the tray
audit's numbering mis-pasted. #1055 is the tray PR; #1053 touches no Swift file.
Dumbris added a commit that referenced this pull request Aug 26, 2026
* docs(qa): Web UI UX audit — ranked findings (ux-audit epic)

Heuristic + live-instance audit of every routed Web UI view in light/dark,
first-run and populated states, at 1440/820/390px. 36 findings ranked P0-P3
with view, evidence, heuristic violated, suggested fix and effort.

Audited against standard heuristics plus the house activity-UI rules
(grouping, failure-only status, intent reason, histogram/log parity).

* docs(qa): record what the Web UI audit's backlog actually resolved to

The document read as an open P0-P3 backlog, but eight PRs merged on 2026-08-25
(#1044, #1048, #1049, #1050, #1051, #1052, #1053, #1054) closed it. Anyone
opening this file against current main was being handed 36 stale defects.

Added a status banner and a Resolution section that separates four things:

- Re-checked live on v0.61.0 against a running isolated core with real /mcp
  traffic: F1, F4, F5, F6, F7, F8, F12, F13, F20, F24, F26, F33 confirmed fixed,
  each with the observed evidence rather than a PR reference.
- Not re-checked: named explicitly rather than implied, so the next reader knows
  which closures rest on a PR body and which on an observation. F28 is called
  out as partial - its "key called optional" half is fixed, its
  three-surfaces-at-once state is not.
- Corrections to the audit itself: F23 mis-diagnosed a per-request structural
  estimate as a stale aggregation, and F31's "Manual badge has no tooltip" half
  was wrong even at audit time (spec-088 trust-mode badge, already titled).
- Five defects found on main while re-checking, recorded separately since they
  are not regressions of anything in the audit. The first is security-relevant:
  quarantining a server through the config file leaves its tools in the search
  index, so retrieve_tools still hands the agent their names and descriptions -
  which is exactly what quarantine exists to prevent - before the call is
  refused. Runtime.QuarantineServer purges the index; the reload path detects
  the same transition (quarantined_changed: true) and does not.

F6 carries a methodology note. Re-checking it produced a false negative: Escape
driven through the browser-automation layer never reaches the page's document
keydown listener, so the dialog looked stuck open. Dispatched in-page it closes
at once, and #1050's useModalA11y is wired into all five <dialog :open> modals.
The sweep assertion this document proposes must dispatch in-page, or it tests
the automation layer instead of the app.

Also corrects the record on #1053: its body names F1-F16, which is the tray
audit's numbering mis-pasted. #1055 is the tray PR; #1053 touches no Swift file.
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