Skip to content

docs: wait for a slow first screen after a navigating tap on Android - #112

Draft
cryptotavares wants to merge 4 commits into
mainfrom
cryptotavares/mmcli-p1-52-launch-baseline
Draft

cryptotavares wants to merge 4 commits into
mainfrom
cryptotavares/mmcli-p1-52-launch-baseline

Conversation

@cryptotavares

@cryptotavares cryptotavares commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Part of the mm CLI v2 effort (ticket P1-52). Follows the #88 review by seaona.

Summary: On Android, the first tap on a tab that mounts slowly returns the old screen in the click's observation. A launch baseline does not fix this, so this PR changes docs only: after such a tap, the agent waits for the new screen's test ID and does not tap again.

Problem

The review of #88 asked to keep the launch observation as the settle baseline. Then mm launch followed by an Explore tap would get the #88 transition retry. That change was built and measured live (Android emulator, MetaMask Mobile dev build, Metro), and then dropped:

  • On main (671c50f), 10 of 10 launch → Explore taps returned the whole old Home (242 nodes), not a torn Home. The fix: retry a mobile observation while the screen is still tearing down #88 retry only handles a torn Home.
  • With the launch baseline, 15 of 20 taps showed Explore, but 13 of those 15 were still loading (226 of about 380 nodes). The other 5 showed the old Home. The first click after launch also costs one more snapshot: observation p50 490 ms → 1388 ms (Explore tap), 479 ms → 1375 ms (open-tab tap).
  • describe-screen before the tap does not help: 3 of 10 showed Explore.
  • click --observe none followed by describe-screen showed the old Home in 10 of 10 tries.

The cause is how long the screen takes to mount. The first Explore mount after an app restart takes about 2 s:

flowchart LR
    T["mm click Explore<br/>(tap works)"] --> O["+0.5 s click observation<br/>old Home, whole"]
    O --> D["+0.6 s describe-screen<br/>old Home"]
    D --> W["+1.3 s<br/>Home torn or whole"]
    W --> E["+1.9–2.3 s<br/>Explore appears"]
    O -.->|"new advice"| WF["mm wait-for --testid explore-safe-area"]
    WF --> E

    classDef new fill:#fff3cd,stroke:#d39e00
    classDef stop fill:#f8d7da,stroke:#c82333
    class WF new
    class O,D stop
Loading

Yellow boxes are new. Red boxes return the old screen.

Other tabs, on main:

Tap Observation shows the new screen
Explore, first visit (launch → click) 0 of 16
Money, first visit 0 of 9
Social, first visit 6 of 6
Explore or Money, later visits 9 of 9

So the problem is not only Explore: it hits slow first mounts. Later taps in the Social runs failed because the Social onboarding sheet covers the tab bar, so they are left out.

screenChanged is not a reliable signal here. It was true in 9 of the 10 describe-screen-first tries. In 5 of those 9, the only change was the tapped tab's press feedback (about 3 px).

What changes

Doc Before After
SKILL.md, observations The settle retries a screen that tears down, not one that fills in. New paragraph "Android: the first visit to a tab can return the old screen". Look for the new screen's test ID. If it is not there, run mm wait-for --testid <id>. Do not tap again.
SKILL.md, mm click "false means the screen looks the same as before the click" Adds: true does not prove that the app navigated. screenChanged is left out of the first click after mm launch.
README.md, mobile settle Lists the retry rules. Adds: the settle does not wait for a slow screen. The first Explore and Money visits can show the old screen for about 2 s. Use wait_for on the new screen's test ID.

Docs only. The commits on this branch add the launch baseline (3f17950), revert it (7d09014), then add the docs. The net diff touches README.md and SKILL.md only. No CHANGELOG entry.

Review: read the new SKILL.md paragraph first.

Testing
  • CI=1 yarn test passes (61 files, 2251 tests; all files 97.98 % statements). yarn lint and yarn build pass.
  • Live runs: Android AVD Medium_Phone_API_36.1, dev client 8.19.0, Metro 8085, read-only tab taps only. Before = main 671c50f (includes fix: retry a mobile observation while the screen is still tearing down #88), installed with yalc. Each try restarts the app (mm cleanup force-stops it), unlocks it, then runs a new mm launch that attaches to the unlocked app.
Flow (Explore tap) Build Explore in observation Observation p50
launch → click main 0 / 10 (10 whole Home) 490 ms
launch → click launch baseline (reverted) 15 / 20 (2 complete) 1388 ms
launch → describe-screen → click main 3 / 10 842 ms
launch → click --observe none → describe-screen main 0 / 10 —
Out of scope / follow-ups
  • A real fix needs a settle that waits for the expected screen. One option: a click flag such as --expect-testid <id> that makes the observation wait for that test ID. It costs nothing when unused. This needs its own ticket.
  • The reviewer saw a torn Home, which fix: retry a mobile observation while the screen is still tearing down #88 retries. This emulator mostly shows a whole Home. Same cause, different timing per machine.
  • Not checked on iOS.

This branch has not been deployed

No deployments
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