Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): stabilize floating preview movement and resizing #16831

Closedvoltcrash(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/16831/headopened View on GitHub

Showing 16 changed files with 13 additions and 44 deletions (loading 13).

x
0 of 16 viewed, 16 left
4 additions and 2 deletionsapps/web/src/browser/BrowserSurfaceSlot.tsxModified
View file
@@ -28,7 +28,9 @@
​
useLayoutEffect(() => {
const element = elementRef.current;
- if (!element) return;
+ // A closing panel can remain mounted for its animation, but must hand the
+ // browser to the floating player as soon as it stops being visible.
+ if (!element || !visible) return;
let lease = acquireBrowserSurface(tabId, fitSourceContent);
const update = () => {
const rect = element.getBoundingClientRect();
@@ -77,7 +79,7 @@
if (updateRef.current === update) updateRef.current = null;
lease.release();
};
- }, [fitSourceContent, tabId]);
+ }, [fitSourceContent, tabId, visible]);
​
useLayoutEffect(() => {
presentationRef.current = { visible, cornerRadius, zIndex };
7 additions and 36 deletionsapps/web/src/components/chat/ChatCanvas.tsxModified
View file
@@ -8,26 +8,21 @@
type CSSProperties,
} from "react";
import { ChatCanvasContext } from "./ChatCanvasContext";
-import { resolveChatCanvasLayout, type ChatCanvasPreview } from "./chatCanvasLayout";