fix(genui): show a literal CheckBox value - #1038
diegolopezrm wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where the CheckBox component failed to display its literal value when the bound data model path was not yet initialized. The implementation now falls back to the literal value (valueRef) if the path has not been written to, aligning its behavior with Slider and TextField. Additionally, corresponding widget tests have been added to verify this behavior, and the changelog has been updated. There are no review comments, and I have no feedback to provide.
|
Thanks, this is the fix suggested in a2ui-project/a2ui#2736 (Slider-style literal fallback plus tests). @gspencergoog, could you review? You have every commit on check_box.dart. |
|
The CI problems will get better once #1040 lands. |
|
The eight red checks aren't from this change. The beta jobs die in The whole matrix goes down with it, |
`CheckBox.value` is a `booleanReference`: a literal, a `{"path": ...}`
binding and a `{"call": ...}` are all valid. The widget bound to a data
model path and never read the literal, so a component that said the
setting was on rendered unchecked and announced itself unchecked, with
nothing logged to say the value had been dropped.
`Slider` and `TextField` already fall back to the literal until the path
holds something. This does the same, so the three inputs of the basic
catalog now treat their value the same way.
7c296ef to
484e6d1
Compare
Description
CheckBox.valueis abooleanReference, so a literal, a{"path": ...}binding and a{"call": ...}are all valid. The widget bound the checkbox to a data model path and never read the literal, so a component that said the setting was on rendered unchecked, announced itself unchecked, and logged nothing to say the value had been dropped.slider.dartandtext_field.dartalready fall back to the literal until the path holds something. This does the same, so the three inputs of the basic catalog treat their value the same way:Two tests: a literal
value: truerenders checked, and a{"path": ...}binding still starts unchecked and follows the data model once something writes to it.Fixes a2ui-project/a2ui#2736.
Pre-launch Checklist
///).