A video picture-in-picture window renders one <video>'s frames and nothing else, which is why moving through the reel from it had to be smuggled in through media keys. Document picture-in-picture opens a real document instead, so the feed is moved into it: #feed-view and its whole subtree are appended to the new window's body. Nothing is copied and no <video> is re-created, so playback continues across the move and the scroll-snap list, the panes, the split tree and every control keep working -- they are the same elements, in another window. Scrolling the window scrolls the reel, because it is the reel. The lookups in feed.js now go through the cached #feed-view root rather than document.getElementById, since after the move the feed is no longer in this document, and the HUD-idle class rides on that root so it travels with it. The page underneath drops back to the grid while the feed is out, and gets it back when the window closes. The video window stays as the fallback: it is Chrome-only, needs a user gesture, and a hidden tab has none -- so auto-PiP on tab switch is still the old path. It is suppressed while a document window is open, or the browser would tear the video out of it on the next switch. Also fixes the picture-in-picture button, which referenced an undefined `pane` in bindSharedControls (the parameter was named `slide`) and threw into a swallowed promise rejection on every click. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QBDkEXP4htyXTCZUwMLphd
7.6 KiB
7.6 KiB