Skip to content

UI: accessibility ids for focusable elements (projection layer) - #1431

Merged
GLinnik21 merged 48 commits into
mainfrom
a11y/ids
Nov 17, 2026
Merged

GLinnik21 merged 48 commits into
mainfrom
a11y/ids

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

What

This is the first layer of an accessibility-identifier system for UI tests. Every focusable element gets a stable id, taken from its place in the layout rather than from its content: home.shelf.2.card.5, detail.hero.play, nav.watchlist, settings.row.3. Tests and agents will then focus or press an element by name instead of walking to it with direction keys.

This layer only projects ids; nothing reads them at run time yet. The focus:, press: and state: FIFO tokens that use them come in the stacked PR #1432.

The id

  • An id is a pure projection of the FocusKey the focus engine already holds. There is no second focus mechanism.
  • It is a dot path, <namespace>.<segment>....
    • The namespace matches [a-z][a-z0-9_-]*.
    • Each segment is a word, [a-z][a-z0-9_]*, or a decimal index.
    • Brackets are refused, because zsh globs them.
  • Ids are built only from &'static str names and indices. Labels and ratingKeys are never part of an id, and are never written to a log or a recording.
  • ui/src/a11y.rs holds the grammar, A11yPath, Role, A11y and default_walk, plus the test-only conformance, conform and Namespaces.
  • Focusable gains three methods with defaults: a11y, a11y_elems and a11y_find. Screen gains a11y_ns. The composed_* helpers and both focusable_via_* macros delegate all three.

Shared widgets answer once

Screens inherit their ids from the shared widgets rather than writing their own:

  • Cards. cards::Stack, shelf and grid project <section>.card.<i> through cards::card_a11y.
    • <i> is the card's place in the whole listing (CardSource::global), not its place in the loaded window.
    • cards::card_window_index maps an id back to the window, and refuses one that is outside it.
    • A card's ratingKey is its subject, and is never part of the id.
  • Form rows. geom::table_row, table_elems, table_a11y and table_a11y_find are the one row-id convention, used by TableScreen, FormTable, TablePart, the geom Table, Alternate Sources and the versions panel.
    • A row named with FormId::a11y uses that name.
    • Any other row is row.<n>, where n counts only rows that can take focus.
  • Decision alerts. decision_alert::AlertAnswers names each answer, including Answers::One. It is used by the plaintext-connection question, Home, Library, Login, the player's repair alert, consent, the HUD settings and the picker.
  • Popovers. page_stack::popover_a11y / popover_a11y_elems serve the More menu, the track menu and the Library menu.
  • Elsewhere. The page header answers its own ids, and the nav strip answers nav.home, nav.watchlist, and so on.

Screens answer only for their own hand-written groups: Home, Detail, Library, Recommended, Watchlist, Catalog, the item menu, Filmography, the settings family, the player and HUD, the panels, Login, Profiles and Onboard.

Coverage

screens/src/registry.rs gains a test-only coverage table (a11y_coverage_tests). It is an exhaustive match over every AppArg, ContentArg and SettingsPage arm, so a new screen does not compile until it is listed.

  • Each arm mounts the real screen and runs the conformance check:
    • every listed element places and projects;
    • ids are unique;
    • a11y_find is the inverse of a11y;
    • a group with elements lists at least one.
  • Today every arm is Covered: 49 of 49, none Pending.
  • no_two_screens_answer_one_namespace checks that no two screens answer one namespace. One screen type mounted through two arms counts once.

Not in this PR

  • Off-window cards. A Library grid card, a Detail episode or a card in a paged window that is not currently loaded refuses its id as unknown. A follow-up will add a typed "reveal" event, so the screen can move its window and the harness can retry.

Gates

On the committed head, locally:

  • make test-crate C=plx_ui: test result: ok. 1690 passed; 0 failed
  • make test-crate C=plx_appkit: test result: ok. 960 passed; 0 failed
  • plx_screens: test result: ok. 2235 passed; 0 failed; … 1 filtered out.
    • It ran as the test binary, skipping player::automatic_marker_tests::actual_visible_player_paint_reports_typed_watch_without_mutating_it.
    • That test segfaults on this Mac, on main too, and passes in CI.
  • a11y filter: a11y coverage: 49 covered, 0 pending of 49.
  • make check-nodef: green on the commit before the last one. The last commit only moves #[cfg(test)] code, which the shipping build never compiles. The local disk refused the re-run, so CI's builds are the evidence for the final head.
  • ci/check-deps.sh: green, with no ledger line added.
  • ci/check-module-layers.py: green.
  • ci/check-localization.py: green.

CI is the full gate. This PR changes no Makefile, Cargo manifest, workflow or crate layout, so there is no build-bench table.

🤖 Generated with Claude Code

GLinnik21 and others added 23 commits November 17, 2026 17:38
…erage table)

plx_ui::a11y holds the id grammar (`<ns>.<path>`, ns [a-z][a-z0-9_-]*, segments
[a-z][a-z0-9_]* or a decimal index), A11yPath (built from &'static str names and
indices, parsed from a test's text for comparison only), Role, A11y,
default_walk and the conformance suite (every element projects, ids unique per
view, a11y_find inverts a11y including off-screen elements, a11y_elems matches
GroupSpec.len).

Focusable gains the three defaulted hooks a11y, a11y_elems and a11y_find;
Screen gains a11y_ns (defaults to name()); composed_a11y* delegate through
layout() parts and both focusable_via_* macros forward the hooks (the view macro
hands back an owning projection, since its view is a temporary).

The screens crate gets the coverage table: an exhaustive match over every AppArg
arm (and ContentArg and SettingsPage), all Pending, so a new screen fails to
compile until it is tabled. No behaviour change: nothing produces or reads ids
at run time yet.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e Watchlist options menu

catalog.primary (the pill, subject = the record's hex), itemmenu.<row> named by ItemRow
(itemmenu.version.<n> on the Play Version page), watchlist_menu.<row> named by OptionsRow.
Each view runs a11y::conformance in its host tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t the player, collection and person pages

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ing deck and the linked headings

hero.play|info|watchlist, shelf.<row>.card.<col>, continue.card.<col>, shelf.<row>.heading and the
plaintext question's alert.cancel|connect; a card's subject is its ratingKey. By::Script is a
deliberate arrival like Dir at the strip-chosen and hero-rotation sites.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every FormId of the Settings family (root, language, diagnostics, under
posters and its details picker, playback and audio fields, legal index,
privacy rows, account menu) answers a static a11y name per variant. A
variant that repeats in one form (a server's plaintext switch, a language
choice) answers None: its position names it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ty ids

tracks answers body; Also available and Play Version answer row.<n>, the
position among the focusable rows (what GroupSpec::len counts).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Login answers control, details and the alert's answers (alert.cancel,
alert.send) for the group it declares now. Profiles answers the roster
under roster.<the shared shelf's id> (labelled with the profile's name),
sign_out and back for the footer and the read-out, and the PIN pad as
pad.digit.<n> / pad.delete; the pad group's len now counts its eleven
keys, not its twelve cells, because the hole is no element. Onboard
forwards the three hooks through its view to the shared table screen, and
all three mountings keep the one namespace `onboard`.

Each screen's hand-written groups run a11y::conformance in host tests.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…eir own id namespace; By::Script at the Detail and Library arrival sites

filmography.tab.<i> and filmography.row.<i> (a held copy's ratingKey is a row's subject), a11y_ns
overrides for Filmography and Recommended (their name() words are shared), and By::Script treated as a
deliberate Dir arrival in detail/mod.rs, library/mod.rs and library/recommended.rs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
RouteSurface forwards to the top page and answers the top page's namespace;
RootPage, the Playback picker, the HUD page and the consent view answer
their alert's two answers alone while it is open (AlertAnswers, written once
in plaintext_question beside PlaintextAlert's own hooks); the HUD preview
answers back and scene.<i>; the account menu answers one row per action.
DocumentPage and PreviewPage answer namespaces of their own so no two
screen types of the family share one. A script's arrival on a HUD row is as
deliberate as a key's.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Surface-level conformance and namespace uniqueness over every page the
Settings surface mounts; the preview's back and scene.<i> controls; the
delete alert's alert.cancel / alert.delete answers alone; the account menu's
rows; AlertAnswers; every FormId's names valid and distinct; a script's
arrival ends the HUD page's provisional focus as a key does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The player names its elements from the HUD's own groups and slots: scrub,
control.<word|i>, tab.info|chapters, section.<i>, chapter.<i>,
failure.<action>, repair.cancel|confirm. The overlay forwards the active panel's
part. about and bio declare no group and conform vacuously.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The HUD census runs a11y::conformance for every occupant (discs, Skip, Up Next,
read-out, chapters). Collection, Person and Search run it over their card-harness
mounts: their ids are the stack's own, and these tests are what holds them to it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
SectionSpec takes an optional static name (named / named_at), defaulting to
section.<i>. The card stack projects <section>.card.<j> for the cards of a
Shelf or Grid and <section>.<leaf|n> for the focusable elements of a Custom or
Overlay section (StackPage::plain_name names a leaf), with an indexed
a11y_find and a11y_elems; CardSource::subject (defaulted) carries the card's
ratingKey. PageWithStrip names the strip pills (nav.home|movies|shows|search|
profile|watchlist, nav.tab.<n>), qualifies the page's relative ids with the
page's a11y_ns and routes a11y_find by namespace. The More and Track menus
name their rows by identity, through shared popover_a11y helpers. By::Script is
a deliberate arrival at the card sites that treat By::Dir as one.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…rms and the page header

Shelf (card.<i>), Table (row.<i>), TabRow (tab.<i>), Grid (shelf.<r>.card.<c>) and Document
(document) project, enumerate and find their elements; indexed widgets answer a11y_find by the
index they parse. TablePart (plain and form-backed), BandPart (band.<i>), DocumentFocus,
DocumentPart and the composed TableScreen/DocumentScreen follow; a form-backed group's len now
counts its keyed rows only (a separator or note has no key, so no element).

FormId gains a11y() -> Option<&'static str> (default None = row.<index>), carried beside the
binding through Form::map and exposed by RowKeys::a11y_name. HeaderItem gains an optional a11y
name (the sort control is 'sort'); HeaderRow projects its stops under header.*. MasterDetail
delegates the three hooks to its parts; LinkedHeading::a11y gives the shared button projection.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The writers matched By::Script, which only exists once the write side
(plx_machine::machine::By) lands. The ids layer keeps the pre-Script arms; the
runtime layer reverts this commit after merging the write side.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The test named FilmographyHost, screen and cx, which live in mod tests, from the preview-gap module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 and others added 6 commits November 17, 2026 19:17
…every element places"

GroupSpec.len feeds focus seating, so it must not move for the ids' sake: a form-backed
table's len is n_rows again (a separator or a note counts) and the PIN pad's len is its twelve
cells again (the blank cell counts). The ids' conformance rule adapts instead:
a11y_elems lists AT MOST len elements, every listed element places
(place(.., SpringTarget) is Some) and projects, and the ids are unique.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The header's sort pill is header.sort, the unreachable read-out's Try again
status.retry, each title grid.card.<i> with its matched copy's ratingKey as
the subject. A conformance test mounts the page and resolves an off-screen
card by id.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
hero.<word> (one static word per HeroCtl), season.<i>, episodes.still|text.<i>,
<shelf>.card.<i> for Related, the collection, Extras and Cast with the
ratingKey as the subject (CardSource::subject on the page's Cards),
collection.heading and about.card|languages. A conformance test mounts a full
show page and resolves an off-screen card by id.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… Collection, Person and Search

Home answers the plaintext question's three id hooks with PlaintextAlert's own, so the alert reads
alert.not_now / alert.connect wherever it opens and Home's hand-written alert.cancel arm is gone.

Collection (head, items, status), Person (head, filmography, state, gap, shelf.<kind>) and Search
(field, recents, clear, and a result row named by its kind: movies, shows, episodes, people,
collections) name every section instead of taking section.<position>, which moves when a section
comes or goes. Their catalog card sources answer CardSource::subject with the item's ratingKey.
a11y::listing returns a view's whole projected id set for a test that asserts the names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
header.<name> (sort, collections, recommended, libraries, crumb; a library's
own name by position), grid.card.<i> with the ratingKey as the subject
(GridSrc::subject), rail.<i> while focus is in the grid or the rail,
status.retry, and the plaintext question's alert.<verb> answers delegated to
PlaintextAlert. A conformance test mounts the All grid.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…sting

The head is focusable when the summary truncates, so asserting the full listing equals the eight
member ids would depend on the fixture's summary; filter by role as the Person and Search tests do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 and others added 19 commits November 17, 2026 19:27
header.crumb, shelf.<row>.card.<col> with the ratingKey as the subject
(HubSrc::subject) and shelf.<row>.heading for a promoted collection. A
conformance test mounts the hub shelves.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
CI fixes
- ui cards: the Multi stack fixture keeps UNDER_LABEL_AIR under every shelf
  that has another below it (the invariant stays; the fixture honoured it
  only for the first shelf).
- ui geom: Table lists, finds and projects only the rows a key can land on
  (not separators or notes, which row_frame never places), as the form-backed
  TablePart already did; table_a11y returns None for them.
- ui dispatch: the owner-view fixture page places its cards.
- player: a disc the row cannot use (Previous/Next on a film or an end of
  the queue) and a tab the layout does not draw are cells GroupSpec.len
  counts, not elements: they are not listed, found or projected, so every
  listed element places. The HUD test now says so and a second one covers
  the live button of a pair.

Conformance
- a group that counts cells (len > 0) must list at least one element, so a
  view that answers no hook no longer passes vacuously (fault fixture and
  test added); prose that said "exactly len" now says "at most".

One card projection
- cards::card_a11y(path, src, i) builds the Role::Card projection (loaded,
  label, subject) once; CardSource gains a11y_title / a11y_loaded hooks
  (defaults: the focused label's title, `loaded`). cards::Stack, Detail's
  Cards, Library's GridPart, Recommended and Home use it with their ids
  unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ut first

Both conformance calls ran over a screen that had not been laid out, so
"every listed element places" failed on elements that do place in the app:
the Detail season tabs have a rect once the strip is measured
(season_metrics.update, which a landing does) and the Watchlist options menu
has its rows once Mount has opened it. The tests now do that; the screens are
unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ce uniqueness, pins control.previous

Coverage::Covered(name, fn) mounts the arm's screen and runs plx_ui::a11y::conformance over it,
answering the namespace of every mounting. 48 of the 49 leaf arms are covered: each fn is the
screen's own test body exposed as a cfg(test) pub(crate) fn that the existing test also calls.
LibraryMenu stays Pending (it answers none of the three hooks; that needs product code).
no_two_screens_answer_one_namespace collects every covered mounting's a11y_ns and allow-lists the
four cases where one screen type is mounted through two arms.
a_middle_episode_names_both_previous_and_next pins control.previous and control.next on the
player HUD when both neighbours are live.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…alert names the plaintext question's own

AlertAnswers moves from screens/plaintext_question.rs into plx_ui beside DecisionAlert and gains
one-answer support (Answers::One) and a renamable prefix. Login projects the answers of the sheet that
is up: while the plaintext question is open they are alert.not_now / alert.connect (through
PlaintextQuestion::answer_ids, shared with PlaintextAlert), because Connect there allows an insecure
server and is persisted, and alert.cancel / alert.send stay the report question's and the Details
card's. The player's repair confirmation answers through the same projection (repair.cancel /
repair.confirm), and the hand-written arms it replaces are gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…u answers the ids

popover_a11y / popover_a11y_elems move from appkit/more_menu.rs beside popover_group_of in
plx_ui::page_stack and take the popover's form, so a menu that is itself a screen can use them.
LibraryMenu answers a11y and a11y_elems through them: its rows' identities carry a server's text, so a
row is its word (recheck, favourites, unwatched, genre) or <list>.<n> by place (library, sort, type,
genre; genre.all). The coverage table's last Pending arm is Covered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An unnamed row is row.<n>, n its ordinal among the table's element rows (a separator or note never
leaves a gap), implemented once in geom (table_a11y, table_elems, table_a11y_find) and used by the geom
Table, TablePart, the Source and Version pickers' panels (which had their own copy over a FormTable) and
the item menu, whose row_label re-derived the now-public table_row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cards::card_a11y takes the section and projects card.<CardSource::global(i)>; card_window_index maps a
listing position back to the window index and refuses one the window does not hold. Stack (Search,
Collection, Person), Home, Recommended, Detail and the Library grid use them. The comments about a
By::Script variant that this branch does not have are back to main's wording.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…urce's global, row.<n> prose)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e coverage table in registry.rs

`ci/check-deps.sh`'s `sibling` rule failed since 2d8cdff: 25 screen files named
`crate::cards_conformance_tests::a11y_coverage_tests::{conform, Namespaces}` and the coverage
table named 22 screens' test functions, and a screen file may name only `crate::registry`.

`conform` and `Namespaces` use nothing a screen owns, so they move beside
`plx_ui::a11y::conformance` (`conform` runs it and reads and checks the namespace). Every
`<screen>_conforms` now names `plx_ui::a11y::`.

The table is the one place that names every screen's test function, which is `registry.rs`'s job
(the `sibling` gate exempts that file and no other), so it moves there as a `#[cfg(test)]` module
with its tests unchanged. No ledger line is added.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Main's #1434 added FormTable::page, which builds Self { .. } without the
names field this branch added to FormTable; it starts empty exactly as
FormTable::new does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Main's #1434 dropped the has_crumb argument (the document starts where the route title does).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…tion gate reads cards_harness.rs)

`detail_conforms` and `the_page_answers_its_ids_and_conforms` move from
detail/cards_harness.rs (a non-test file to ci/check-localization.py, so its fixture's
`Season {i}` / `Episode {i}` / `Extra {i}` / `Saga` titles read as product text) into
detail/tests.rs, where every other screen keeps its `*_conforms` fn. `detail::tests` becomes
`pub(crate)` (as hud_settings's does) so the registry's coverage table reaches it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comments and test docs only, plus one test rename (a_scripted_arrival_... ->
a_pointer_arrival_..., the loop it names drives By::{Dir, Pointer, Restore,
Reconcile}; there is no By::Script on this branch):

- player/overlay.rs: the overlay's namespace is the default Screen::a11y_ns,
  the active panel's OverlayKind::word() (menu, more, timing), not tracks.
- ui/geom.rs: the card menu does not answer row.<n> (it names rows
  itemmenu.<name>); table_a11y_find counts every element row for row.<n>;
  `indexed`'s doc no longer lists row.1 among the non-scanning ids.
- screens/registry.rs, alt_sources_tests.rs: nine <screen>_conforms functions
  have no caller outside the coverage table.
- settings_root_navigation_tests.rs, appkit/track_menu.rs: the conformance rule
  is "at most len, and some when len > 0", not "exactly len".
- home/ and library/cards_harness.rs: the last card-id segment is the card's
  global index (CardSource::global), not its column.
- ui/form.rs: playback.direct_play is a real row id; playback.audio_boost is not.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 marked this pull request as ready for review November 17, 2026 20:14
@GLinnik21
GLinnik21 merged commit 9de9836 into main Nov 17, 2026
16 checks passed
@GLinnik21
GLinnik21 deleted the a11y/ids branch November 17, 2026 20:28
GLinnik21 added a commit that referenced this pull request Nov 17, 2026
GLinnik21 added a commit that referenced this pull request Nov 17, 2026
GLinnik21 added a commit that referenced this pull request Nov 17, 2026
…creen back (#1432)

UI tests and agents can now focus or press an element by its accessibility id, and read back what is on screen, instead of walking to it with direction keys. This builds on the id projection from #1431.

- **`focus:<id>`, `press:<id>` and `press:<id>@<subject>`** are remote FIFO tokens that enter as one typed input, `InputKind::ById`.
  - The dispatcher resolves the id at the input's ordered delivery position, after the owner guard.
  - `focus:` moves focus with a new `By::Script`. It counts as deliberate wherever a key move does, except at sites that react to pointer hover.
  - `press:` focuses the element, then delivers an ordinary OK press.
  - `@<subject>` refuses the press unless the element's ratingKey matches.
  - A refusal logs one line with the id and a reason word: Unknown, NoOwner, Unloaded or SubjectMismatch.
- **`state:<nonce>`** is devtriggers-only. A runner effect at the frame tail atomically writes `plxnative-a11y.json` to the runtime dir. It holds the focused id, the groups, and every element's id, role, rect, visibility, loaded flag, label and subject, tagged with the nonce. The token is not recorded.
- **Recording and replay.**
  - A by-id input is recorded once, through the input tap.
  - The replay resolution shape gains an `Id` row family, answered by `ReplayAuthority::resolve_id`.
  - The state fingerprint moves to 0x7f1d_280c_909c_8603, and 0xea74_3865_5115_46c5 joins the refused list.
  - Labels and subjects never reach a log line. A subject-guarded press records its subject text, as recordings already carry ratingKeys in request paths.
- **The fixture alphabet's id pattern is closed.** The first segment must be one of the app's namespaces, and at most six segments may follow. A test keeps the alphabet's namespaces and bound equal to the code's.
- **Fixtures.** The v13 anchor is re-recorded on the new shape. A new anchor, `13-by-id-filmography`, refuses and then resolves `focus:nav.watchlist` and presses a list row by id. Both replay SAME in Targets and Resolve.
- `tools/a11y.py` is the harness helper. `ci/ui_boundaries.py` also forbids the tap from declaring `resolve_id`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Nov 18, 2026
…r a hero press (#1442)

Device and simulator scripts now reach elements by accessibility id instead of walking to them with direction keys, check where focus landed before taking a shot, and cannot press a title without naming it. This is the harness half of the series, after the ids (#1431) and the `focus:`/`press:`/`state:` tokens (#1432).

- **`tools/tv-session.sh` gains `focus <id>`, `press <id> [--rk RK]` and `state [--out FILE]`**, all under the TV lock.
  - Ids and ratingKeys are checked locally before anything reaches ssh or the FIFO.
  - A press on an element that acts on a title needs `--rk`, and the app refuses the press if that title is not the element's.
  - `key` refuses by-id words, so the verbs are the only way to send one.
  - The FIFO write escapes `'` for the remote shell and refuses any whitespace inside a token, because the app splits on whitespace.
  - `state` sends a random nonce and polls `plxnative-a11y.json` until the nonce matches.
- **`tools/a11y.py` is the simulator helper.**
  - It provides `focus`, `press(subject=)` and `expect_focus`.
  - Its command line applies the same title guard, with `--subject`. The library `press()` is unguarded, for scripts that drive the mock.
- **Every element whose press acts on a title it names now carries that title's ratingKey as its `A11y` subject.** It is read the way the activation reads it, with no state and no IO.
  - This covers the Home hero, the item menu, the Detail hero (a started show names the episode the press acts on), the Play Version rows, the player HUD's queue and restart controls, the failure screen's retries, the More menu's quality rungs, and the track and subtitle rows that write to the server.
  - `SUBJECT_BEARING` is the one list. A test holds it equal to every file that builds a play, queue-step or write message.
- **Home's hero/grid door.** A by-id press queues its focus move and its OK in the same frame, so it used to act on the element focused before the move.
  - A scripted focus move now clears that remap.
  - While a key's move has left the picture behind the focus, any by-id press of the focused element is refused as `unloaded` until the picture catches up.
  - A key move followed by a quick OK keeps today's behaviour.
- **The carousel holds still under a hero press.** While a press is armed on a hero button, the countdown restarts and a Flip or edge key is refused, so the commit acts on the title the press was accepted against. This also fixes a person's OK just before a turn.
- **A by-id press resolves against the live focus, and every delivery reads the live press state.** A by-id press batched after a key sees the focus that key moved, and a screen's tick sees a press armed in the same frame.
- **The Watchlist captures drive by id only.** Focus is checked through `state` before each shot, and any `a11y: refused` line fails the capture. `tests/player_shots.sh` presses the HUD by id.
- **The docs carry two rules:** prefer ids, walking only where focus travel is the subject; and the subject rule, pointing to `SUBJECT_BEARING`. They are in the `tv-session` and `ui-sim` skills, `docs/agent-reference.md`, `tests/README.md` and `rust-modules/ui/src/CLAUDE.md`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant