Skip to content

Android snapshot -i drops alert dialog title and message #4481

Closed

Description

@thymikee

Purpose

On Android, snapshot -i drops a dialog's title and message. An external user's adb stack on agent-device 0.21.36 (Android 17 emulator) saw only Cancel and OK on Settings > About phone > Device name. Nothing told the agent what OK confirms.

Reproduced on main (eec35e9) on an Android 15 emulator, Settings > About emulated device > Device name (AppCompat AlertDialog, android-helper backend):

@e4 [scroll-area] [scrollable]
@e5 [text-field] "sdk_gphone64_arm64" [focused] [editable]
@e6 [scroll-area] "com.android.settings:id/buttonPanel" [scrollable]
@e7 [button] "Cancel"
@e8 [button] "OK"

The full snapshot and --raw both show [text] "Device name" (com.android.settings:id/alertTitle) inside com.android.settings:id/parentPanel. The cause: shouldIncludeAndroidNode (packages/platform-android/src/ui-hierarchy-inclusion.ts) keeps passive text in -i only next to a target or inside a list.

Required behavior

  • In snapshot -i, keep meaningful passive text (title, message, custom-view text) inside an AlertController panel (*:id/parentPanel, platform or AppCompat package).
  • Keep dropping all other passive text, for example screen headers and the status-bar clock.
  • Add at most one line per kept text node. Leave full snapshot and --raw unchanged.

Completion conditions

  • A fixture captured from the Device name dialog fails on main because Device name is missing from the interactive walk, and passes with the fix.
  • The closest negative passes: the same text node outside a panel stays dropped.
  • On a live device with androidSnapshot.backend: android-helper, snapshot -i on the Device name dialog shows [text] "Device name".
  • website/docs/docs/snapshots.md says what -i keeps on Android dialogs.

Out of scope

Compose dialogs, such as Settings > Apps > Calendar > Disable, and Reset app preferences on Android 15. Their tree has no dialog id or pane marker, so -i still drops their title and message. A fix needs a helper-side signal, such as a window title or pane title. Handle that in a separate issue.

Dependencies

None.

Activity

  1. apex-sentinel-staging commented on Nov 12, 2026

    @apex-sentinel-staging

    Apex Sentinel · Issue review

    Suggested label: bug

    The report reproduces snapshot -i omitting AlertDialog title/message on Android and identifies the exact inclusion logic in packages/platform-android/src/ui-hierarchy-inclusion.ts, making it a concrete defect.

    Required sections

    • Steps to reproduce
    • Expected and actual behavior (missing)
    • Version or environment (missing)
  2. added
    bug
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions