From 55b58613954b0f9a16c739d2397afe207268d5a2 Mon Sep 17 00:00:00 2001 From: PJ Date: Mon, 27 Apr 2026 00:55:03 +0700 Subject: [PATCH] docs+folio: use native boolean for focused selector and document typed attrs --- docs/manual/spec-language.md | 4 +++- examples/folio/sanderling/spec.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/manual/spec-language.md b/docs/manual/spec-language.md index e394fef..143fdf2 100644 --- a/docs/manual/spec-language.md +++ b/docs/manual/spec-language.md @@ -64,11 +64,13 @@ Pass an object to apply multiple attribute filters with AND semantics: ```ts s.ax.find({ accessibilityText: "LoginScreen" }) -s.ax.find({ accessibilityText: "account_card", clickable: "true" }) +s.ax.find({ testTag: "AccountCard", clickable: true }) ``` Every key-value pair must match. Substring and boolean rules apply per attribute. +Known attribute names are typed; you get autocomplete on `testTag`, `text`, `content-desc`, the boolean states (`clickable`, `enabled`, `focused`, `checked`, `selected`), and the cross-platform aliases (`identifier`, `accessibilityIdentifier`, `accessibilityText`, `accessibilityLabel`, `label`, `resource-id`, `class`, `elementType`, `package`, `placeholderValue`, `hintText`). Boolean state attributes accept a native `true` / `false`. Other attribute keys still type-check as a string-valued fallback so raw driver attributes remain reachable. + ### Path queries Chains of string selectors separated by ` > ` scope each segment to the subtree of the previous match. Path queries are only supported on the tree root (`ax.find`, `ax.findAll`), not on element-scoped `.find`/`.findAll`. diff --git a/examples/folio/sanderling/spec.ts b/examples/folio/sanderling/spec.ts index d08f056..43314ca 100644 --- a/examples/folio/sanderling/spec.ts +++ b/examples/folio/sanderling/spec.ts @@ -58,7 +58,7 @@ const ledgerRows = extract(s => const ledgerBalance = extract(s => parseDollarCents(s.ax.find({ testTag: "LedgerBalance" })?.text)); -const focusedFieldTag = extract(s => s.ax.find({ focused: "true" })?.id ?? null); +const focusedFieldTag = extract(s => s.ax.find({ focused: true })?.id ?? null); const loginEmailField = extract(s => s.ax.find([{ testTag: "LoginScreen" }, { testTag: "LoginEmail" }]));