Skip to content

fix(ui): keep mixed-type enum choices distinct - #145578

Merged
roboclaw-bot merged 1 commit into
mainfrom
openclaw/qa-loop-config-enum-types
Sep 12, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
openclaw/qa-loop-config-enum-types

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Related: #138090 covers the separate terminal wizard and persistence path; this change is limited to Control UI selection rendering.

What Problem This Solves

Fixes an issue where users selecting settings from an enum could see the wrong option selected or restored when the schema allowed values with identical text but different JSON types, such as 1 and "1", or false and "false".

Why This Change Was Made

Use the existing type-preserving config-value comparison for both dropdown and segmented controls. This removes the competing primitive-to-string matcher rather than adding another special case. Selection callbacks, rejection handling, defaults, nullable values, and supported JSON enum values retain their existing contracts.

User Impact

Mixed-type choices remain distinct through selection and rerendering. A rejected change restores the correct typed member, and an inherited default does not silently become an explicit override. Null, unset, and string values remain separate.

Evidence

  • The original source failed 16 of 18 targeted regression cases; two controls already passed. The repaired source passes all 18.
  • The maintained three-file Chromium selection passes 74 cases. Parent independently reran the final scalar integrity file: 46 passed, including the 18 regressions, with all three source hashes unchanged. These are overlapping selections, not additive coverage.
  • UI test types and the complete 20-check changed gate against 47ce03d pass, including core/UI type checks, all dead-export scans, lint and styles.
  • Normal UI build passes and reports no performance-budget violations. Its report-only measurement does not substitute for the separate CI base-comparison check. No budget or measurement settings were changed here.
  • Production changes are +3/-25, net 22 lines removed. Test-only brace corrections and a Lit lifecycle wait kept inside the custom-radio branch preserve every selection/recovery assertion; no cast, suppression, sleep or forced action was added.
  • Fresh full-diff P0–P2 autoreview completed scoped-clean with no findings, covering the final production and test bytes. All source hashes matched before and after review.

Use canonical config-value equality for dropdown and segmented selections, removing the competing string-coercion matcher and 22 net production lines. Preserve typed callbacks, rejected-selection recovery, defaults, null/unset and JSON enum support. Original regressions16fail/2pass; maintained Chromium74passed and parent46passed, full20-check gate/UI build/freshP2 passed.

Co-authored-by: steipete <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 11:59 PM ET / September 12, 2026, 03:59 UTC (Revision 2).

ClawSweeper review

What this changes

The PR makes Control UI dropdowns and segmented settings controls distinguish enum values with identical text but different JSON types, with browser regression coverage.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused repair: current main and the latest release retain the faulty comparison, and the related wizard PR addresses a different path. No blocking correctness finding remains.

Priority: P2
Reviewed head: ef6fa34bc9211ae8655017879614ebf0b0d4537b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-level repair with meaningful browser regressions and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer/bot exemption applies to this rendering-only repair, so the previous live-UI proof request is not retained as a blocker. The reported Chromium cases exercise analyzed dropdown and segmented controls with fixture callbacks; they do not establish a running-Gateway flow.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer/bot exemption applies to this rendering-only repair, so the previous live-UI proof request is not retained as a blocker. The reported Chromium cases exercise analyzed dropdown and segmented controls with fixture callbacks; they do not establish a running-Gateway flow.
Evidence reviewed 8 items Introduced scope: The host-verified merge-base-to-head patch changes only the two enum selection comparisons and their browser tests. The verified test merge preserves that same scope against its main parent.
Current main still needs the repair: Current main's dropdown finds the first option whose string representation matches the value. For options containing both 1 and "1", this selects the numeric member for a stored string. The two production files are unchanged between the PR merge base and fetched main.
Latest release retains the defect: The same string-coercing dropdown comparison exists in v2026.9.4; the requested correction is not already present in that release.
Findings None None.
Security None None.

How this fits together

Control UI settings forms turn Gateway-provided schemas and configuration values into editable controls. These controls display the selected value and pass typed edits to the existing configuration handler.

flowchart TD
  A[Configuration schema] --> C[Settings form]
  B[Saved value or default] --> C
  C --> D[Typed value comparison]
  D --> E[Dropdown or segmented selection]
  E --> F[Configuration edit handler]
  F --> G[Accepted rerender or rejected selection recovery]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -22, Tests +188. Total +166 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 3 25 -22
Tests 1 189 1 +188
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 192 26 +166

Review metrics

None.

Technical review

Best possible solution:

Use the canonical JSON-value comparator throughout enum selection while retaining typed callbacks, inherited defaults, and existing rejection recovery.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: render a mixed enum containing 1 and "1" with the string selected; current main resolves the numeric option first. Runtime execution was not performed in this read-only review.

Is this the best way to solve the issue?

Yes. Reusing the existing JSON-value comparator removes competing equality logic without changing configuration storage, defaults, or callback contracts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ec575b2ead3c.

Labels

Label justifications:

  • P2: This fixes incorrect selection and recovery for mixed-type settings enums with a limited UI blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer/bot exemption applies to this rendering-only repair, so the previous live-UI proof request is not retained as a blocker. The reported Chromium cases exercise analyzed dropdown and segmented controls with fixture callbacks; they do not establish a running-Gateway flow.

Evidence

What I checked:

  • Introduced scope: The host-verified merge-base-to-head patch changes only the two enum selection comparisons and their browser tests. The verified test merge preserves that same scope against its main parent. (ui/src/components/config-form.node.scalar.ts:640, ef6fa34bc921)
  • Current main still needs the repair: Current main's dropdown finds the first option whose string representation matches the value. For options containing both 1 and "1", this selects the numeric member for a stored string. The two production files are unchanged between the PR merge base and fetched main. (ui/src/components/config-form.node.scalar.ts:639, ec575b2ead3c)
  • Latest release retains the defect: The same string-coercing dropdown comparison exists in v2026.9.4; the requested correction is not already present in that release. (ui/src/components/config-form.node.scalar.ts, 3a9d69db306c)
  • Existing equality owner: configValuesEqual aliases the repository's JSON-schema comparator, which validates JSON values and uses deep equality without primitive string coercion. Both changed renderers retain index-based control values and return the original typed option. (packages/normalization-core/src/json-schema.ts:319, ef6fa34bc921)
  • Regression coverage and execution limits: The 18 added cases exercise analyzed forms, both control types, typed callbacks, rerenders, rejection recovery, defaults, null and unset. The captured PR body reports 16 pre-fix failures and all 18 passing after repair, plus overlapping 46- and 74-case browser selections. These are contributor-reported results; this read-only review inspected the tests and did not execute them. The introduced diff passes git diff --check. (ui/src/components/config-form-scalar-integrity.browser.test.ts:1017, ef6fa34bc921)
  • Earlier proof request reassessed: The previous review at this same head had no findings and requested running-Control-UI proof. Repository State identifies this as a MEMBER-authored automation PR with the maintainer label, so the ordinary external-contributor proof gate does not apply. The Control UI E2E guidance prefers browser tests for narrow rendering logic; this patch changes neither appearance design nor authority. Fixture browser tests remain supplemental evidence, not a claimed live application run. (.agents/skills/control-ui-e2e/SKILL.md, ef6fa34bc921)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-12T03:52:25.732Z sha ef6fa34 :: needs real behavior proof before merge. :: none

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 12, 2026 03:54
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 12, 2026
@roboclaw-bot
roboclaw-bot merged commit 0fea281 into main Sep 12, 2026
178 checks passed
@roboclaw-bot
roboclaw-bot deleted the openclaw/qa-loop-config-enum-types branch September 12, 2026 04:30
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
Use the existing config-value comparison for dropdown and segmented enum selection instead of coercing different JSON types to the same display text. Remove the competing primitive matcher: +3/-25 production lines, net 22 removed.

Keep typed callback values, rejected-selection recovery, defaults, null and unset behavior intact. The original source failed 16 of 18 regression cases. The maintained Chromium selection passed 74 tests; the parent independently reran 46 tests on the committed head, including those regressions. These selections overlap.

The complete local changed gate, UI build, fresh P0–P2 review and exact-head CI passed. Proof is scoped to the changed Control UI components; no unrelated Gateway or native-platform behavior is claimed.

Co-authored-by: steipete <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant