Skip to content

feat: detect jetpack compose material3 alert dialogs - #418

Merged
gmegidish merged 2 commits into
feat/compose-textfield-labelfrom
feat/compose-alert-dialog
Oct 18, 2026
Merged

gmegidish merged 2 commits into
feat/compose-textfield-labelfrom
feat/compose-alert-dialog

Conversation

@gmegidish

Copy link
Copy Markdown
Member

Summary

  • waitForEvent('dialog'), screen.on('dialog') and getByRole('alert') now detect a Material3 AlertDialog.
  • Material3 draws the dialog itself, with none of android.app.AlertDialog's android:id/* ids. The one marker is the pane title BasicAlertDialog sets: semantics { paneTitle = getString(Strings.Dialog) }, which is "Dialog" in English. mobilecli reports it as paneTitle (feat: report pane titles on android elements mobilecli#525).
  • In a detected dialog:
    • Title: the first text. Message: the rest of the text.
    • Buttons: the clickable nodes, named by their child text.
    • Accept and dismiss: Material3 lays out dismissButton before confirmButton, so accept presses the last button and dismiss the first (the only one, if there's one).
    • Type: a text field makes it a prompt; otherwise two or more buttons make it a confirm, and one button an alert.
  • A ModalBottomSheet ("Bottom Sheet") or a plain Dialog { } without a pane title is not treated as an alert.
  • Dialog button captions read through accessibleName, so a Compose button's caption comes from its child.

Stacked on #417, which builds on #416.

Notes

  • Only Material3's English "Dialog" string is matched, so other locales aren't detected yet. This is marked with a ponytail: comment.

Test plan

  • npm run build, npm test (975 passed), npm run lint
  • New dialog tests: a confirm with title and message, a title-only dialog, a single-button alert, accept/dismiss/tap by caption, and a bottom sheet that is not a dialog. Plus an alert role test.
  • Milliways conformance with mobilecli #525:
    • Android emulator: all dialogs tests and getByRole › finds an alert pass (109 passed overall, up from 94)
    • iOS simulator: 156 passed, 1 skipped, 0 failed

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 413e7f2c-e0be-41ff-bca4-a4606344b803

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@gmegidish
gmegidish force-pushed the feat/compose-textfield-label branch from e732206 to f354b19 Compare October 16, 2026 18:58
@gmegidish
gmegidish force-pushed the feat/compose-alert-dialog branch from 11051e0 to 4af98f1 Compare October 16, 2026 18:58
@gmegidish
gmegidish force-pushed the feat/compose-textfield-label branch from f354b19 to b45a1e2 Compare October 16, 2026 19:01
@gmegidish
gmegidish force-pushed the feat/compose-alert-dialog branch from 4af98f1 to fa994a0 Compare October 16, 2026 19:01
@gmegidish
gmegidish force-pushed the feat/compose-textfield-label branch from f6a4228 to 266fd02 Compare October 17, 2026 20:05
@gmegidish
gmegidish force-pushed the feat/compose-alert-dialog branch from b7f020d to 8d85472 Compare October 17, 2026 20:06
@gmegidish gmegidish mentioned this pull request Oct 17, 2026
3 tasks done
@gmegidish
gmegidish merged commit f8b2bde into feat/compose-textfield-label Oct 18, 2026
6 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