fix(ui): keep playback state and floating controls consistent

Native original-page readiness now reaches the existing participant projection. Narrow playback gives time priority over the inline volume slider. Floating panels join room Back handling after their document adoption so return from picture-in-picture remains dismissible. Checked actual touch controls and PiP return in Chrome, focused playback and panel suites, and both TypeScript projects.
This commit is contained in:
AAA committed 2026-11-27 18:13:39 -05:00
1 parent dc94bda30b
commit 9c6e2e129b
7 files changed
+36 -14

No files matched your search

@@ -3,6 +3,7 @@ import { useImperativeHandle, useLayoutEffect, useRef, useState, type PointerEve
import { createPortal } from "react-dom";
import { useCopy } from "../../ui/copy";
import { Glyph } from "../../ui/icons";
import { useLayerHistory } from "../../ui/layer-history";
import { surfaceViewport } from "../../ui/window-appearance";
import { usePanelWindow, panelWindowAPI, SurfaceDocument, PANEL_SIZE } from "../../ui/panel-window";
import { Btn } from "./primitives";
@@ -121,6 +122,8 @@ export function FloatingPanel({ onDetachedTrigger, onNativeReady, closeOnReturn
return () => owner.removeEventListener("fullscreenchange", hideOutsideFullscreen);
}, [surfaceDocument]);
useLayerHistory(panelRef, open && !detached);
useLayoutEffect(() => {
if (!surfaceDocument) return;
if (surfaceDocument !== document) surfaceDocument.title = `${title} · Piik`;