Repository navigation
fix: lay out inline date pickers built in DSL blocks - #68
Merged
Merged
Conversation
Page::PRESENTED_OVERLAY_TYPES (#50) lists the DatePicker wire type, and #62 made cupertino_date_picker (and date_picker(inline: true)) send that wire type with inline: true so the engine draws it in place. DSL blocks skip presented overlays when they capture children, so an inline picker written as a block statement was silently dropped: `column { cupertino_date_picker; text("below") }` had only the text, and page.mount sent no DatePicker. v0.0.23 kept it as a column child. Page.presented_control? now treats a DatePicker whose inline prop is true as an ordinary control. A dialog date_picker (no inline, or inline: false) stays a presented overlay.
This was referenced Nov 7, 2026
AdamMusa
pushed a commit
that referenced
this pull request
Nov 7, 2026
Brings in #64 (reclaim only from child-control slots), #65 and #66 (Dropdown change event name and spellings) and #68 (inline date pickers in DSL blocks). Conflicts: - Page.presented_control?: #68 and this branch both exempt inline date pickers; kept this branch's inline_overlay? rule (any presented overlay built with inline: true), which #68's new tests also pass. - PropControls.reclaim: kept #64's child-slot walk and mounted-control rule together with this branch's last-first order; the comment covers both. Page#claim_prop_control now passes its value as a one-slot props hash, since reclaim reads props. - Dropdown contract and its test file: both sides' additions kept. ruflet_core 186/186 files (1039 runs), ruflet_rails 16/16, ruflet_record 5/5; ruflet_server and ruflet only the two environment-specific failures that also fail on main here. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MqfxcsDiEUZngybe9L72JQ
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
The v0.0.23 → main compatibility audit found that an inline date picker is silently dropped from DSL blocks.
Page::PRESENTED_OVERLAY_TYPES, which includes the wire typeDatePicker, so blocks no longer capture dialogs implicitly.cupertino_date_pickersend that same wire type withinline: true(on by default), so the engine draws it in place.date_picker(inline: true)does the same.PropControls.attachkeys only on the wire type, so it treats the inline picker as an overlay. It is kept only when it is the return value of aRuflet.*(WidgetBuilder) block or passed throughchildren:/controls::Ruflet.column { cupertino_date_picker; text("below") }[DatePicker, Text][Text]column { text("label"); cupertino_date_picker }(Kernel)[Text, DatePicker][Text]Ruflet.column { Ruflet.text("label"); Ruflet.cupertino_date_picker; Ruflet.text("after") }[Text](pre-#50)[Text, Text]column { date_picker(inline: true); text }[Text]page.mount { column { cupertino_date_picker; text } }Argument form (
column(children: [cupertino_date_picker, text])) already worked on main, so the two forms disagreed.Audit evidence:
compat/surface/inline_picker_probe.rbandcompat/risk/probes/p05b_cdp_block.rb.Why it matters for existing apps
Blocks are the documented way to build layouts (
column(children=nil, **props, &block),page.mount(&block)). An app that puts acupertino_date_pickerin a block gets nothing on screen: no error, no events. At v0.0.23 the picker was at least mounted as a child (it could be opened withpage.update(picker, open: true)). With #62 and the current engine it should now render in place, but in block form it never reaches the wire.Fix
Page.presented_control?returns false for aDatePickerwhoseinlineprop istrue. The picker is then laid out like any other control (the same treatment as Picker, TimerPicker and ActionSheet). A dialogdate_picker, with noinlineorinline: false(includingcupertino_date_picker(inline: false)), stays a presented overlay.PRESENTED_TYPESis unchanged.No engine change is needed. On
codex/engine-initialization,cupertino_date_picker_dialog.dartbuilds the inlineCupertinoDatePickerwhengetBool("inline")is true (ruby_date_picker_inline_test.dart).Tests
packages/ruflet_core/test/dsl_inline_date_picker_test.rb(9 tests):Ruflet.columnblocks, withRuflet.*helpers, with bare Kernel helpers, inDSL.appblocks and roots, and withdate_picker(inline: true);page.mountwith a nested block sends exactly one DatePicker, and a top-levelpage.mountlays it out;changeevent;presented_control?.dsl_presented_controls_test.rbstill passes. A plaindate_pickerin a block is still not captured, andDatePickerstays inPRESENTED_TYPES.cupertino_date_picker_compatibility_test.rbalso still passes.ruflet_core,ruflet_server,ruflet(CLI) andruflet_rails, each run per file.Doc-example harness
I ran all 183 documented examples on this branch and compared them with the v0.0.23 baseline outputs, ignoring
tree_probe: 0 differ (180 identical, 3 skipped, as on main). No documented example uses an inline picker in block form, so none had to change.On this branch the audit probe
p05b_cdp_blockgives back the baseline trees for every block form. The only differences from baseline are intended:inline: truekey from fix: send inline from cupertino_date_picker #62;Ruflet.*block now keeps all three children ([text(label), cupertinodatepicker, text(after)]). At baselineRuflet.*helpers were not captured, which fix: collect Ruflet.* helpers called inside DSL blocks #50 fixed.inline_picker_probe.rbnow reportspage.mount wire contains DatePicker: true.