Repository navigation
fix(ui): keep mixed-type enum choices distinct - #145578
Conversation
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]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 11:59 PM ET / September 12, 2026, 03:59 UTC (Revision 2). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherControl 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -22, Tests +188. Total +166 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
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]>
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
1and"1", orfalseand"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