Cover Now Playing returns after browsing in both layouts

This commit is contained in:
Jonathan Sykes
2026-10-03 18:29:48 +08:00
parent cdc367a972
commit 613f8fb902
3 changed files with 113 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
# Now Playing list return regression
The shared browsing list retains the last page independently of the live playback
queue. Search home hides `#listPane`; the mini-player previously only removed
`home-over` and scrolled. It did not reset that hidden flag or replace the previous
page with the playing playlist. At 390 px the original code fails in both Classic
and Glass Stage with `#listPane` still hidden after tapping the mini-player.
The separate `#upnext` card remained intact in this reproduction.
Returning now rebuilds the source playlist and Up next. If its source playlist
was removed (or playback came from search/channel/history), the list displays the
live queue, without replacing it with the unrelated editable saved queue.
Mini-player, close, Player jump, user-picked track/deep-link reveal and browser
history returns share the restoration. Auto-advance still skips the reveal hook.
History entries retain browsing views, and Settings section entries remain owned
by Settings. Repeated restoration does not add duplicate player history entries.
Run `npx playwright test --config playwright.now-playing.config.js`.
The 20 cases cover both themes at 390/1440 px, return controls, Back/Forward,
missing source playlists, stale Up next DOM, repeated returns and an exhausted
queue. Synthetic tracks avoid dependence on YouTube decoding/network; the
track-reveal case exercises the shared post-load hook, rather than real media
loading. Headless Chromium exposes the mini-player via test CSS because it is
not an installed phone PWA. The Player jump is tested only at phone width,
where that navigation exists.
Validation: 115 frontend unit tests, app syntax check, server build and 20 browser
cases pass. Replaying the 390 px mini-player tests with the original app script
fails in both themes at the hidden list assertion; the patched script passes.
No server implementation or tests changed.
On a real iPhone, confirm the same browse/return sequence in Safari and the
installed PWA, plus Back/Forward and an actual shared video deep link. Confirm
playback keeps its position and the page scrolls to the player without shifting
the document viewport. Desktop checks cover both themes; no playback/background,
playlist action layout or device-export implementation was changed.