Repository navigation
fix: deliver legacy DropdownM2 change through the alias table - #100
Merged
AdamMusa merged 1 commit intoNov 2, 2026
Merged
Conversation
The Cupertino dropdown branched on the DropdownM2 wire name to fire an extra `change` event. Current Ruby never sends that wire (dropdown_m2 has emitted the canonical Dropdown with on_select since b9e52ff7), but gems up to v0.0.21 still do, with on_change, and the template is fetched live. Renderers now fire only the canonical `select`; a control_type.dart table records that the legacy DropdownM2 alias subscribes to it as `change`, and the backend's on_<event> gate delivers it under that name. Old clients keep their on_change on iOS, with no wire-name branch in the renderer.
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.
Legacy-renderer fix in the same class as #93: it removes a renderer branch on a wire name. It is not part of the control-core stack and has no dependencies. It needs no Ruby change.
Finding: the branch was not dead
cupertino_input_controls.dartfired an extra event for one wire name:dropdown,dropdown_m2anddropdownm2have all sent the canonicalDropdownwire type since b9e52ff7 (released in v0.0.22). Since ruflet#28,dropdown_m2(on_change:)is sent ason_selectand Ruby routes theselectevent to that handler (test_dropdown_m2_on_change_fires_on_the_canonical_select_event). So the canonicalselectpath covers it._c: "DropdownM2"withon_change.ruflet buildfetches the template live, so those apps run this engine.on_change.dropdown.dartrenders the Material 2 widget for that wire, which fireschangeitself.Cupertino shows the hint placeholder and fires change, pins that iOS behaviour.Deleting the line would therefore have silently dropped
on_changeon iOS for those apps while Android kept it. That conflicts with "aliases keep old wire names working" (DECOUPLING_SPEC §5.1, DC-7) and DC-5 (never remove a capability). So this PR fixes the branch rather than deleting it.Fix
select, and no longer looks at the wire name.control_type.dartgains a legacy event table next to the alias map:DropdownM2→{select: change}. It lists the name under which a legacy alias subscribes to a canonical event.RufletBackend.triggerControlEvent, the one place that checkson_<event>, translates the name through that table before checking. The legacy wire keeps receivingchange, and every other type is untouched (an identity lookup).ControlEvents→Control.triggerEvent). So once Dropdown is migrated, its core fires onlyselectand old clients still work.The edits stay clear of open PRs:
ruflet_backend.dartand the tests are touched by no other open PR.control_type.dartonly gains lines at the end of the file. fix: render the iOS sliding segmented control from Ruby's sliding prop #93 and fix: present the inline date picker from Ruby's inline prop #98 insert aftercanonicalControlType, andgit merge-treeagainst both is clean.cupertino_input_controls.dartis far from the fix: fire Ruby on_tap_outside_bar on Cupertino SearchBar #43/fix: honor Ruby expanded_insets, selected_suffix and hover_color on Dropdown #54/fix: support SearchBar open_view and close_view on iOS #70 hunks (lines 143–256).Not changed here:
dropdown.dartstill picks the Material 2 widget fromcontrol.type == "DropdownM2". That is the same class of branch, but it chooses a look for a wire that only pre-v0.0.22 gems send. Removing it is a decision for the Dropdown migration.Related, not fixed here: gems v0.0.22 and v0.0.23 send
dropdown_m2(on_change:)as_c: "Dropdown"withon_change: true. No renderer fireschangefor the canonical type, so that handler never runs on either design. ruflet#28 fixes this in Ruby, but it is not yet released.Tests
test/utils/control_type_test.dart(+1): the legacy event table mapsDropdownM2select→changeand leaves other events and types unchanged.test/widgets/ruby_dropdown_m2_test.dart(+2). The backend now records every event a renderer fires before theon_<event>gate.DropdownM2on iOS: the renderer firesselectand neverchange, and Ruby receiveschange"blue". The existingfires changetest is unchanged and still passes.dropdown_m2(on_change:, max_menu_height: 200)(_c: "Dropdown",on_select: true): Ruby receives oneselect"blue" and nochange.Mutation checks (each makes these tests fail):
team/verify_pr.sh(ruflet main as the Ruby tree): PASS.flutter test+1204, analyze clean.