From 8891e1e48d13c04fd666bbe6cc1d7c3d3f0a4232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E4=BA=86=E7=9D=A1=E5=A4=A7=E8=A7=89?= <64798754+stakeswky@users.noreply.github.com> Date: Thu, 5 Mar 2026 13:50:18 +0800 Subject: [PATCH] fix(web-ui): render Accounts schema node properly (#35380) Co-authored-by: stakeswky <64798754+stakeswky@users.noreply.github.com> Co-authored-by: liuxiaopai-ai <73659136+liuxiaopai-ai@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> --- CHANGELOG.md | 1 + ui/src/ui/config-form.browser.test.ts | 24 +++++++++++++++++++++--- ui/src/ui/views/config-form.analyze.ts | 3 ++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ccec3cfcf2..2d0a7022c28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Docs: https://docs.openclaw.ai - Skills/native command deduplication: centralize skill command dedupe by canonical `skillName` in `listSkillCommandsForAgents` so duplicate suffixed variants (for example `_2`) are no longer surfaced across interfaces outside Discord. (#27521) thanks @shivama205. - Agents/xAI tool-call argument decoding: decode HTML-entity encoded xAI/Grok tool-call argument values (`&`, `"`, `<`, `>`, numeric entities) before tool execution so commands with shell operators and quotes no longer fail with parse errors. (#35276) Thanks @Sid-Qin. - Agents/thinking-tag promotion hardening: guard `promoteThinkingTagsToBlocks` against malformed assistant content entries (`null`/`undefined`) before `block.type` reads so malformed provider payloads no longer crash session processing while preserving pass-through behavior. (#35143) thanks @Sid-Qin. +- Web UI/config form: treat `additionalProperties: true` object schemas as editable map entries instead of unsupported fields so Accounts-style maps stay editable in form mode. (#35380, supersedes #32072) Thanks @stakeswky and @liuxiaopai-ai. - Feishu/streaming card delivery synthesis: unify snapshot and delta streaming merge semantics, apply overlap-aware final merge, suppress duplicate final text delivery (including text+media final packets), prefer topic-thread `message.reply` routing when a reply target exists, and tune card print cadence to avoid duplicate incremental rendering. (from #33245, #32896, #33840) Thanks @rexl2018, @kcinzgg, and @aerelune. - Security/dependency audit: patch transitive Hono vulnerabilities by pinning `hono` to `4.12.5` and `@hono/node-server` to `1.19.10` in production resolution paths. Thanks @shakkernerd. - Security/dependency audit: bump `tar` to `7.5.10` (from `7.5.9`) to address the high-severity hardlink path traversal advisory (`GHSA-qffp-2rhf-9h96`). Thanks @shakkernerd. diff --git a/ui/src/ui/config-form.browser.test.ts b/ui/src/ui/config-form.browser.test.ts index a185525bea1..25e78e12408 100644 --- a/ui/src/ui/config-form.browser.test.ts +++ b/ui/src/ui/config-form.browser.test.ts @@ -427,17 +427,35 @@ describe("config form renderer", () => { expect(analysis.unsupportedPaths).not.toContain("channels"); }); - it("flags additionalProperties true", () => { + it("treats additionalProperties true as editable map fields", () => { const schema = { type: "object", properties: { - extra: { + accounts: { type: "object", additionalProperties: true, }, }, }; const analysis = analyzeConfigSchema(schema); - expect(analysis.unsupportedPaths).toContain("extra"); + expect(analysis.unsupportedPaths).not.toContain("accounts"); + + const onPatch = vi.fn(); + const container = document.createElement("div"); + render( + renderConfigForm({ + schema: analysis.schema, + uiHints: {}, + unsupportedPaths: analysis.unsupportedPaths, + value: { accounts: { default: { enabled: true } } }, + onPatch, + }), + container, + ); + + const removeButton = container.querySelector(".cfg-map__item-remove"); + expect(removeButton).not.toBeNull(); + removeButton?.dispatchEvent(new MouseEvent("click", { bubbles: true })); + expect(onPatch).toHaveBeenCalledWith(["accounts"], {}); }); }); diff --git a/ui/src/ui/views/config-form.analyze.ts b/ui/src/ui/views/config-form.analyze.ts index 19c6b416e48..05c3bb5f1f0 100644 --- a/ui/src/ui/views/config-form.analyze.ts +++ b/ui/src/ui/views/config-form.analyze.ts @@ -79,7 +79,8 @@ function normalizeSchemaNode( normalized.properties = normalizedProps; if (schema.additionalProperties === true) { - unsupported.add(pathLabel); + // Treat `true` as an untyped map schema so dynamic object keys can still be edited. + normalized.additionalProperties = {}; } else if (schema.additionalProperties === false) { normalized.additionalProperties = false; } else if (schema.additionalProperties && typeof schema.additionalProperties === "object") {