Repository navigation
player: chapters follow the played leaf, and the rail shows them - #7
Merged
Merged
Conversation
Two gaps that share a cause and a fix.
The Chapters tab never appeared for an episode started from a show detail
page. `chapters_panel` read `metadata::current()`, which on that path is the
SHOW — `play_episode_at` says so in a comment — and a show container carries
no `Chapter[]`, so `has_chapters()` was false. The same aliasing meant a
`current()` holding some other leaf would have seeked with ITS offsets.
Chapters now ride `PlayingItem` beside `markers`, for the identity reason
that store already exists, read through one `metadata::playing_chapters()`.
No new PMS request, and this is the part worth checking rather than
believing: `Client::metadata` already sends `includeChapters=1`, so on the
show-page path `fetch_playing_item` was making that exact GET for markers and
streams and throwing the `Chapter[]` in the same response away. The
detail-page path clones the loaded `Detail`, as before. Verified on device —
`playing item: rk=1886 audio=1 subs=38 markers=2 chapters=39`, one metadata
GET, played from the show page.
Putting chapters in that store made a latent staleness user-reachable, so
`request_play` now retires it beside `UP_NEXT`, for the reason already
written there: until the resolve lands (0.5-3 s, all of it with the HUD up)
the store is the PREVIOUS leaf's. Markers were masked from this by
`active_marker`'s `is_playing` gate; a Chapters tab has no such gate, and its
OK would have seeked the NEW episode to another item's offset. The caption
cannot move with it — `play_episode_at` sets `NowPlaying` just before
requesting the play — hence a `PLAYING`-only retirement.
The rail then draws what it now knows:
* intro/credits bands from the same markers the Skip control reads, UNDER
the fill so a segment already watched reads as watched. A `final` credits
marker's stated end is the container duration, which overshoots the
decoder's, so the band is clamped to the rail.
* chapter ticks OVER both, coloured by which side of the playhead they fall
on. One colour cannot serve both: white vanishes into the fill and dark
vanishes into the track.
Both are small opaque quads and the tick count is bounded by a minimum gap
rather than by the item's chapter count — that ceiling is a draw-call bound,
not a fill one, and it doubles as the reason a cluster of short chapters
cannot smear into a bar. The 0:00 chapter and anything within 8px of a cap
are dropped; they are the rail's ends, not boundaries on it. The coalesce
compares DISTANCE, because PMS does not sort these sibling arrays by offset
(its `Marker[]` comes back credits-before-intro) and a signed compare would
drop everything after the first backward step.
Device: 7/7 FPS scenes pass, player tier included — track-menu, whose item
draws 33 ticks, holds 54fps against a 45 floor; the show-page episode boot
runs 60fps median with 35 ticks and both bands up. Ticks land within a pixel
of where the pure geometry says (157/198/252/282/317), and each band measures
~2.4x the plain track's ink. Both `morning_show_skip_intro` cases pass.
Tests: +2 host (60)
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_018GuSHrq9oydnX7nhKE1Hvc
GLinnik21
added a commit
that referenced
this pull request
Aug 3, 2026
The demuxer chose the default audio with av_find_best_stream, which picks the "highest quality" track — on Home Alone (8 audio tracks, no default disposition) it picked the DTS track (a=#7). But the Load payload carries Media[0].audioCodec (ac3), so the pipeline was told AC3 while fed DTS: the audio ES never configures and, with audioSync, the video slaves to the dead audio clock and wedges (~32s of buffered video, then Feed() BufferFull forever, no window+PLAYING). Now the default audio feeds the first track whose codec MATCHES the payload (audio_stream_matching via avcodec_get_name), falling back to av_find_best_stream only if none matches. Verified on rk 3: feeds a=#1 (ac3), window+PLAYING, timeline climbs 72→142s. Caught by the new regression harness (home_alone_manyaudio). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018QbpQTKYjwp6fDNLdXzGzr
GLinnik21
added a commit
that referenced
this pull request
Aug 23, 2026
…it (#61) The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame". That reads as clearance and is the opposite: a smaller margin puts content NEARER the edge, so every screen in the app sat six pixels inside the exclusion zone. Nobody had ever measured one. The vertical half was worse, because it did not exist. There was no MARGIN_Y anywhere in the tree, so nothing bounded the top or bottom of anything, and four places were further out than the horizontal margin ever was: - the shared top tab bar + profile chip, 18px (the "main page" the item names) - the detail page's pinned compact title, 14px — and 32 for a square clearLogo, which spills upward as paint rather than as layout - the Library's A-Z rail, 32px, the worst in the app - the Home / Library / Person scroll reveals, which settled a focused card's caption 24 / 16 / 40px off the bottom edge Both margins are tokens now (96 / 54), and the requirement is a host test rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone` grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a later audit can move a token — or give one screen a correction of its own — without the test being rewritten to permit it. Deliberately no `assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix. "Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a focus glow and a shelf peeking off the bottom edge are all supposed to reach the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus pop magnifies ink already inside the frame and its caption does not scale — while the compact logo IS graded at its spill, because there the spill is the logo. The A-Z rail could not be fixed by moving the rail: with the grid filling `SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px control to its right, so the grid now reserves the band unconditionally (a reflow between two sections of one library is worse than a slightly narrower grid that never moves). One design cost, because it is a trade rather than a fix: dropping the top bar 18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts `GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its two constraints now instead of the "must not touch" rule alone, so the glass comes off a strip wider than ~672px rather than ~848. The product's strip is 572, so today's bar is unaffected and one more library still keeps it. If that is too tight the lever is the measured budget, not the frame. Checklist item #7 (idle / focused / selected distinguishable) was audited screen by screen at the same time and needed no change; the doc row says what was looked at instead of what was believed. Verified: `make check` 980 green, and the simulator at a real 1920x1080 — Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83 is the focused card's own drop shadow, the 1078 the scrolling shelf's peek). No television: this lane is host-only. Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 26, 2026
The demuxer chose the default audio with av_find_best_stream, which picks the "highest quality" track — on Home Alone (8 audio tracks, no default disposition) it picked the DTS track (a=#7). But the Load payload carries Media[0].audioCodec (ac3), so the pipeline was told AC3 while fed DTS: the audio ES never configures and, with audioSync, the video slaves to the dead audio clock and wedges (~32s of buffered video, then Feed() BufferFull forever, no window+PLAYING). Now the default audio feeds the first track whose codec MATCHES the payload (audio_stream_matching via avcodec_get_name), falling back to av_find_best_stream only if none matches. Verified on rk 3: feeds a=#1 (ac3), window+PLAYING, timeline climbs 72→142s. Caught by the new regression harness (home_alone_manyaudio). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018QbpQTKYjwp6fDNLdXzGzr
GLinnik21
added a commit
that referenced
this pull request
Aug 26, 2026
…it (#61) The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame". That reads as clearance and is the opposite: a smaller margin puts content NEARER the edge, so every screen in the app sat six pixels inside the exclusion zone. Nobody had ever measured one. The vertical half was worse, because it did not exist. There was no MARGIN_Y anywhere in the tree, so nothing bounded the top or bottom of anything, and four places were further out than the horizontal margin ever was: - the shared top tab bar + profile chip, 18px (the "main page" the item names) - the detail page's pinned compact title, 14px — and 32 for a square clearLogo, which spills upward as paint rather than as layout - the Library's A-Z rail, 32px, the worst in the app - the Home / Library / Person scroll reveals, which settled a focused card's caption 24 / 16 / 40px off the bottom edge Both margins are tokens now (96 / 54), and the requirement is a host test rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone` grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a later audit can move a token — or give one screen a correction of its own — without the test being rewritten to permit it. Deliberately no `assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix. "Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a focus glow and a shelf peeking off the bottom edge are all supposed to reach the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus pop magnifies ink already inside the frame and its caption does not scale — while the compact logo IS graded at its spill, because there the spill is the logo. The A-Z rail could not be fixed by moving the rail: with the grid filling `SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px control to its right, so the grid now reserves the band unconditionally (a reflow between two sections of one library is worse than a slightly narrower grid that never moves). One design cost, because it is a trade rather than a fix: dropping the top bar 18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts `GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its two constraints now instead of the "must not touch" rule alone, so the glass comes off a strip wider than ~672px rather than ~848. The product's strip is 572, so today's bar is unaffected and one more library still keeps it. If that is too tight the lever is the measured budget, not the frame. Checklist item #7 (idle / focused / selected distinguishable) was audited screen by screen at the same time and needed no change; the doc row says what was looked at instead of what was believed. Verified: `make check` 980 green, and the simulator at a real 1920x1080 — Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83 is the focused card's own drop shadow, the 1078 the scrolling shelf's peek). No television: this lane is host-only. Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 27, 2026
…it (#61) The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame". That reads as clearance and is the opposite: a smaller margin puts content NEARER the edge, so every screen in the app sat six pixels inside the exclusion zone. Nobody had ever measured one. The vertical half was worse, because it did not exist. There was no MARGIN_Y anywhere in the tree, so nothing bounded the top or bottom of anything, and four places were further out than the horizontal margin ever was: - the shared top tab bar + profile chip, 18px (the "main page" the item names) - the detail page's pinned compact title, 14px — and 32 for a square clearLogo, which spills upward as paint rather than as layout - the Library's A-Z rail, 32px, the worst in the app - the Home / Library / Person scroll reveals, which settled a focused card's caption 24 / 16 / 40px off the bottom edge Both margins are tokens now (96 / 54), and the requirement is a host test rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone` grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a later audit can move a token — or give one screen a correction of its own — without the test being rewritten to permit it. Deliberately no `assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix. "Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a focus glow and a shelf peeking off the bottom edge are all supposed to reach the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus pop magnifies ink already inside the frame and its caption does not scale — while the compact logo IS graded at its spill, because there the spill is the logo. The A-Z rail could not be fixed by moving the rail: with the grid filling `SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px control to its right, so the grid now reserves the band unconditionally (a reflow between two sections of one library is worse than a slightly narrower grid that never moves). One design cost, because it is a trade rather than a fix: dropping the top bar 18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts `GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its two constraints now instead of the "must not touch" rule alone, so the glass comes off a strip wider than ~672px rather than ~848. The product's strip is 572, so today's bar is unaffected and one more library still keeps it. If that is too tight the lever is the measured budget, not the frame. Checklist item #7 (idle / focused / selected distinguishable) was audited screen by screen at the same time and needed no change; the doc row says what was looked at instead of what was believed. Verified: `make check` 980 green, and the simulator at a real 1920x1080 — Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83 is the focused card's own drop shadow, the 1078 the scrolling shelf's peek). No television: this lane is host-only. Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Aug 28, 2026
…it (#61) The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame". That reads as clearance and is the opposite: a smaller margin puts content NEARER the edge, so every screen in the app sat six pixels inside the exclusion zone. Nobody had ever measured one. The vertical half was worse, because it did not exist. There was no MARGIN_Y anywhere in the tree, so nothing bounded the top or bottom of anything, and four places were further out than the horizontal margin ever was: - the shared top tab bar + profile chip, 18px (the "main page" the item names) - the detail page's pinned compact title, 14px — and 32 for a square clearLogo, which spills upward as paint rather than as layout - the Library's A-Z rail, 32px, the worst in the app - the Home / Library / Person scroll reveals, which settled a focused card's caption 24 / 16 / 40px off the bottom edge Both margins are tokens now (96 / 54), and the requirement is a host test rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone` grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a later audit can move a token — or give one screen a correction of its own — without the test being rewritten to permit it. Deliberately no `assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix. "Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a focus glow and a shelf peeking off the bottom edge are all supposed to reach the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus pop magnifies ink already inside the frame and its caption does not scale — while the compact logo IS graded at its spill, because there the spill is the logo. The A-Z rail could not be fixed by moving the rail: with the grid filling `SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px control to its right, so the grid now reserves the band unconditionally (a reflow between two sections of one library is worse than a slightly narrower grid that never moves). One design cost, because it is a trade rather than a fix: dropping the top bar 18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts `GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its two constraints now instead of the "must not touch" rule alone, so the glass comes off a strip wider than ~672px rather than ~848. The product's strip is 572, so today's bar is unaffected and one more library still keeps it. If that is too tight the lever is the measured budget, not the frame. Checklist item #7 (idle / focused / selected distinguishable) was audited screen by screen at the same time and needed no change; the doc row says what was looked at instead of what was believed. Verified: `make check` 980 green, and the simulator at a real 1920x1080 — Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83 is the focused card's own drop shadow, the 1078 the scrolling shelf's peek). No television: this lane is host-only. Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G Co-authored-by: Claude Opus 5 (1M context) <[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.
Unit 12 of the movie/TV parity work (
docs/parity-gaps.md, player/stats appendix): "Chapters areunavailable for any episode started from a show detail page" and "No chapter or intro/credits
markers on the scrubber rail".
1. The Chapters tab on the episode path
ui/chapters_panel.rsreadmetadata::current()in all four accessors. During a show-page episodeplay
current()is the SHOW (detail::play_episode_atsays so in a comment) and a show containercarries no
Chapter[], sohas_chapters()was false and the HUD drew only the Info tab. The samealiasing meant a
current()holding a different leaf would seek with that item's offsets.Chapters now ride
metadata::PlayingItembesidemarkers— the store that exists for exactly thisidentity problem — behind one new accessor,
metadata::playing_chapters().No extra PMS request, confirmed rather than assumed.
Client::metadataalready sendsincludeChapters=1(plex/library.rs), and both store-building paths already have the data:cached_playingclones the loadedDetail's chapters (no GET, as before);fetch_playing_itemwas already making that GET for markersand streams and discarding the
Chapter[]in the same response.Device proof, playing an episode from the show page:
playing item: rk=1886 audio=1 subs=38 markers=2 chapters=39— one metadata GET, 39 chapters that used to be dropped.The staleness this exposed
Moving chapters into
PLAYINGmade a latent bug user-reachable, sorequest_playnow retires thatstore beside
UP_NEXT, for the reason already documented there: it stays the PREVIOUS leaf's forthe whole resolve window (0.5-3 s, longer through a
/decisionhandshake), and the HUD is up forall of it. Markers were shielded by
active_marker'sis_playing()gate; a tab has no such gate,and its OK would have seeked the new episode to another item's offset. The
NowPlayingcaptioncan't move with it —
play_episode_atsets it just before requesting the play — so the retirementis
PLAYING-only.chapters_panel::updatealso re-clamps its selection, since the list it indexescan now be replaced under an open strip.
2. Chapter + intro/credits marks on the rail
Between the track and the knob:
metadata::playing_markers()— under the fill, so a watched segmentreads as watched. A
finalcredits marker's stated end is the container duration (it overshootsthe decoder's), so the band is clamped to the rail.
can't serve both, since white vanishes into the fill and dark vanishes into the track.
Three new
theme.rstokens with doc lines; no inline colours, no text, no new font sizes.Geometry is pure and host-tested (
chapter_tick_xs,marker_band): the 0:00 chapter and anythingwithin 8px of a cap are dropped (they are the rail's ends, not boundaries on it), and ticks coalesce
on distance — PMS does not sort these sibling arrays by offset (its
Marker[]comes backcredits-before-intro), and a signed compare would silently drop everything after the first backward
step.
Verification
make checkmake(ARM cross-build)./tests/run.py --fps-playerfps:track-menu(its item draws 33 ticks) 54fps vs floor 45;fps:info-panel53 vs 45./tests/run.py --filter morning_show_skip_intromorning_show_skip_intro,..._press)Ticks land within a pixel of what the pure function predicts (157/198/252/282/317 px), and each
marker band measures ~2.4x the plain track's ink — both measured off the
DISPLAYcapture ratherthan eyeballed, since the rail is semi-transparent over live video.
A correctness review was run over the diff; its one real finding (the stale-store window above) is
fixed here, along with three doc-accuracy notes and the non-monotone coalesce. Its out-of-scope
find, left alone:
app.rs:1409-1410has two identicalelse if vis && hud_nav.focus == 1arms, thefirst empty, so OK on a focused Subtitles/Audio disc is a no-op by remote — pre-existing, from
c1691d1, and already recorded indocs/parity-gaps.md.🤖 Generated with Claude Code
https://claude.ai/code/session_018GuSHrq9oydnX7nhKE1Hvc