Skip to content

Commit a6e38a8

Browse files
t3dotggclaude
andcommitted
fix(web): a tab that turned headless ignores its old desktop page state
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 07dbb78 commit a6e38a8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/web/src/components/preview/PreviewView.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ export function PreviewView({
219219
const [serverControlledTabId, setServerControlledTabId] = useState<string | null>(null);
220220
const serverInputDisabled = isServerTab && serverControlledTabId !== runtimeTabId;
221221
const [serverFrameTabId, setServerFrameTabId] = useState<string | null>(null);
222-
const desktopOverlay = tabId ? (previewState.desktopByTabId[tabId] ?? null) : null;
222+
// A desktop page that mounted before its tab went headless leaves its stale state here.
223+
const desktopOverlay =
224+
tabId && !isServerTab ? (previewState.desktopByTabId[tabId] ?? null) : null;
223225
const layoutZoomFactor = useBrowserLayoutZoomFactor(desktopOverlay?.zoomFactor ?? 1);
224226
const navStatus = snapshot?.navStatus ?? { _tag: "Idle" as const };
225227
const url = navStatus._tag === "Idle" ? "" : navStatus.url;

0 commit comments

Comments
 (0)