Repository navigation
fix: render Semantics content and honor Ruby semantics keys - #2
Merged
AdamMusa merged 2 commits intoOct 28, 2026
Merged
Conversation
This was referenced Nov 20, 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.
Problem
Ruby's
SemanticsControl(packages/ruflet_core/lib/ruflet_ui/ruflet/ui/controls/shared/semantics_control.rb) defines the wire keys.semantics.dartread different names, so Flutter received nothing for several of them:contentSemanticshad nochild:)semantics(text("Hi"), label: ...)showed nothing on either designtextfieldtext_fieldhint_texthinton_tap_hint_texton_tap_hinton_long_press_hint_texton_long_press_hintfocusfocusedon_tapon_click, fired"click"on_tapnever firedon_long_presson_dismiss, fired"dismiss"(copy-paste bug)on_long_pressnever fired. A long press ran theon_dismisshandleron_double_tapQA finding #1, #2, #3.
Fix
control.buildWidget("content")and pass it as theSemanticschild. With no content, the control still renders as a bare semantics node, as before.textfield,hint_text,on_tap_hint_text,on_long_press_hint_textandfocus.onTapnow checkson_tapand fires"tap".onLongPressnow checkson_long_pressand fires"long_press".on_double_tapfires"double_tap". Flutter has no double-tapSemanticsAction, so the content is wrapped in a widgets-layerGestureDetector(onDoubleTap:), only whenon_double_tapis set. It adds no Material or Cupertino widgets.on_*keyword in Ruby's KEYWORDS against the Dart wiring. They were already correct, and the test now covers them:increase,decrease,dismiss,scroll_left/right/up/down,copy,cut,paste,did_gain/lose_accessibility_focus,move_cursor_forward/backward_by_character(passes the bool),set_text(passes the text). The*_hint_textkeywords are strings, not handlers.The same renderer serves both designs. It uses only
package:flutter/widgets.dart, so Material and Cupertino behave the same way.Tests
New
packages/ruflet/test/widgets/ruby_semantics_test.dart. Each case runs on a Cupertino target (iOS,CupertinoApp) and a Material target (Android,MaterialApp):contentchild renders insideSemanticsControlwith a non-zero size.tester.getSemantics+isSemantics):isTextField,isFocused,hint,onTapHint,onLongPressHint, and the tap and long-press actions.on_*event fires under its own name. The test runs eachSemanticsActionand recordstriggerEventthrough a test backend, as the matrix test and QA repro do. A real double tap on the content firesdouble_tap.hint,text_field,focused,on_click) are ignored, andon_dismissno longer captures long presses.Results (Flutter 3.41.2):
ruby_semantics_test.dartgave+0 -8: Some tests failed.+8: All tests passed!. The QA reproqa_wire_key_repro_test.dart --name Semanticsgave+4: All tests passed!verify_pr.sh <worktree> "":