fix(snapshot): print an empty text field's placeholder in snapshot -i

Merged
SH
13h ago
+48-1

Summary

Fixes #4452. An empty Flutter TextField on Android carries its hint only as placeholder, so its snapshot -i line had no name: @e4 [text-field] [editable].

The line renderer now prints the placeholder as metadata, in the form of the existing preview: marker, when an editable field has no label and no value:

@e4 [text-field] [editable] [placeholder:"Search"]

A field with a value or a label prints as before. A field that shows only its identifier still prints the placeholder. A native EditText that shows its hint already gets it as the label, so its line does not change. Selectors, find and fill are unchanged, as the triage asked; the snapshot help says so in one sentence.

3 files: snapshot-lines.ts, its help in capture/snapshot.ts, and two cases in snapshot-android.test.ts. No scope expansion.

Validation

Base 799e9c0, head 1c706f0 (merges main at e54dc4d; #4446 edited the same help line).

pnpm exec vitest run --project unit-core packages/command-output/src/output/snapshot-android.test.ts: base 1 failed, 9 passed; head 10 passed. The identifier case also fails with the fbbfc7e renderer.

pnpm check:quick: passed. pnpm check:affected --run --head 1c706f0 (exactCommit: true): every check before unit passed, including vitest-related (402 tests). unit failed in 6 files I do not touch (release-assets, apple-ci-impact, android-manual, release-publish, host, index-metro). Four of them fail on this host with the base versions of my files. index-metro passes alone. CI owns the full unit run.

Not device-facing: capture is unchanged, only the text line.