Skip to content

feat: add about_dialog control - #44

Merged
AdamMusa merged 2 commits into
mainfrom
feat/about-dialog
Oct 29, 2026
Merged

AdamMusa merged 2 commits into
mainfrom
feat/about-dialog

Conversation

@AdamMusa

Copy link
Copy Markdown
Owner

Engine counterpart (renderer): AdamMusa/ruflet-engine#29

Item D3 (P2): adds an about_dialog control, an about box with the open-source licenses page (App Store / Play compliance).

Ruby API

  • Class: controls/materials/aboutdialog_control.rb (AboutDialogControl). The type is aboutdialog and the wire name is AboutDialog.
  • DSL: about_dialog(**props) with the alias aboutdialog, in material_control_methods.rb, shared_control_forwarders.rb and dsl.rb. It is registered in both CLASS_MAPs.
  • KEYWORDS: application_icon application_legalese application_name application_version barrier_color controls data key modal open view visible on_dismiss. It is a dialog, so it takes no COMMON layout keywords.
    • view: "about" (default, decided by the renderer) or "licenses", which opens the licenses page directly.
    • modal and barrier_color were added for parity with alert_dialog; the spec lists neither.
  • Event: on_dismiss → "dismiss". As with every dialog, page.rb untracks it on dismiss.
  • Display: page.show_dialog(...) / page.close_dialog(...), like every dialog.

Material vs Cupertino (engine PR)

  • Material: the SDK AboutDialog and LicensePage.
  • iOS: a CupertinoAlertDialog with "View Licenses" / "Close", plus a hand-built Cupertino licenses page (inset-grouped package list, then license text). It uses no Material widgets.

Usage

about = about_dialog(
  application_name: "Rides",
  application_version: "1.4.0",
  application_icon: icon(Ruflet::MaterialIcons::DIRECTIONS_CAR),
  application_legalese: "© 2026 Rides Inc.",
  controls: [text("Made with Ruflet")],
  on_dismiss: ->(_e) { puts "closed" }
)
page.show_dialog(about)
page.show_dialog(about_dialog(application_name: "Rides", view: "licenses")) # straight to licenses

Tests

test/about_dialog_compatibility_test.rb has 5 runs and 32 assertions:

  • the wire type and every key serialize, including the icon Control and controls, and has_handler?(:dismiss)
  • no defaults are sent (view, open, modal)
  • layout keywords and unknown keywords raise ArgumentError
  • show_dialog opens it, and a dismiss dispatch calls the handler and untracks the dialog
  • close_dialog patches open: false on the control

The coverage tests are green.

verify_pr.sh (Ruby 4.0.5 + Flutter 3.41.2, against the engine PR):

PASS ruby:ruflet_core                   146/146 files, 623 runs
PASS engine:ruflet flutter test         +712: All tests passed!
PASS engine:ruflet analyze              No issues found!
INFO wire-key audit                     NEW vs baseline: 0

The template conformance counts (R12) are left to the integrator.

Adds AboutDialog (application_name/version/icon/legalese, controls,
view: about|licenses, modal, barrier_color, on_dismiss), shown with
page.show_dialog like every dialog.
@AdamMusa
AdamMusa merged commit add41c4 into main Oct 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant