Skip to content

fix(android): keep alert dialog title and message in snapshot -i - #4493

Merged
thymikee merged 1 commit into
mainfrom
fix/android-snapshot-dialog-text
Nov 12, 2026
Merged

thymikee merged 1 commit into
mainfrom
fix/android-snapshot-dialog-text

Conversation

@thymikee

@thymikee thymikee commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

On Android, snapshot -i dropped every passive text node, so an AlertDialog showed only its buttons. This PR keeps meaningful text inside an AlertController *:id/parentPanel (platform, AppCompat, Material). All other passive text stays dropped. 6 files plus one captured fixture. Compose dialogs are out of scope (see issue). --settle and wait stable now also compare dialog text, so a changing progress dialog keeps them waiting.

Fixes #4481

Validation

Live, Android 15 emulator, Settings > Device name, android-helper 0.21.37-dev:

base eec35e9622            head d0fa5d17e1
@e4 [scroll-area]          @e4 [text] "Device name"
@e5 [text-field] "sdk_…"   @e5 [scroll-area]
@e6 [scroll-area] buttons  @e6 [text-field] "sdk_…"
@e7 [button] "Cancel"      @e7 [scroll-area] buttons
@e8 [button] "OK"          @e8 [button] "Cancel"
                           @e9 [button] "OK"

At head, App info -i still drops the "Calendar" and "App info" headers.

Fixture test fails on base: expected [ 'Back', 'Home', 'Recents', …(5) ] to include 'Device name'.

pnpm check:affected --run --head d0fa5d17e1 (exactCommit): format, lint, typecheck, layering, fallow, build, vitest-related passed. unit failed: 3 timeouts at 5000 ms in release-script and fuzz-harness tests outside this diff. Host load average was about 160, and they also time out alone. Cause unproven locally. CI passed all 22 checks at d0fa5d1, including unit, provider integration, and docs.

Independent review: no blocking findings. Not applied: one shared parentPanel literal (the existing pattern is android:-only and also drives alert detection) and a named-flags object (an existing pattern, out of scope).

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

The interactive Android projection dropped every passive text node, so an
AlertDialog showed only its buttons and nothing said what OK confirms. Keep
meaningful text inside an AlertController parentPanel (platform or AppCompat);
other passive text stays dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.23 MB 6.23 MB +108 B
Package (unpacked) 6.23 MB 6.23 MB +108 B
Package (download) 1.89 MB 1.89 MB +2 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 51.7 ms 47.3 ms -4.3 ms
CLI --help 81.9 ms 105.3 ms +23.4 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel

Verdict: approve

No findings.

1 finding below minor not shown (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (0054479ff59e).

Feedback goes in the review comment threads, as a reply under the inline comment of a finding:

Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.

Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.

Comment @apex-sentinel-staging review on this conversation to run a full review.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready: at d0fa5d1 I found no problems in the Android alert title and message inclusion change. All 22 checks pass at that commit, and the author's local unit timeouts were in release-script and fuzz-harness tests that this diff does not touch. Not blocking, and fine to take or leave: isAndroidAlertPanelIdentifier in https://github.com/callstack/agent-device/blob/d0fa5d1/packages/platform-android/src/alert-detection.ts#L61 matches :id/parentPanel under any package, while ANDROID_ALERT_ID_PATTERN at line 54 lists parentPanel only under android:, so one shared panel-id predicate would remove the scope difference. I did not run the fixture test on base or head, and I took the live device output from the PR body without reproducing it. The PR body shows android-helper on Android 15, while the external report used the adb backend on Android 17, but both feed the same snapshot walk. No conflicts. No further action is needed before maintainer review.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 12, 2026
@thymikee
thymikee merged commit 79865c5 into main Nov 12, 2026
22 checks passed
@thymikee
thymikee deleted the fix/android-snapshot-dialog-text branch November 12, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android snapshot -i drops alert dialog title and message

1 participant