Skip to content

fix(android): carry an empty text on a node labelled by its content description - #4531

Merged
thymikee merged 1 commit into
callstack:mainfrom
vzkn:fix/android-own-text
Nov 14, 2026
Merged

thymikee merged 1 commit into
callstack:mainfrom
vzkn:fix/android-own-text

Conversation

@vzkn

@vzkn vzkn commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

An Android node is labelled by its text, else its content description; contentDescription is published only when it differs from the label (#2912). So a view with a description and no text was published exactly like a view showing that string: get text answered saved_task for an empty view.

The node now carries text when the view's text is not already the label: an empty string on a view labelled by its description, absent elsewhere. label and contentDescription are unchanged, so text ?? label is the text the view shows. Both Android producers (ADB helper, Appium source) follow the rule; the field joins the unchanged-snapshot comparison and the find/get digest. 10 files, +44/-7. Closes #4530.

agent-device get attrs 'id="dev.retest.bench.tasks:id/saved_task"' --json
# base: {"label":"saved_task","identifier":"…:id/saved_task"}
# head: {"label":"saved_task","text":"","identifier":"…:id/saved_task"}

Validation

Tested at bfd8ce71b, base ddbfc85.

  • pnpm check:affected --run --head bfd8ce71b: passes up to unit, where 19,762 pass and 6 fail. Base-blocked: the same 6 fail on ddbfc85 alone (Path is a directory in symlink cases of runner-artifact-manifest, runner-toolchain-identity, code-signature; macOS 27.2, Node 24.12).
  • The new case in src/__tests__/android-ui-hierarchy.test.ts fails on base and passes on head.
  • Live, Android 15 emulator (API 35), helper 0.21.38-nightly.20261113.167: base and head snapshots, regular and raw, differ only by text: "" on description-only nodes. Once the view shows saved_task, its node has no text.
  • Not run: helper build (no helper source changed), Appium on a device, CI device lanes.
  • Risk: JSON grows by "text":"" on description-only nodes.

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

View guided diff

@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 10 files

View guided diff | Re-trigger cubic

@thymikee

Copy link
Copy Markdown
Member

This PR is ready: I found no problems in bfd8ce7. Only one external review check has reported on this head, and it passes. The repository CI for this fork has not run yet and needs maintainer approval. The six local failures you reported (runner-artifact-manifest, runner-toolchain-identity, code-signature) are in files this diff does not touch. I did not run the new tests or the emulator snapshots, so I rely on your emulator run and judged the regressions by reading the base code. There are no conflicts.

Not blocking, and you can take or leave these: the reproduction in #4530 (get text 'id=...saved_task' answering saved_task for a view with no text) still behaves the same, because extractReadableText and the text= matcher ignore node.text, so please state whether get text and text= are a deliberate follow-up before keeping Closes #4530; text: '' is now emitted on every description-only node, including icon ImageButton and ImageView nodes, so snapshots grow, and limiting it to text-capable classes would shrink that; and text in snapshot.ts is present only when empty, so a future reader should go through one helper instead of re-deriving text ?? label.

Before merge, the repo CI gates need to run on this head, and the maintainer should confirm that publishing the field without changing get text or text= satisfies #4530.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 13, 2026
@thymikee
thymikee merged commit d38e35e into callstack:main Nov 14, 2026
15 checks passed
thymikee added a commit that referenced this pull request Nov 14, 2026
* origin/main:
  fix(android): carry an empty text on a node labelled by its content description (#4531)
  fix(ios): restore the back swipe's pre-swipe still span (#4515)
  fix(daemon-client): type the remote daemon refusal with its dispatch fact (#4532)
  fix: prepare reinstall artifacts before removing apps (#4533)
  fix(ios): classify the keyboard dismiss refusal by what it dispatched (#4536)
  fix(ios): press the navigation bar back button and speed up the back swipe (#4508)
  refactor(gestures): one owner for the densified gesture path; drop the unproven sendevent transport (#4239)
  fix(host-kit): keep Linux process identity stable across clock steps (#4438)
  fix(ios): bound the idle wait of keyboard dismiss and keyboard enter (#4454)
  fix(device-selection): fail an ambiguous device request with only the tied devices (#4506)
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: a view with a content description and no text reads the same as a view showing that text

2 participants