Repository navigation
refactor: move Checkbox onto the shared control core - #86
Merged
AdamMusa merged 3 commits intoNov 2, 2026
Merged
Conversation
Record the legacy Checkbox renderers on iOS and Android as JSON snapshots: geometry, semantics, what they send to Ruby during scripted taps, label taps, the tristate cycle, keyboard focus and ListTile toggling, and invoke outcomes, for the defaults, unlabeled, tristate, maximal, sized, disabled, child-control label, RTL, nested-theme and toggle_inputs tile fixtures. The migration onto the shared control core may change them only as listed in its parity table.
CheckboxCore now owns everything Ruby sends or receives for a Checkbox: one parse of every keyword (checkboxSpec), the tristate cycle, value commits, the label, toggle_inputs tile taps, focus and the width/height scale-to-fit. The Material and Cupertino skins only map the core's values onto Checkbox and CupertinoCheckbox, and AdaptiveCheckboxControl hosts the core under the legacy key. Material now honors spacing (its default gap stays 0, Cupertino's 10), and a disabled checkbox on Android ignores tile taps like it already did on iOS. Snapshots change only for those rows.
AdamMusa
force-pushed
the
refactor/checkbox-control-core
branch
from
October 29, 2026 01:02
a2ce4ac to
9491fb3
Compare
This was referenced Oct 29, 2026
Brings in the PRs merged since, so #86 merges; conflicts take the resolution tested on the full merge of the open PRs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MqfxcsDiEUZngybe9L72JQ
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #81 (control core foundation). Until #81 merges this PR's diff also shows its commit; review the last two commits. Sibling of #84 (Switch), also stacked on #81.
What
Item 2 of the decoupling plan: Checkbox moves onto the shared core. Exactly two commits:
test: snapshot Checkbox renderer behaviour: JSON snapshots of the legacy renderers (test/widgets/checkbox_snapshot_test.dart,test/snapshots/Checkbox/*.json, 11 fixtures x iOS/Android: defaults, unlabeled, tristate cycle, maximal, sized, disabled, child-control label, RTL, nested theme,toggle_inputstile, disabled in tile).refactor: move Checkbox onto the shared control core: the migration. Snapshots change only for the rows of the parity table below.Design
controls/checkbox_core.dart(new)checkboxSpec(every Ruby keyword of the Checkbox wire type;error,hover_color,overlay_color,splash_radius,visual_densityMaterial-only with reasons),CheckboxProps,CheckboxCore(FocusableCore+TileToggleCore): the tristate cycle (null -> false -> true -> null), value commits (writeBackthenchange), label and tile toggling (ignored while disabled), sharedstates,labelled()(oneToggleLabel, full-width row as before,spacingwith each design's native default) and the width/height scale-to-fit.controls/checkbox.dartMaterialCheckboxSkin->Checkbox(visual_densityvia the pureparseVisualDensity).controls/cupertino_checkbox.dartCupertinoCheckboxSkin->CupertinoCheckbox.controls/adaptive_checkbox.dartCoreHost<CheckboxCore>under the legacy key, skins inPlatformControlRendererclosures.width/heightaresharedLayoutKeys(#81), as for Switch. Registry,control_type.dartand the renderer matrix are untouched. Manifest: one entry;checkbox.dart/cupertino_checkbox.dartleavelegacy_renderers.txt;cupertino_control_independence_test.dartmountsAdaptiveCheckboxControl(assertions unchanged, passing).Parity changes (DC-5)
toggle_inputsListTilechangefrom disabled checkboxesspacingignored (Cupertino only)checkbox(spacing:)works on Androidruby_checkbox_keys_test.dartpage.invoke(checkbox, "focus")waited for the invoke timeoutUnsupportedErrortextinvoke focusEverything else (payloads, geometry, tristate cycle, semantics, label styling, control labels, scale-to-fit) is unchanged on both designs, as the unchanged snapshots show. The audit's 2 baseline Checkbox findings (
on_focus/on_blurnot fired) are fixed.Tests
test/widgets/ruby_checkbox_keys_test.dart(2):spacingand the per-design default gap.team/verify_pr.shon head 9491fb3 (base 81609d0 + #81 @ 02c2d4b) with rufletorigin/main(b5fd1694): PASS: engineflutter test+982 all passed,flutter analyze lib testno issues, ruflet_core 153/153 files, wire-key audit (spec-aware, see #84) 0 new findings.Round 2 (rebased onto #81 @ 02c2d4b after QA review)
Still exactly two own commits. The snapshot commit is unchanged in content and still passes against the legacy renderer on the new #81. In the migration commit:
label,label_position,spacing,widthandheightasconsumer: PropConsumer.core. Every other prop must be referenced by each skin it lists, so the core mentioning a field no longer excuses a skin. C4 passes under the stricter rule.Controltoken or Control imports, and the constructor only forwardssuper.control.Checkbox/CupertinoCheckbox). The parity script starts withtap native, a pointer tap on the native widget, so the skin's ownonChangedwiring is compared on both designs, and it ends withunfocus. C7 now proves the script fires every core event:change(native tap through the tristate cycle),focusandblur.Gate
No open PR touches
adaptive_checkbox.dart,checkbox.dartorcupertino_checkbox.dart(checked before starting and before opening).cupertino_control_independence_test.dartandcore_manifest.dartare also edited by sibling #84 (adjacent lines): keep both when merging the second.