refactor(folio-spec): use element.id for focused field tag

Now that ResourceID populates uniformly across Android/iOS Compose,
the spec can read element.id directly instead of probing attrs for
each platform's underlying field name.
This commit is contained in:
pj committed 2026-04-26 23:57:01 +07:00
1 parent 139ca958f6
commit 0bce959d34
1 file changed
+1 -7
+1 -7
View File
@@ -64,13 +64,7 @@ const ledgerRows = extract<LedgerRow[]>(s => {
const ledgerBalance = extract(s =>
parseDollarCents(s.ax.find({ testTag: "LedgerBalance" })?.text));
// Focus uses the native focused="true" attribute. We surface whichever
// stable identifier the focused element carries (testTag, label, etc).
const focusedFieldTag = extract(s => {
const f = s.ax.find({ focused: "true" });
if (!f) return null;
return f.attrs?.["resource-id"] ?? f.attrs?.["accessibilityIdentifier"] ?? f.attrs?.["identifier"] ?? null;
});
const focusedFieldTag = extract(s => s.ax.find({ focused: "true" })?.id ?? null);
const loginEmailField = extract(s =>
s.ax.find({ testTag: "LoginScreen" })?.find({ testTag: "LoginEmail" }));