Skip to content

Commit 4abf99e

Browse files
docs(apple): state the text-entry trait precedence and what was captured live
1 parent ce8afdf commit 4abf99e

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

‎docs/adr/0004-ios-snapshot-backend-strategy.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,10 +746,13 @@ The decoder does the same.
746746
Otherwise, a `role=button` tab selector that matches the runner tree does not match the bridge tree.
747747

748748
A custom-drawn text input, such as a Compose Multiplatform text field, reports the automation type `Other`.
749-
It carries the private text-entry trait (bit 18), and also the secure-text-field trait (bit 24) or the text-area trait (bit 47) where they apply.
750-
XCTest types such an element as `TextField`, `SecureTextField`, or `TextView`.
751-
The decoder does the same for an `Other`, and types a search-field-trait (bit 10) input as `SearchField`.
749+
It carries the private text-entry trait (bit 18).
750+
XCTest types such an element as a text input, and the runner tree reports it editable.
751+
The decoder types an `Other` that carries the text-entry trait as `SecureTextField` with bit 24, else `SearchField` with bit 10, else `TextView` with bit 47, else `TextField`.
752+
A declared automation type is kept.
752753
Otherwise, the bridge tree reports the input as not editable, and a `fill` client refuses it.
754+
Only the `TextView` word (bits 18, 33, and 47, from a Compose Multiplatform 1.12 `BasicTextField` on iOS 27) was captured live.
755+
The other three branches and their precedence follow the trait names and are not captured yet.
753756

754757
The snapshot API reports the frames of a windowed app relative to its window, not to the screen.
755758
Windowed Apps and Stage Manager both put an app in such a window.

‎packages/platform-apple/src/snapshot-source/tree.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,16 +148,18 @@ const KEYBOARD_FOCUS_TRAIT = 1n << 21n;
148148
*/
149149
const TAB_BUTTON_TRAIT = 1n << 28n;
150150

151-
/**
152-
* The traits UIKit sets on a text input: the private text entry (bit 18), secure text field (bit 24),
153-
* and text area (bit 47), and the public search field (bit 10). A custom-drawn input, such as a
154-
* Compose Multiplatform text field, reports the automation type of a plain view (`Other`), and
155-
* XCTest types it from these bits, so the runner path answers `TextField`, `SecureTextField`,
156-
* `TextView`, or `SearchField` for it. The bridge derives the type from them for an `Other` to match.
151+
/*
152+
* The traits XCTest types a text input from. A custom-drawn input, such as a Compose Multiplatform
153+
* text field, reports the automation type of a plain view (`Other`), so the bridge derives the type
154+
* from these bits for an `Other` to match the runner path.
157155
*/
156+
/** Public search field: an input is a `SearchField`. */
158157
const SEARCH_FIELD_TRAIT = 1n << 10n;
158+
/** Private text entry: the element is a text input. */
159159
const TEXT_ENTRY_TRAIT = 1n << 18n;
160+
/** Private secure text field: an input is a `SecureTextField`. */
160161
const SECURE_TEXT_FIELD_TRAIT = 1n << 24n;
162+
/** Private text area: an input is a `TextView`. */
161163
const TEXT_AREA_TRAIT = 1n << 47n;
162164

163165
/**

0 commit comments

Comments
 (0)