Keep favorites reachable with the bar hidden

The favorites bar carries the "Browse all" button and the sort control, so
switching the bar off in settings hid the way in to both. The command
palette now offers "Browse favorites" (or "Back to videos") and each sort
order, and opening the grid re-renders the bar so its header -- the way back
out -- is mounted even when settings say hidden.

Tests (scratchpad): a new palette test that starts with the bar switched
off, opens the grid through the palette, re-sorts through it, and returns to
the listing. It caught the second half of this: opening from the palette did
not re-render the bar, leaving no visible way out.

Also fixes the favorites playback test, which had been wedging headless
Chrome all session. It was reloading by navigating to the URL already
loaded; the first evaluate after that is answered by the outgoing execution
context and every one after it hangs forever. It now does its second visit
in a fresh tab -- localStorage is shared per origin, so it models "next day"
the same way -- and asserts what it had only been printing. It also runs
hermetically now (no favorites left over from another test, CDN icons and
fonts blocked) and no longer runs its whole body on import, which is what
made it hijack a debugging session earlier.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QBDkEXP4htyXTCZUwMLphd
This commit is contained in:
Simon
2026-09-06 11:34:45 +00:00
parent d4ed9dce5d
commit 0009574b77
3 changed files with 30 additions and 1 deletions

View File

@@ -59,6 +59,10 @@ App.favoritesView = App.favoritesView || {};
view.offset = 0;
state.hasNextPage = true;
document.body.classList.add('favorites-view-open');
// Re-render the bar so it re-decides whether to be mounted: hidden in
// settings or not, its header has to be on screen now, since that's
// where the way back out lives (the palette can open this view too).
App.favorites.renderBar();
App.favoritesView.syncControls();
App.favoritesView.loadNext();
window.scrollTo({ top: 0, behavior: 'auto' });
@@ -71,6 +75,8 @@ App.favoritesView = App.favoritesView || {};
view.queue = [];
view.offset = 0;
document.body.classList.remove('favorites-view-open');
// Back to whatever the settings say, and with its cards built again.
App.favorites.renderBar();
App.favoritesView.syncControls();
// Back to the channel listing, unless the caller is about to load
// something itself (a search, a channel switch).