Repository navigation
refactor: move the IconButton family onto the shared control core - #91
Merged
AdamMusa merged 3 commits intoNov 2, 2026
Merged
Conversation
Record the legacy renderers of the four IconButton wire types (IconButton, FilledIconButton, FilledTonalIconButton, OutlinedIconButton) on iOS and Android as JSON snapshots: geometry, semantics, what they send to Ruby during semantics taps, pointer taps, long presses, mouse hover and keyboard focus, and invoke outcomes, plus selected, disabled, maximal and AppBar leading back fixtures. The migration onto the shared control core may change them only as listed in its parity table.
IconButtonCore now owns everything Ruby sends or receives for the IconButton, FilledIconButton, FilledTonalIconButton and OutlinedIconButton wire types: one spec per wire type (picked from its wire type), click with url, long press, hover and pressed state, the selected state, focus and the focus/blur methods, and whether it is an AppBar's leading button (the iOS back chevron). The Material skin maps the core onto IconButton and its variants; the Cupertino skin (the former legacy CupertinoButtonControl) renders CupertinoButton from core values. The registry entry has the canonical shape (create: IconButtonCore.new). Both designs now answer the blur method; iOS reports the enabled state to accessibility and honors selected_icon, selected_icon_color, disabled_color and enable_feedback; Android honors style and visual_density. Snapshots change only for those rows.
This was referenced Oct 29, 2026
Brings in the PRs merged since, so #91 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 #90 (Button family), then #88 (entry-shape rule +
wireType/parentWireType/parentSlot), then #81. The legacyCupertinoButtonControlthis PR converts was shared with the legacy Button until #90. Until those merge, this PR's diff also shows their commits; review the last two.What
Item 5 of the decoupling plan: the four IconButton wire types (IconButton, FilledIconButton, FilledTonalIconButton, OutlinedIconButton) move onto the shared core. Exactly two own commits:
test: snapshot IconButton renderer behaviour: JSON snapshots of the legacy renderers (test/widgets/icon_button_snapshot_test.dart,test/snapshots/IconButton/*.json). There are 8 fixtures × iOS/Android:invoke focus,invoke blur;selected_iconandselected_icon_color), disabled (withdisabled_color), maximal (every key plus astylemap);refactor: move the IconButton family onto the shared control core: the migration. Snapshots change only per the parity table below.Design
controls/icon_button_core.dart(new)IconButtonPropsand a singleIconButtonCore(FocusableCore), which picks its spec and variant fromwireType. It owns: click (withurl); long press; hover and pressed state (oneMouseRegion+Listener, the same as Button); the selected state; focus; thefocus/blurmethods;isAppBarLeading(parentWireType == 'AppBar' && parentSlot == 'leading', #88).controls/material_icon_button.dartMaterialIconButtonSkin->IconButton/.filled/.filledTonal/.outlined.controls/cupertino_button.dartCupertinoButtonControlintoCupertinoIconButtonSkin, a CupertinoButton around the icon with thestylemap resolved againstcore.states. Keys IconButton does not have keep their legacy defaults (pressed opacity 0.4, radius 8, large size). The iOS back chevron for a Material back arrow in an AppBar's leading slot is unchanged.controls/icon_button.dartcreate: IconButtonCore.new, C1e). The key iscontrol_<wire type>_<id>.Core-consumed:
url. Material-only, with reasons:highlight_color,hover_color,splash_color,splash_radius(ink),visual_density,size_constraints. Cupertino-only:bgcolor(Material takes it throughstyle). The manifest has four entries (native widgetsIconButton/CupertinoButton), each with a parity script oftap native, long press, hover, Tab andunfocus. Both skin files leavelegacy_renderers.txt, and nothing uses the legacy class any more.Parity changes (DC-5)
page.invoke(icon_button, "blur")raised "Unknown IconButton method"blurunfocuses (blurevent)blurworksinvoke blurhasEnabledState/isEnabled, as on Material and as the Button family (#90)selected_iconignoredselected, as on Materialselected_icon_color,disabled_color, top-levelenable_feedbackignoredruby_icon_button_keys_test.dartstyleignored (only the never-sent_internals.stylewas read);visual_densityignoredcompact);stylein the keys testicon. Android: an ErrorControl, unless the non-Rubycontentchild was set, which was rendered as the icon. iOS:content, when set, was rendered as the button's child (CupertinoButtonControl's fallback); otherwise the button was empty.contentis no longer read.contentis not an IconButton keyword in Ruby, so no Ruby app sends it; the renderer matrix's default fixture was the one place that did.icon_button()withouticonrenders empty on both designs, as old iOS did; no Ruby call can setcontentException(...)UnsupportedErrortextUnchanged on both designs (identical snapshots): geometry (except row 5), click/long-press/hover/focus payloads, disabled behaviour, the iOS AppBar back chevron and the maximal
stylerendering on iOS. The audit's 12 baseline findings (on_focus/on_blurnot fired andvisual_densitynot read, on all four types) are fixed.Tests
test/widgets/ruby_icon_button_keys_test.dart(3): Androidstyle, iOSselected_icon_color, iOSdisabled_color.native_back_icon_test.dart,button_platform_size_test.dartand the renderer matrix pass unchanged.team/verify_pr.shon head 968d610 (on #90 f7a7e8f) with rufletorigin/main43928509: PASS: engineflutter test+1109 all passed,flutter analyze lib testno issues, ruflet_core 157/157 files, wire-key audit 0 new findings, 12 fixed.Gate
No open PR touches
icon_button.dart,material_icon_button.dartorcupertino_button.dart; checked before starting and before opening.