Skip to content

Fix CE6084: ToggleButtonGroup design property value must be an option, not custom - #40

Merged
ako merged 1 commit into
mainfrom
fix/design-property-toggle-group-value-type
Jul 26, 2026
Merged

Fix CE6084: ToggleButtonGroup design property value must be an option, not custom#40
ako merged 1 commit into
mainfrom
fix/design-property-toggle-group-value-type

Conversation

@ako

@ako ako commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

The typed-design-properties change (#36) regressed the integration suite — main has been red on Build, Test & Lint ever since (it was green through #37). Unit tests passed; the failure is in make test-integration.

TestMxCheck_DoctypeScripts fails with CE6084 on 12-styling-examples.mdl, 15c-fragment-bindings-examples.mdl, and 31-pluggable-datagrid-gallery-v010-examples.mdl (both legacy and modelsdk engines):

[CE6084] "Expected design property Flex container / Column gap / Align items Y / … to be of type Toggle button group, but found Custom."

Root cause

resolveDesignPropertyValueType mapped the BSON value type from the declared control typeToggleButtonGroup and ColorPicker both became custom. That is wrong for ToggleButtonGroup: a toggle-button-group selection picks one of a fixed option set, so Studio Pro stores it as an Option. A Custom value type mismatches the declaration → CE6084 on any flat Atlas flex/spacing/typography property, e.g. 'Column gap': 'Medium'.

The value type is decided by the value, not the control type.

Fix

Make resolveDesignPropertyValueType value-aware (reusing the validator's themeOptionAllowed):

value result
∈ the property's declared options (Dropdown / ToggleButtonGroup / ColorPicker swatch) option
off-list and ColorPicker (free-form hex/color) custom
any other off-list value option
no theme metadata option

This restores the pre-#36 behavior for ToggleButtonGroup while preserving the intended ColorPicker improvement (a free-form color still serializes as custom).

Verification

  • All three doctype examples pass mx check with 0 errors on both engines (TestMxCheck_DoctypeScripts).
  • TestAstDesignPropToValue_Typed extended with the 'Column gap': 'Medium' regression case and ColorPicker swatch-vs-hex cases.
  • Full CLI builds; go vet clean.

Notes

fix-issue.md records the corrected mapping, the CE6084 diagnosis pattern (never assert a BSON $Type mapping from a control-type name — verify against mx check), and the process lesson (run make test-integration, not just unit tests, for page/widget-serialization changes).

🤖 Generated with Claude Code


Generated by Claude Code

…, not custom

The typed-design-properties write path mapped a design property's BSON value
type from its declared control type: ToggleButtonGroup and ColorPicker both
became "custom". That is wrong for ToggleButtonGroup — a toggle-button-group
selection picks one of a fixed option set, so Studio Pro stores it as an Option.
A Custom value type mismatches the declaration and mx check fails CE6084
("Expected design property Flex container / Column gap / … to be of type Toggle
button group, but found Custom") on any Atlas flex/spacing/typography property,
e.g. 'Column gap': 'Medium'.

This broke TestMxCheck_DoctypeScripts on 12-styling-examples,
15c-fragment-bindings-examples, and 31-pluggable-datagrid-gallery-v010-examples
(both engines) — a make test-integration failure that unit tests didn't catch.

The value type is decided by the value, not the control type. Make
resolveDesignPropertyValueType value-aware: a value that is one of the
property's declared options serializes as "option" for every control type
(Dropdown, ToggleButtonGroup, and a ColorPicker's predefined swatches);
only a ColorPicker's off-list value (a free-form hex/color) is "custom";
everything else stays "option"; no metadata falls back to "option". Reuses the
validator's themeOptionAllowed helper for consistency.

Verified: all three doctype examples pass mx check with 0 errors on both the
legacy and modelsdk engines. TestAstDesignPropToValue_Typed extended with the
'Column gap': 'Medium' regression case and ColorPicker swatch-vs-hex cases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
@ako
ako merged commit 144d9c0 into main Jul 26, 2026
3 checks passed
ako pushed a commit that referenced this pull request Jul 29, 2026
#40)

A workflow "call microflow" activity that did not map a required parameter of its
target microflow passed both `mxcli check --references` and `mx check`, but Studio
Pro rejects it (CE6677) and the workflow fails at the activity — the mapped and
unmapped forms were indistinguishable to the checker.

Added a reference-phase validator (runs under --references, where the target
microflow is introspectable): for each workflow call-microflow, look up the target
microflow's parameters via ListMicroflows and report any parameter not present in
the activity's `with (...)` mappings. Microflows created in the same script are
skipped (not yet queryable); a target not in the project is left to the
missing-reference check.

Wired as a new CreateWorkflowStmt case in validateWithContext. Verified end to end:
an unmapped `Item` parameter is now reported; the mapped form passes; full executor
suite green. Repro mdl-examples/bug-tests/265-workflow-unmapped-microflow-param.mdl.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
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