Repository navigation
HUD PR3: command vocabulary, control identity, one performer, OK on the engine - #1150
Merged
Merged
Conversation
…he engine
HudCommand (player_hud/command.rs) is the vocabulary a HUD control performs, with
typed parameters and enabled predicates read off HudModel alone. A control's id is
ELEM_CONTROL_BASE + ordinal in an open-ended range (ELEM_ROW_BASE renamed and moved
to 0x1_0000, clear of the tabs, the failure read-out and the repair card; the
chapters' range is reserved at the top of u32 for PR8). Classic's five discs are
five controls with those commands, in today's order.
One performer, perform_hud_command, matches on every command; activate_player_row
resolves the cursor and calls it. toggle_play is one function the Play/Pause keys,
OK on the picture and the toggle_play command share; jump_by takes the signed step
and a keep-HUD flag, so a seek control press keeps the HUD up and a hidden-HUD tap
still hides it, both in one burst.
OK on the row goes through the focus engine: key_ok leaves a row element unhandled,
the engine dips the control and PressCommit asks for Command(..) or StandIn. The
app ladder's dead player OK arm is removed (a mounted player owns input, pinned).
Up Next's two keys are fixed ids and countdown_may_run takes focused == play_next.
OverlayKind::More { quality } becomes More { page } so the Speed page is
addressable; this moves SCREEN_SHAPES_PIN (previous 0x9425_f33f_3f53_6aa5) and the
replay fixtures need re-recording by the owner.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`OverlayKind::More { quality: bool }` became `More { page: Option<MorePage> }`, which moved
SCREEN_SHAPES_PIN (0x9425_f33f_3f53_6aa5 -> 0xb633_b65b_ed93_ca93) and the recorded state shape from
2452334830893428010 to 12149748892022442062, so the three anchors could not be loaded.
All three were recorded afresh against the synthetic server (tests/focusfp.sh --rec --only 1,6,12),
passed plxnative-rec check, and were installed with plxnative-rec rerecord, anchors retained.
make check-replay replays all three with verdict=SAME in Targets and Resolve, every difference
counter zero.
The closed alphabet gains the mock's two rating-image URIs (rottentomatoes://image.rating.ripe and
.upright): the Library poster ratings carry them into the recorded hubs result, and a fresh
recording was refused by plxnative-rec check without them. The SCREEN_SHAPES_PIN comment now says
the fixtures were re-recorded.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
handle_key takes the focused control's command from its caller, so a test can hand it a seek control (no slot holds one yet): two OK key-downs on it inside one burst give one accumulated target, and OK on another control restarts it. The app crate pins perform_hud_command's arms: Previous steps back and Next steps forward (a swap fails both ways), TogglePlay takes a pending scrub target as the play keys do, and Seek keeps the HUD up and accumulates inside one burst. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
marked this pull request as ready for review
October 29, 2026 23:41
GLinnik21
added a commit
that referenced
this pull request
Oct 30, 2026
Brings in PR3 (#1150: command vocabulary, control identity, the shared performer), which touched up_next.rs and player_hud/. No conflict. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
PR3 of the HUD-plugin plan: the command vocabulary, control identity, one shared performer, OK on the focus engine, and Up Next's fixed ids. No visual change: classic's frames, focus order and every key's effect are as before.
HudCommand(appkit/src/player_hud/command.rs): ten commands with typed parameters (toggle_play,seek,previous,next,open_tracks,open_more,toggle_section,from_beginning,go_to_detail,toggle_stats) and enabled predicates that readHudModelalone (Previous byprevious || restart, Next bynext,go_to_detailneeds a ratingKey,toggle_section chaptersneeds chapters,seekneeds a known duration). Classic's five discs are five controls with those commands, in today's order (CLASSIC_COMMANDS);Controls::command(i) == Controls::action(i).into()for every combination.ELEM_CONTROL_BASE + ordinal, an open-ended range at0x1_0000(renamed fromELEM_ROW_BASE 10) clear of tabs (20), the failure read-out (30..) and the repair card (40 000).ELEM_CHAPTER_BASE = 0xFFFF_0000is reserved for PR8.hud.nav.btnstays the ordinal,RowPopstays keyed by ordinal;control_elem(ordinal)is the id.perform_hud_command(src/app/playback.rs) matches on all ten commands.activate_player_rowis now a thin resolver over it (and overactivate_stand_in), and it is the function the More fold calls in PR9.PlayerScreen::toggle_play(play, now)is one function the Play/Pause/PlayPause keys, OK on the picture and the command share (the pending-targetSeekTopath included).PlayerScreen::jump_by(ps, step_ns, keep_hud, now)takes the signed step and a keep-HUD flag: a seek control press keeps the HUD up and extends its linger, the hidden-HUD tap still hides it, and both share one burst.key_okreturnsHandled::Nofor a control-row element, so the dispatcher dips the control andPlayerScreen::stephandlesPressCommitthroughrow_pressed, which asks forPlayerReq::Command(cmd)(a disc) orPlayerReq::StandIn(Skip, Up Next). The screen'skey_okno longer branches onGroupIdfor the row. The app ladder's player OK arm (app/input.rs::key_ok) is gone: a mounted player owns input, pinned bya_mounted_player_page_owns_input_so_the_ladder_never_sees_ok. The emptyKey::Okarm stays in the chain so OK keeps its place in front of the arms below.watch_credits/play_nextare the fixed control ids 0 and 1 (BTN_CREDITS/BTN_NEXTkept as those ordinals, documented), andcountdown_may_run(bare, row_focused, play_next_focused).open_more {page}:OverlayKind::More { quality: bool }becomesMore { page: Option<MorePage> }(Noneis the root);MoreMenuState::new_on(ps, page)opens on the Speed page when offered, and falls back to the root when not.Replay fixtures
More(quality:bool)becameMore(page:u8), which movedSCREEN_SHAPES_PIN(previous0x9425_f33f_3f53_6aa5). The three replay fixtures were re-recorded against it in98ac444a8(simulator stage);fixture_preflight_tests::committed_recordings_keep_valid_page_requests_and_initial_hashespasses again.Pins and tests I edited (each is a behaviour change, so each is listed)
screens/src/player/hud_pins_tests.rs: the hit census is renumbered mechanically (PROBESand the 63placestuples: elements10..15,19becomeCONTROL + 0..5,+9withCONTROL = 0x1_0000; the rects and expected hits are untouched), because the plan's PR3 line is "element ranges re-cut". The 30"ArmControlRow"request strings in the key tables become what the engine now commits:Command(Next),Command(Previous),Command(OpenTracks(Subtitles)),Command(OpenTracks(Audio)),Command(OpenMore(Root)),StandIn. Those are the only edits; each row's key sequence, cursor, tab, visibility and ordering fields are unchanged and still pass. (A pointer click still asksArmControlRow, as the census asserts.)screens/src/player/mod.rsstep-ladder tests:ok_on_the_control_row_arms_the_deferred_pressbecomesok_on_the_control_row_leaves_the_press_to_the_engine(Handled::No, nothing at key-down, thenPressCommityields the control'sCommand);a_segment_offer_arms_the_row_only_once_the_engine_is_re_seatedbecomesa_segment_offer_hands_ok_to_the_engine_only_once_it_is_re_seated(OK isHandled::Noafter the re-seat, where it wasArmControlRow).every_control_the_dpad_reaches_is_clickable...and the click tests useELEM_CONTROL_BASE.appkit/src/up_next.rsinline tests: thecountdown_may_runcalls passb == BTN_NEXTfor the new third parameter (same assertions).screens/src/registry.rs:SCREEN_SHAPES_PINbump (above) andARG_SHAPE.screens/src/player/overlay_tests.rs,src/app/surface_navigation_tests.rs,src/dev/scenarios.rs:More { quality: false/true }becomesMore { page: None / Some(Quality) }, nothing else.a_skip_pill_that_retires_on_a_movie_sends_the_ring_to_the_scrubberandan_up_next_stand_in_that_leaves_an_episode_sends_the_ring_to_the_scrubber, pass unedited, and every app-sidenavwrite is still followed byreseat_player_focus.Decisions
hud.nav.btnstays ani32ordinal and the id is derived (control_elem), so the pins that assign and comparenav.btn == BTN_*stay unedited.Action/Controls::actionare kept (the pins name them);HudCommandis what the performer matches on, withimpl From<Action> for HudCommandand a test over everyControlscombination that the two agree.Activate::Directstays for the scrubber, the tabs and the pointer click on a row. The scrubber's OK means the toggle or a pending target, and a click needs itsx, which a bareScreenEvent::Activatecannot carry. A tab opens its panel at once with no dip to wait for. The row's pointer click staysArmControlRowbecause the hit census asserts[ArmControlRow]for a click; both routes converge onperform_hud_command. Residual: the pointer click on a row still takes the loop's commit-frame route, not the engine's.HudModelonly;HudModelgainscontrols,chaptersanddetail, sampled inapp/run.rs::hud_model.detailuses the allocation-freeinfo_panel::detail_rk, shared with the Info card'son_ok.continues_seek_burst). Classic has no seek control, so this is unit-tested only.PlayerScreenfield (it would move the shape pin a second time); no newMAX_*constant; noci/allowline.Tests
Red first (each shown failing against a deliberately broken implementation, then restored): a seek control press keeps the HUD up while a hidden-HUD tap hides it; two seek presses in one burst give one target;
toggle_playfrom the key and from the command share one path; OK on a control row is the engine's press (Handled::No, thenPressCommitgives the command); Up Next's two ids press asStandInand seat the cursor;continues_seek_burst. Also: a table test over every classic control (command.rs) and in the app crate (hostsim) overperform_hud_command(Previous/Next leave the HUD and open no panel, Subtitles opensTracks { tab: 1 }, AudioTracks { tab: 0 }, More the root,open_moreSpeed the Speed page,toggle_sectionopens then closes), an overlay test that More mounts on the Speed page, an appkit test fornew_on, and the mounted-player-owns-input test.Gates
Run on the committed tree, head
c8c0e00db(git status --shortempty before and after; includes the merge oforigin/mainatc0b61dff8, #1148). CI is the full gate;make check,check-nodef,check-replay, clippy, rustfmt and the ARM build were not run here.make test-crate C='plx_appkit plx_screens':(plus three single-test binaries:
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1768 filtered out; finished in 0.00s)make test-crate C=plxnative-modules:make test-hostsim:Not verified here: anything on the television or in the simulator (the OK dip's look and timing against
main, Skip/Up Next presses, the Speed page).No issue tracks the HUD-plugin work; none was opened for this PR.
Review
Round 1 verdict MERGE with three minors; round 2 listed the two still open.
handle_keynow takes the focused control's command from its caller (steppassesfocused_command(focused)), so a test can hand it a seek control, since no slot holds one yet.two_ok_presses_on_a_seek_control_inside_one_burst_give_one_targetdrives two OK key-downs, each followed by the performer'sjump_by, and gets one accumulated target; an OK on another control restarts it. Red first: with thecontinues_seek_burstguard made to always reset, the second target is 50 s instead of 60 s. ThePressCommitleg is not driven in that test, because classic'sPressCommitcan only ask for a classic command; the performer'sjump_byis called directly whereCommand(Seek)would lead.previous_steps_the_queue_back_and_next_steps_it_forward: swappingQueueStep::PreviousandNextfails.the_toggle_play_command_takes_a_pending_scrub_target_as_the_play_keys_do: replacing theSeekToarm withapply_transport(pa, None, ..)fails.a_seek_command_keeps_the_hud_up_and_accumulates_inside_one_burst:jump_by(.., false, ..)fails (the transport is dismissed).SCREEN_SHAPES_PINcomment: already done by the simulator stage in98ac444a8.No finding was judged wrong; none left open.
🤖 Generated with Claude Code