Repository navigation
fix: route page scroll and drawer methods to the page View - #54
Merged
Merged
Conversation
Page#scroll_to, show_drawer, close_drawer, show_end_drawer and close_end_drawer invoked control 1 (the Page). The Flutter Page listener does not know these methods and answered "Unknown Page method"; the View owns them. Like Flet, scroll_to now targets the root view and the drawer methods the top view, which is the implicit page view when the app has no explicit views. The drawer check follows the same view.
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.
Bug fix approved by the lead (found during Package A / A4, D-10 investigation). Ruby only; no engine change.
Bug
Page#scroll_to,show_drawer,close_drawer,show_end_drawerandclose_end_drawerinvoked control 1, the Page. On the Flutter engine, the Page's invoke listener (page.dart_invokeMethod) only knowstake_screenshot,push_route,get_device_infoandset_allowed_device_orientations. For anything else it throwsUnknown Page method: …, so these calls failed. The methods are answered by the View:view.dart_invokeMethodhandles the drawer methods.ScrollableControlhandlesscroll_to.ruflet_railsalready works around this by calling@page.invoke(screen.view, "show_drawer")directly (native_app/navigation.rb).Design intent
BasePage.scroll_tocallsself.__root_view().scroll_to(...)(views[0]), andshow_drawer/close_drawer/show_end_drawer/close_end_drawercallself.__top_view()(views[-1]).test_page_scroll_to_invokes_the_root_view_method.So the fix is on the Ruby side, matching Flet.
Fix
page.rb:invokeaccepts:root_viewand:top_view. They resolve to the first or last explicit View's wire id (registering the views if they haven't been registered yet), or to the implicit page View id when the app only usespage.add.scroll_totargets:root_view; the four drawer methods target:top_view.invoke(:page, …)still targets 1.Tests
test/page_view_methods_test.rb, 5 runs:scroll_to→ root view and the drawers → top view.page.updatehas registered the views.invoke(:page)still targets 1.control_id == 1. They now assert the view id:navigation_drawer_compatibility_test,page_compatibility_test#test_page_scroll_to_invokes_the_root_view_method.verify_pr.sh "" <this tree>withRUBY_PKGS="ruflet_core ruflet ruflet_server ruflet_rails": ruflet_core 146/146 files, 623 runs, ruflet 13/13 (160), ruflet_server 11/11 (40), ruflet_rails 15/15 (278), all PASS. A first run had one timing flake inruflet/run_command_test.rb#test_handle_reload_command_big_r_requests_full_restart(process-group kill under heavy machine load, unrelated to page.rb); it passed 4/4 times when rerun and on the full rerun. Wire-key audit against engine c9b9d76: NEW 0.Follow-up: #55 (default page View events) carries a cherry-pick of this commit, because it needs the
:root_viewinvoke target. Merge this PR first; the identical patch then merges cleanly.