fix(open): do not take a lone status line for the first screen

Merged
TH
2h ago
+78-13

Summary

On a cold Expo bundle, the first capture after open on a local iOS simulator returned Expo's progress banner as the app's first screen. The tree was the app root plus one StaticText "Bundling 91%…". Two reads 200 ms apart agreed on it, so the #4513 rule (any labeled non-root element) accepted it.

The first screen now needs a labeled element that is not text, such as a button, or two different texts. A busy indicator still doesn't count. React Native mirrors a text into two nodes with the same label, so texts are counted by label, not by node.

A first screen made of a single line of text and nothing else now waits the full 10 s and returns loading. #4599 adds the opt-out for that case.

3 files: the rule, two tests (lone status line, two texts), and the docs.

Validation

At 1122461:

  • pnpm typecheck and pnpm lint pass.
  • Vitest passes for daemon and capture-kit: 5,614 tests.
  • Live, iPhone 17 Pro simulator on iOS 27.0, Agent Device Tester Debug dev build. Metro (expo start --dev-client --clear) was restarted before each cold run.
    • Before: open --relaunch --foreground returned 2 nodes, Bundling 91%…, in 7.5 s. A second cold run returned Bundling 94%….
    • After: 2 cold runs returned the 52-node home screen in 11.2 s and 11.1 s, with no postGestureOutcome. The warm relaunch is unchanged: 52 nodes in 6.8 s.
  • CI owns the remaining gates.

🤖 Generated with Claude Code


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