Skip to content

Player sub-menus 4/5: animated panel resize and page slide (Tracks, More) - #347

Merged
GLinnik21 merged 12 commits into
mainfrom
feat/player-submenus-4-animation
Oct 1, 2026
Merged

GLinnik21 merged 12 commits into
mainfrom
feat/player-submenus-4-animation

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Part 4 of 5 of the player drill-in sub-menus (follows #345 and #346; design in docs/player-submenus.md).

What changed

  • ui/panel_motion.rs (new): one spring drives the popover card's rect; the top and left edges move and the bottom-right corner stays anchored. Page content slides with a staggered fade. The leaving page fades out over 0.14 s while moving 22% of the card width toward the exit side. The arriving page starts only after every leaving layer is at or below alpha 0.1, then fades in over 0.22 s from the entry side. So two pages are never legible at once, only the arriving page draws a focus pill, and layers below 1% alpha are not drawn (less overdraw on Mali).
  • Interruptions are continuous. Push → pop reverses from the current alpha and offset. A push during a push hands the arriving layer over to leaving without a step.
  • The pointer is held while a page slides. Hover and clicks are swallowed, never counted as a miss, so they never dismiss. Only the active page registers stops.
  • Layout is cached by layout_rev, with a globally unique next_rev(). Content is clipped through the nested ClipScope, inset 10 px while moving. There is no backdrop capture.
  • Tracks: page push/pop and the Audio↔Subtitles tab switch animate the card. More: the card springs when its row set changes.
  • Device frame-time scene track-menu-submenu-osc: the plxnative-submenuosc=<ms> trigger walks Style → Size → back → Other languages → back → Audio tab → back through the real key handlers. worst_ceiling_ms 25 is a budget, not a measured baseline. tools/tv-session.sh up --arm NAME[=VAL] arms boot triggers. The account-free recipe (mock PMS plus --guest --mock) is in the doc.

Tests

New motion tests:

  • a_push_is_animating_then_asks_for_no_more_frames_at_rest
  • an_interrupted_push_then_pop_reverses_and_settles_at_the_root_rect
  • rapid_pushes_and_pops_leave_one_slide_and_land_on_the_logical_page
  • a_push_during_a_push_steps_no_layer
  • the_two_pages_are_never_both_above_the_gate_and_only_one_draws_a_pill
  • a_tab_switch_animates_the_height
  • the_layout_is_cached_until_the_table_changes
  • More resize
  • pointer hold
  • oscillator script

Gates on the committed tree:

  • cargo test --lib at 5a5cc98f0: test result: ok. 5379 passed; 0 failed; 7 ignored
  • --no-default-features check: clean
  • make check: rc 0 (5379 / 5456 / 102 passed, 0 failed)
  • ARM make: rc 0

A simulator run of the oscillator with no captures (about 60 s, 80 steps) had no hangs. The worst frame was steady at the simulator's vsync, with one GL-swap outlier.

Frame stalls on the TV (added after the first device run)

  • Starfish feed pacing: the throttle runs its reference on from the last 5 Hz position report, capped at 250 ms (FeedPace). Each lane gets at most a 3 ms Feed() slice per tick. A lane below its prime depth or a 250 ms low-water lead is exempt, so start-up and seek are not stretched.
  • Sub-page and other-tab text:
    • It is recorded in update and rasterised only on presenting frames, in prepare_window.
    • The other tab's strings warm one per frame in their own background queue. That queue is speculative for replay, owned by a token, and bounded by cache occupancy.
  • Diagnostics: new spans (scen/pump/land, feed, sfv/sfa, ulatch/udim/tmnew). Spans from frames that are not presented are discarded.

TV, 60 Hz panel, guest + mock, screen on, muted, ~90 s legs:

  • Every leg held 59–61 fps.
  • Final osc leg at 5a5cc98f0: worst frame median 18.5 ms; 31 frames ≥20 ms.
  • Most of the remaining ≥20 ms frames are back-buffer waits in the first glClear. The no-menu control has them at the same rate. The menu-open frame (~27–34 ms) is left for a follow-up.
  • The prime completes within about 20 frames of Load, the same as before the slice.

🤖 Generated with Claude Code

GLinnik21 and others added 5 commits October 1, 2026 08:46
…ore)

ui::panel_motion::PanelMotion, owned by the Tracks and More popovers: the
natural layout is cached against TableView::layout_rev; springs move the
panel's top and left edges (bottom/right anchored); a push or pop slides the
outgoing and incoming table layers horizontally with alpha under one animated
clip, one panel background, no backdrop capture. An opposite-direction
interrupt mirrors progress and velocity, so push -> pop reverses smoothly.
Audio <-> Subtitles resizes the card; More resizes when its row set changes.
Only the live page registers focus stops, at the animated position; a settled
panel asks for no frames.

Screen::pointer_held lets a surface hold the pointer: the dispatcher records
but never resolves it while a page slides, so it is neither a hit nor a miss
(OnMiss::Dismiss never fires).

Device scene: plxnative-submenuosc=<period_ms> loops real keys through Style,
the Size picker, Other languages and the Audio tab; manifest scene
track-menu-submenu-osc (worst_ceiling_ms 25, not yet measured on the TV);
tv-session.sh up --arm NAME[=VAL] arms a scene's extra boot triggers;
docs/player-submenus.md gains the account-free device frame-time sequence.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The feed-ahead throttle measured against SHARED.pres_fed, which moves in
~200 ms steps. The lane stayed shut for eleven frames and then opened by
200 ms of media at once, so every 12th frame fed ~5 video and ~7 audio AUs
through a blocking Feed(): 4-15 ms of `results=` on the player route
(FRAMEDROP spans `feed:14.4`). FeedPace runs the reference on at 1x from
the last report, capped at 250 ms, so the same AUs land one or two per
frame (~0.4 ms) and the buffer depth bound is unchanged.

The results phase now carries scen/pump/land spans, the player clear a
`clear` span, and each Feed() call sfv/sfa spans, so a slow frame names
which of them held it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On the player route the draw's first framebuffer command waits ~15 ms for
a free back buffer, and a freshly pushed sub-page met its strings cold in
the draw after that wait: `clear:12.8 ... textx8:7.4`, a 26.7 ms frame on
the TV on the first visit to each page. PanelMotion::prewarm_text walks
the live table through the recorder (the same speculative, clear-free walk
ui::dispatch uses) once per table layout and rasterises up to eight of its
strings in update. The budget is counted, not timed: the UI reads no wall
clock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ce and doc fixes

The prewarm's budgeted drain uploaded GL textures from `update`, on frames that may not
present or that run while the window is backgrounded, against spec §10. `update` now only
records (clearing the queue first, so a held modal's strings cannot eat the budget) and
`prepare_window` drains it inside its `fr.present` block, before the draw's glClear.

Spans recorded on a frame that does not present are now discarded instead of printing on
the next presented frame's FRAMEDROP line.

FeedPace: a clock behind the report stamp is no run-on (saturating_sub), feed_stream reads
the clock fresh per AU instead of once before a loop of blocking Feed() calls, and a seek
resets the pace. Doc corrections for the cap, 1x, the results-phase steps, the span scope
and the text queue's drain location.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The drain moved to the presenting side of the present decision, so the bridge test
drivers (which stand in for a presented frame) now drain after each frame; without it a
held surface waited forever on the queue the Tracks menu's update left.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 and others added 7 commits October 1, 2026 15:45
Feed() blocks the frame thread, 0.3-0.7 ms per AU on the TV. The throttle
is off while priming and a post-prime lane is a full lead behind, so the
first frames of every playback (and every seek's re-prime) fed the whole
demuxed backlog at once: FRAMEDROP total=89.1 with sfvx62:19.4 and
sfax120:50.8, then sfax53:38.3 the frame after, with the HUD and the track
menu on screen. The greedy video lane also fed 2.5 s before audio got a
turn, so the prime fell through to the video-only escape
(primed: v=2541ms a=0ms).

Each lane now stops once it has spent FEED_LANE_SLICE_US in a tick, after
feeding at least one AU; the AU stays pending exactly as on a throttle
stop. Steady-state feeding (one or two AUs a frame) never reaches it.
A host test with a 1 ms-per-read feed clock pins the per-lane bound and
that the prime still completes on both lanes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first switch from Subtitles to Audio drew the Audio root's strings cold
on the TV: textx8:9.5 inside a 24.8-29.0 ms frame. The live page's prewarm
cannot cover a tab switch, because the key rebuilds the table after that
frame's update.

Once per menu, on a frame with no page slide, no resize and an empty prewarm
queue, update now builds the other tab's root form into a scratch table and
records its strings (PanelMotion::prewarm_more_text, which extends the queue
rather than replacing it). The presenting side's drain uploads them as it
does the live page's. The Subtitles root's pure build (sub_root_form), the
Audio root against an explicit enhancement answer (audio_form_for) and the
panel's natural rect (table_natural) are split out so the scratch build
shares them with the live one.

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

The track menu's open frame is 27-28 ms on the TV (navcommit 6-7 ms,
scrims 5-7 ms, text 3 ms) and the existing spans cannot say which part of
navcommit or scrims it is. tmnew covers TrackMenuState::new, ulatch the
underlay field's sync and udim each dim's paint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The other-tab warm from 83e4a16 was drained like a live page, eight
strings a frame, and on the TV that put the whole Audio root into the frame
after the menu opened: warmdrain:11.4 in a 21.3 ms frame (textx8:9.4 in a
22.1 ms one in the osc leg). Nothing waits on those strings, so a queue
filled by PanelMotion::prewarm_background_text now drains at
BACKGROUND_STRINGS (one, ~1 ms on the TV) per presented frame; a live walk
or an empty queue restores the eight-string budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The track menu warms its inactive tab one string a frame through the text
prewarm queue, but that queue belongs to the live page: `ui::dispatch` empties
it every frame with no page warm, and a live walk replaces it. On the TV the
warm was therefore one string deep, and the first switch to Audio still
rasterised `textx9:8.0` / `textx7:6.6` cold (23-25 ms frames).

Background strings now park in their own queue in `text`. It is invisible to
`prewarm_pending` (no held surface waits on it), untouched by live walks and by
the draw's clear, and drained one string a frame only when nothing live is
queued. Closing the menu drops it.

The host tests now model the draw's per-frame clear; the idle-warm test fails
without this change ("met these Subtitles labels cold: [Other languages]").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed slice low-water exemption, drain occupancy bound, measured-build wording

The other tab's warm now records inside rec::speculative (spec 5). The
background prewarm queue has an owner token so a closing menu's drop cannot
clear a newer menu's queue, and its drain honours TCACHE - PREWARM_HEADROOM.
A feed lane below low-water (priming, or under 250 ms of lead) is exempt from
the per-tick slice, so a slow Feed() neither stretches time-to-first-frame nor
drains the lead. The doc and manifest say which commits the 2026-10-01 grades
were taken on.

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