Skip to content

HUD: dismiss an offer through the metadata store's skipped set - #1187

Merged
GLinnik21 merged 9 commits into
plxnative:mainfrom
LovelessCodes:feat/skip-dismiss-via-metadata
Oct 31, 2026
Merged

GLinnik21 merged 9 commits into
plxnative:mainfrom
LovelessCodes:feat/skip-dismiss-via-metadata

Conversation

@LovelessCodes

Copy link
Copy Markdown
Contributor

Follow-up to #1161, which merged the earlier latch implementation. This is the review's requested design instead: the metadata store's skipped set is the only dismissal state, and #1161's HUD field, state-shape bump and re-recorded anchors are removed.

What

The control row stays exactly as it is: a Skip Intro / Skip Credits pill or an Up Next tile still takes the place of the Subtitles/Audio/More discs, with nothing added beside it. What changes is BACK: pressed over the offered row, it dismisses that segment's offer and puts the discs back, without hiding the transport or leaving the film.

  • BACK asks a typed PlayerReq::DismissOffer(marker). app::playback::player_requests runs MetadataCmd::MarkSkipped — the set MetadataState::skipped already owns, that a Skip press writes, and that the store clears per item. slot() therefore answers with the discs by itself; there is no HUD-side latch and no second source of truth for a decision the store already makes.
  • MetadataView::active_marker and synthesized_tail_marker now share one skipped filter. The synthesized tail was the one offer path that did not consult the set, so dismissing a silent credits tail would otherwise have brought it straight back.
  • The frame's slot is sampled before the dispatcher runs, so app::content::content_requests re-resolves fr.ctrl after a dismissal and parks the FocusEngine on the row's primary by element. A group-only re-seat restored the element the engine remembered from before the stand-in, leaving the ring and OK on different discs after Watch Credits. PlayerScreen::dismiss_offer uses the same row_primary() locally, so a page-only test sees the same cursor.
  • Dismissal is per marker segment, by construction: the store keys on (kind, start_ms) and clears the set per item, so dismissing Skip Intro does not suppress Up Next / Skip Credits later in the episode.
  • The ring stays on the control row. A second BACK is an ordinary transport-hide; BACK from the scrubber is unchanged.
  • There is no new control, no geometry change and no sixth focus stop. The player's logical state is back to main's shape, so SCREEN_SHAPES_PIN returns to 12149748892022442062 and the three replay anchors are restored to their recordings for that shape. skip_pill.rs now describes the BACK dismissal instead of the old "CC/Audio are unreachable" cost; docs/hud-plugins.md records the new BACK edge.

Verification

  • make test-crate C=plx_data — 1449 passed, 0 failed
  • make test-crate C=plx_screens — 1863 passed, 0 failed
  • make test-crate C=plx_appkit — 761 passed, 0 failed
  • make test-hostsim — 1252 passed; the only 3 failures are the existing permission/refusal session tests, which assert that chmod stops a write and therefore cannot fail-close under uid 0. All 3 pass when the same binaries run as an ordinary user.
  • python3 -m unittest tests.test_replay_fixtures — 13 tests OK; all three anchors again carry state_fp 12149748892022442062 and anchor: true, and the restored recordings replay SAME against that shape.
  • make lint clean; make check-nodef clean; ci/check-deps.sh all gates green.

On this host (uid 0) a full make check cannot be green: its plx_plex persistence suite asserts denied/unlinkable writes, and the four pre-existing plx_media::route::decision::prefs_* log tests fail outside it as well. plx_media and plx_plex are untouched by this diff; the suites above are the ones that exercise it.

The tests added here:

  • back_over_a_skip_or_up_next_offer_restores_the_discs_without_hiding_the_transport (both offer kinds ask DismissOffer(marker), the local row becomes the discs, ring on the row)
  • dismissing_an_offer_re_seats_the_engine_on_the_returning_discs_primary (page + FocusEngine agree on the new primary)
  • back_over_an_offer_swaps_in_the_discs_on_the_same_frame (app-side: the frame that took BACK draws the discs, the store holds the segment skipped, and the engine lands on the drawn primary before the next key)
  • a_dismissed_synthesized_tail_is_not_offered_again (the tail path honours skipped)
  • dismissing_one_marker_leaves_a_later_segment_on_offer (per-segment, not per-episode)
  • back_off_the_offer_row_still_hides_the_transport (BACK from the scrubber keeps its old meaning)

Not device-verified: the row is deliberately the same visual, so no new pixel layout needs a TV check; the BACK behaviour is covered by the host suite above. No writes to a real Plex account; no TV commands were run for this branch.

The HUD's own per-segment latch and the state-shape bump it forced were a
second source of truth for a decision MetadataState::skipped already owns:
active_marker reads it, a Skip press writes it, and the store clears it per
item. BACK now asks PlayerReq::DismissOffer, app::playback runs
MetadataCmd::MarkSkipped, and synthesized_tail_marker honours the same set —
so a silent credits tail cannot come back after its dismissal either.

The slot is sampled before the dispatcher runs, so content_requests
re-resolves fr.ctrl after a dismissal and re-seats the FocusEngine on the
row's primary by ELEMENT. A group-only re-seat restored the element the
engine remembered from before the stand-in, leaving the ring and OK on
different discs after Watch Credits.
@LovelessCodes
LovelessCodes force-pushed the feat/skip-dismiss-via-metadata branch from bab6ebb to f75294d Compare October 31, 2026 15:33
GLinnik21 and others added 8 commits November 1, 2026 01:34
…ve of Frame::ctrl

The dismissal holds for the rest of the item's playback, not until the playhead leaves the
segment. Frame::ctrl and the one-resolve comments name content_requests' re-resolve after a
dismissal, and the comments that defined the design by contrast now say what the code does.
The was_standin clear in dismiss_offer carries its reason.

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

The two skipped-set tests join marker_tests and use its server-shaped episode_markers(). The
step-ladder offer tests build their markers and offered page through one helper each. The lifecycle
test checks the row with Frame::begin(..).ctrl, after confirming the rig is still Playing.

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

The arm's guard already holds the ring on the control row and an offer in the slot, so dismiss_offer
takes the marker as an argument and moves the cursor to the returning primary unconditionally.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The page reads HudModel::controls, which the loop fills from the full session each frame, instead of
sampling Controls::now on the queue-less published session from inside a machine step.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The group delivery and the element delivery that followed it landed on the same control, since the
control row is Seat::First and seats on row_primary(). One delivery stays, matching the Tick arm's
pairing, and the comments that said a group re-seat restores a remembered element now say what the
seat policy does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
reseat_player_focus and reseat_player_focus_on_primary differed only in the FocusTarget they handed
the top page, so both now call one private helper that takes the target.

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

MarkSkipped emits no job, so Bridge::metadata_run is the same store step; it is the boundary every
other command the app runs on the metadata store crosses.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Restores the comment inside run() to its original four lines: c13a927
added a fifth, which put run() one line over the 200-line budget. Frame::ctrl's
doc comment already says content_requests re-resolves the row after a dismissal.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit 42077a1 into plxnative:main Oct 31, 2026
13 checks passed
@GLinnik21

Copy link
Copy Markdown
Collaborator

Thanks, merged in 42077a1. Moving the dismissal onto the skipped set was the right call.

I pushed a few small cleanups on top while landing it: shared test fixtures, one focus re-seat instead of two, a comment trim for the run() line budget. No behavior change.

GLinnik21 added a commit that referenced this pull request Nov 1, 2026
Two textual conflicts, both resolved by keeping both sides:
- ui/src/cards/mod.rs: the `card_row` re-export keeps this branch's `Rim` and main's `SortValue` and
  `SORT_VALUE_*` items.
- screens/src/player/mod.rs: `row_primary` keeps main's `pub` and its doc (the FocusEngine's re-seat
  lands on it) with this branch's body, which reads the discs through `eff_slot` and the open sections.

Main's BACK-dismisses-an-offer arm (#1161, #1187) sits below the section arm of the BACK ladder, so a BACK
over an open section closes the section and never retires the offer under it; a test pins that for the
modal and the inline policy. Dutch (#1160) is covered by the SHIPPED-driven tests and goldens.

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.

2 participants