From 1e662afa3c3c77b321afbb4db478d2c15c4f9d37 Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Tue, 25 Aug 2026 14:33:09 +0300 Subject: [PATCH 1/7] =?UTF-8?q?fix(webui):=20forms=20&=20modals=20UX=20aud?= =?UTF-8?q?it=20=E2=80=94=20F6,=20F8,=20F16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 `` (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"]. --- frontend/src/components/AddSecretModal.vue | 30 ++- frontend/src/components/AddServerModal.vue | 58 +++++- frontend/src/composables/useModalA11y.ts | 148 +++++++++++++++ frontend/src/views/Secrets.vue | 66 +++++-- frontend/src/views/Settings.vue | 5 +- frontend/src/views/settings/fields.ts | 29 ++- frontend/tests/unit/modal-a11y.spec.ts | 173 ++++++++++++++++++ frontend/tests/unit/secrets-add-cta.spec.ts | 101 ++++++++++ .../unit/settings-restart-fields.spec.ts | 63 +++++++ internal/runtime/config_hotreload.go | 41 ++++- internal/runtime/config_hotreload_test.go | 126 +++++++++++++ .../server/code_execution_hotreload_test.go | 144 +++++++++++++++ internal/server/mcp_routing.go | 52 +++++- internal/server/server.go | 8 + 14 files changed, 1005 insertions(+), 39 deletions(-) create mode 100644 frontend/src/composables/useModalA11y.ts create mode 100644 frontend/tests/unit/modal-a11y.spec.ts create mode 100644 frontend/tests/unit/secrets-add-cta.spec.ts create mode 100644 frontend/tests/unit/settings-restart-fields.spec.ts create mode 100644 internal/server/code_execution_hotreload_test.go diff --git a/frontend/src/components/AddSecretModal.vue b/frontend/src/components/AddSecretModal.vue index 641c00134..3af62a7b1 100644 --- a/frontend/src/components/AddSecretModal.vue +++ b/frontend/src/components/AddSecretModal.vue @@ -1,8 +1,28 @@