Skip to content

HUD plugins: focus travel follows the drawn order - #1197

Merged
GLinnik21 merged 7 commits into
mainfrom
hud/pr18-travel
Nov 1, 2026
Merged

GLinnik21 merged 7 commits into
mainfrom
hud/pr18-travel

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

HUD plugins PR18: focus travel follows the drawn order

No issue tracks the HUD-plugin work; none was opened for this PR.

Found on the television with the reference package. PlayerScreen::links was classic's fixed order (bar Up to row, bar Down to tabs, row Down to bar, tabs Up to bar) and answer_edge hid the transport on Up off the row. The reference draws its row below the bar and has no tab pills, so Down from the bar went nowhere, Up reached a row that sits below it, a second Up dismissed even a paused transport, with Chapters and Info both open Down from the row entered only the latest section and every section's Up went to the row (the bar and the other section were out of reach), and Up from an open section landed on Play rather than the control that opened it.

What changes

  • appkit::player_hud::travel::order (new): one pure function from the compiled state (the open set, the row's occupant, the content) to the groups that have a stop, ordered top to bottom by the rects the layout reports (the bar's track, the row, the tab pills, the open strip, the open section's buttons). A fixed array, no heap, no package key. Order::links links each group to its neighbours both ways; top() and bottom() are the edge answers.
  • PlayerScreen::links takes it, except a MODAL package's open section, which keeps its single GROUP_TABS Up link. answer_edge: Up off the topmost group is the hide it was (swallowed while a section is open); Down off the bottom group stays put and re-arms the linger. The row's Down edge is now EdgeRule::Screen for that (a declared link still wins, so classic's row is unchanged).
  • seat for the row and tab groups lands on the control that opened the open section focus is leaving (opener_elem, the lookup BACK uses), disc or pill; else the usual landing.
  • docs/hud-plugins.md: D6's "focus travels freely" says how, and the package-authoring text states the rule.

Classic comes out as exactly today's row, bar, tabs. No classic test changed.

Reference tests that changed (inverted keys -> the real keys)

  • go_to_item (and so every reference test that walks by it): UU -> UD (Up raises it onto the bar, Down enters the row below).
  • up_off_the_row_under_an_open_inline_page_arms_no_hidden_dismissal -> up_off_the_bar_under_an_open_inline_page_arms_no_hidden_dismissal: same meaning at the topmost group, which is now the bar.
  • Unchanged and still green with the new go_to_item: the_reference_opens_chapters_inline_and_travels_between_it_and_the_row, the_reference_stacks_info_over_chapters_and_back_unwinds_them_in_order, closing_all_sections_twice_in_one_frame_leaves_them_closed.

New tests

travel::tests (appkit, the pure order over classic, the reference with each section set, minimal, hero-center, tabs) and, in hud_pins_tests.rs on the reference: Down from the bar reaches the row and Down off the bottom stays; Up off the bar dismisses a paused transport; the bar is reachable with a section open; Up from the strip lands on the Chapters disc; both sections open walk bar, row, strip, Info both ways (Info with buttons); Up from Info's buttons lands on the Info disc; Up from the tabs fixture's strip lands on the Chapters pill; Up from a section no control opens lands on the row's usual place (a pin, green on the old code too).

Not decided here

  • The reference's own Info places no button, so it has no stop; the Info walk is tested on reference_with_info_actions_for_test (the reference with two buttons in its Info section).
  • The tabs fixture is an inline package whose pills share the row's band, so the bar, row, tabs order comes from a tie in the rects (the fixed order breaks it).

Review fix: a tab is a pill

The review found, and the television confirmed, that a click on the reference's Info disc left Up and Down dead: a disc that opens a section was registered as a row stop and as a hidden tab stop, and the hit map resolves the later one. HudGeometry::tabs now reports pills only, one predicate, so a click on a disc takes the row's arm and fires what OK on that disc fires, groups_in declares the tab group only when a pill is drawn, and travel::order reads geo.tabs again. No classic test moved.

On the television

Episode with chapters on the mock, paused, --guest, head 2e346e50b.

Reference: click on Info, Up reaches the bar with the card open, Down the row, Down stays. Down from the bar lands on the row's primary, Next on an episode, Play on a film. Click on Chapters with Info open: the strip opens on the current chapter, Up lands on the Chapters disc, Left walks the row. BACK closes the latest section onto its disc, the other stays; BACK again closes Info onto its disc.

Classic is unchanged: Up from the bar reaches the row; Down walks bar, then tabs, then stays; a click on a pill opens its section as OK does; Up off the row hides, paused too.

🤖 Generated with Claude Code

GLinnik21 and others added 7 commits November 1, 2026 17:58
…ompiled layout

player_hud::travel::order reads the groups that have a stop in a state (the
bar, the row, the tab pills, an open strip, an open section's buttons) and
orders them top to bottom by the rects the compiled layout reports. Each links
to its neighbours; the top group and the bottom group are the edge answers.
Nothing names a package. Nothing calls it yet; the screen takes it next.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
PlayerScreen::links and answer_edge read player_hud::travel::order instead of
classic's fixed row, bar, tabs. The reference draws its row below the bar and
has no tab pills, so Down from the bar went nowhere, Up reached a row that sat
below it, a second Up hid the transport even paused, and with Chapters and Info
both open Down off the row entered only the latest section and every section's
Up went to the row, so the bar and the other section were out of reach.

Now each group with a stop links to the one above and the one below it. Up off
the topmost group is what Up off the row was (hide; swallowed under an open
section); Down off the bottom one stays put and re-arms the linger. Up into the
row (or tabs) from an open section lands on the control that opened it, as BACK
does. Classic comes out as exactly today's order and no classic test changed; a
modal section keeps its own links.

The reference tests that walked by the inverted keys (go_to_item and what builds
on it) take the real ones; up_off_the_row_under_an_open_inline_page_arms_no_hidden_dismissal
is now up_off_the_bar_under_an_open_inline_page_arms_no_hidden_dismissal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…omments follow the order

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	rust-modules/appkit/src/player_hud/loaded.rs
…he disc

HudGeometry::tabs reported every toggle_section control, so the reference's Info and
Chapters discs were also registered as hidden tab stops at the discs' rects. The hit map
resolves the later stop, so a Magic Remote click on a disc was a press of a TAB: focus went
to the tab group, which the drawn order no longer links, and Up and Down after the click
did nothing.

CompiledState::tab now reports the pill only. Every reader of geo.tabs gets the one
predicate: the pointer's tab stops (place_in), the tab group (declared only when a pill is
drawn, len to the last tab), and travel::order, which reads geo.tabs again instead of
filtering pills itself. A click on a disc takes the row's arm of the click handler, so it
presses what OK presses; classic and the tabs fixture, whose openers are pills, click as
before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@GLinnik21
GLinnik21 marked this pull request as ready for review November 1, 2026 17:03
@GLinnik21
GLinnik21 merged commit 9d2cc29 into main Nov 1, 2026
20 checks passed
@GLinnik21
GLinnik21 deleted the hud/pr18-travel branch November 1, 2026 17:04
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