Skip to content

Commit 49375da

Browse files
fix(web): project actions auto-open Preview in web clients
The auto-open after a project action was gated on the desktop bridge, so web clients never opened the Preview URL even when the environment supports server-side Preview. Gate it on isPreviewAvailableFor, like the manual open paths. Fixes #34033 AI-assisted; verified with the tests and tools listed above.
1 parent d756fed commit 49375da

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎apps/web/src/components/chat/useChatTerminalActions.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import {
2828
type RightPanelSurface,
2929
useRightPanelStore,
3030
} from "../../rightPanelStore";
31-
import { isPreviewSupportedInRuntime } from "../../previewStateStore";
3231
import { openUrlInPreview } from "../../browser/openFileInPreview";
32+
import { isPreviewAvailableFor } from "../../browser/previewRuntime";
3333
import { resolveDiscoveredServerUrl } from "../../browser/browserTargetResolver";
3434
import { stackedThreadToast, toastManager } from "../ui/toast";
3535
import { confirmTerminalClose } from "../../lib/terminalCloseConfirm";
@@ -290,7 +290,11 @@ export function useChatTerminalActions(input: ChatTerminalActionsInput) {
290290
}
291291
return;
292292
}
293-
if (script.autoOpenPreview && script.previewUrl && isPreviewSupportedInRuntime()) {
293+
if (
294+
script.autoOpenPreview &&
295+
script.previewUrl &&
296+
isPreviewAvailableFor(activeThreadRef.environmentId)
297+
) {
294298
const previewResult = await openUrlInPreview({
295299
threadRef: activeThreadRef,
296300
url: resolveDiscoveredServerUrl(activeThreadRef.environmentId, script.previewUrl),

0 commit comments

Comments
 (0)