From 5012f44cfa4c17cc157ff32c98835b2f4c7a48f8 Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Wed, 17 Jun 2026 16:52:58 -0700 Subject: [PATCH] Video: deep-link every sidebar page (URL parity with the music side) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only the detail page produced a real URL before; top-level video pages (search, library, discover, calendar, watchlist, wishlist, …) pushed nothing and even cleared the URL to '/'. Now each page deep-links to '/' + pageId (e.g. /video-search), mirroring music's '/' and the existing /video-detail/ scheme: - navigate() pushes/replaces { videoPage } history state; parsePagePath/buildPagePath added alongside parseDetailPath/buildDetailPath. - popstate restores a page URL (and hands the side back to music when Back crosses out of /video-*); boot restores a page deep link, re-asserting the URL against music's boot clobber (same tactic the detail boot already uses). - applySide() is now chrome-only; switchSide()/boot drive navigation explicitly. - Nav anchors carry the real href=/video- (was '#') and the click handler lets ⌘/Ctrl/middle-click open a new tab — full parity with the music nav + cards. Server already serves /video-* via the SPA catch-all; music side untouched (isolated IIFE). Reload / Back / Forward / new-tab now work for every page. --- tests/test_video_side_shell.py | 15 +++++ webui/index.html | 26 ++++---- webui/static/video/video-side.js | 111 +++++++++++++++++++++++++------ 3 files changed, 119 insertions(+), 33 deletions(-) diff --git a/tests/test_video_side_shell.py b/tests/test_video_side_shell.py index 3874d119..39fb9bf6 100644 --- a/tests/test_video_side_shell.py +++ b/tests/test_video_side_shell.py @@ -376,6 +376,21 @@ def test_video_side_has_real_url_routing(): assert "'library'" in _JS +def test_video_top_level_pages_are_deep_linked(): + # Every sidebar page (not just detail) deep-links to '/' + pageId, mirroring + # the music side — pushState on nav, parse + restore on reload/Back. + assert "parsePagePath" in _JS and "buildPagePath" in _JS + assert "videoPage" in _JS # history state tag for pages + # The nav anchors carry the real path (so ⌘/middle-click open a new tab) and + # no longer point at the dead '#'. + assert 'data-video-page="video-search" href="/video-search"' in _INDEX + assert 'data-video-page="video-library" href="/video-library"' in _INDEX + assert 'href="#"' not in _block( # none left in the video nav block + _INDEX, r'