Repository navigation
feat: accept renderer-supported keywords Ruby rejected - #27
Merged
Merged
Conversation
The Material ListTile renderer reads focus_color (list_tile.dart:76, a color) for its keyboard-focus highlight, but the Ruby keyword list rejected it with ArgumentError. The canonical list_tile contract inherits the keyword from the Material class. The Cupertino tile has no focus highlight, so cupertino_list_tile is unchanged.
The Material Chip renderer reads mouse_cursor (material_chip.dart:78, a cursor name such as "click" parsed by parseMouseCursor), but the Ruby keyword list rejected it with ArgumentError. The Cupertino chip does not read it, so it only affects pointer platforms that render Material.
page_view.dart:79-82 reads animation_duration (getDuration: milliseconds as a
number, or a {seconds:, milliseconds:, ...} hash; default 1 second) and
animation_curve (a Flutter curve name such as "easeInOut", matched
case-insensitively; default linear) as the defaults for the go_to_page,
next_page and previous_page methods. The Ruby keyword list rejected both with
ArgumentError. Ruby sends no default, so the renderer's defaults apply.
The Cupertino container renderer reads opacity_on_click (cupertino_container.dart:95, a double, default 0.4) as the pressed opacity of an interactive container with ink: true, but the Ruby keyword list rejected it with ArgumentError. Material containers keep their ink splash and ignore the value.
…inKit
ruflet_spinkit's renderer (spinkit.dart:33-37) reads four variant options
that the Ruby keyword list rejected with ArgumentError:
- line_width (double): ring and dual_ring (default 7.0), spinning_lines (2.0)
- border_width (double): ripple (default 6.0)
- item_count (int): wave and piano_wave (default 5)
- wave_type ("start", "end" or "center"): wave (default "start")
Ruby sends no default, so the renderer's per-variant defaults still apply.
view.dart:210 builds the bottom_sheet child and hands it to PlatformPageScaffold. Material places it in Scaffold.bottomSheet, and the Cupertino scaffold pins it bottom-center above the body (cupertino_page_scaffold.dart:132-136). Pagelet already accepts the same slot. View rejected the keyword with ArgumentError. This is a persistent slot that renders any control. Modal sheets still go through page.show_bottom_sheet / page.bottom_sheet=, which are unchanged.
This was referenced Oct 28, 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.
Summary
The engine already reads these wire keys, but Ruby's control
KEYWORDSdid not list them. SoRuflet.list_tile(title: "x", focus_color: "#f00")and the others raisedArgumentError: unknown keyword, and the renderer feature could not be reached from Ruby. This PR adds each key to the right control class and its props copying. There is one commit per control so each change can be reviewed on its own.I opened each Dart read before adding its keyword. Ruby sends no default for any of them, so the renderer's defaults still apply.
list_tile)focus_colorlist_tile.dart:76getColor("focus_color")list_tilecontract inherits it.cupertino_list_tileis unchanged because the Cupertino tile has no focus highlight.chip)mouse_cursormaterial_chip.dart:78getMouseCursor("mouse_cursor")"click","forbidden", ...)page_view)animation_curve,animation_durationpage_view.dart:79-82"easeInOut", matched case-insensitively), default linear. Duration in ms or a{seconds:, milliseconds:}hash, default 1 s. These are the defaults for thego_to_page/next_page/previous_pagemethods.container)opacity_on_clickcupertino_container.dart:95getDouble("opacity_on_click", 0.4)ink: trueon an interactive container.spinkit)line_width,border_width,item_count,wave_typeruflet_spinkit/lib/src/spinkit.dart:33-37line_widthdouble: ring/dual_ring 7.0, spinning_lines 2.0.border_widthdouble: ripple 6.0.item_countint: wave/piano_wave 5.wave_type"start"/"end"/"center": wave, default start.view)bottom_sheetview.dart:210buildWidget("bottom_sheet")View
bottom_sheet: I checked it before adding itIt is a real slot.
view.dart:210passes the built child toPlatformPageScaffold(bottomSheet:):material_page_scaffold.dart:94puts it inScaffold.bottomSheet, a persistent bottom sheet.cupertino_page_scaffold.dart:132-136puts it inAlign(alignment: bottomCenter)above the body.Pageletalready accepts the samebottom_sheetslot in Ruby and Dart. This slot is persistent: it renders any control, such as acontainer, and it is not the modalBottomSheetcontrol. Modal sheets still go throughpage.show_bottom_sheet/page.bottom_sheet=(Page::DIALOG_PROP_KEYS). That routing is unchanged, sopage.set_view_props(bottom_sheet: ...)still means the modal dialog. Only an explicitRuflet.view(..., bottom_sheet: ...)gets the persistent slot.Usage
Tests
Each control's existing
*_compatibility_test.rbgets new assertions that the key is accepted and serializes into_patchwith the right value. Each one raisedArgumentErrorbefore its commit.list_tile_compatibility_test.rb:focus_coloris lowercased like other colors, works through thelisttilealias, and is omitted when unset.chip_compatibility_test.rb:mouse_cursoraccepts a string and a symbol.page_view_compatibility_test.rb: curve as a string or symbol, duration as an int or hash, and no default is sent.container_compatibility_test.rb:opacity_on_clicktogether withink/on_click, and omitted when unset.spinkit_compatibility_test.rb:item_count+wave_type(wave, piano_wave),line_width(ring, dual_ring, spinning_lines),border_width(ripple), and no defaults are sent.view_compatibility_test.rb: thebottom_sheetcontrol serializes as a nested patch, and a button inside it is registered and receivesclickthroughpage.dispatch_event.verify_pr.sh "" <ruby-wt>:ruby:ruflet_corePASS, 145/145 files, 626 runs (618 baseline + 8 new).Extra run with
RUBY_PKGS="ruflet ruflet_server ruflet_rails": all PASS. ruflet 13/13 files, 160 runs. ruflet_server 11/11, 40 runs. ruflet_rails 15/15, 278 runs. Same as baseline.Wire-key audit (
wire_key_audit.rb, this branch against the engine): "Dart reads, Ruby lacks" goes from 66 to 56. All 10 keys above are gone, one near-miss is gone (View: ruby=bottom dart=bottom_sheet), and there are no new findings (prop not read147,event not fired71, unchanged).QA finding:
qa-baseline.md, section "Dart reads keys Ruby cannot send (missing Ruby keyword, so Ruby raises ArgumentError)".Follow-up for the integrator: the template's
tool/conformance/ruflet_control_surface.jsonrecords keywords, so it needs to be regenerated after this lands.Related engine PRs from the same parity pass, which are independent of this one: AdamMusa/ruflet-engine#6 (Cupertino ListTile
on_long_press) and AdamMusa/ruflet-engine#7 (ReorderableDragHandle layout keywords).