Repository navigation
fix(web): project actions auto-open Preview in web clients #34048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,8 +28,8 @@ import { | |
| type RightPanelSurface, | ||
| useRightPanelStore, | ||
| } from "../../rightPanelStore"; | ||
| import { isPreviewSupportedInRuntime } from "../../previewStateStore"; | ||
| import { openUrlInPreview } from "../../browser/openFileInPreview"; | ||
| import { isPreviewAvailableFor } from "../../browser/previewRuntime"; | ||
| import { resolveDiscoveredServerUrl } from "../../browser/browserTargetResolver"; | ||
| import { stackedThreadToast, toastManager } from "../ui/toast"; | ||
| import { confirmTerminalClose } from "../../lib/terminalCloseConfirm"; | ||
|
|
@@ -290,7 +290,11 @@ export function useChatTerminalActions(input: ChatTerminalActionsInput) { | |
| } | ||
| return; | ||
| } | ||
| if (script.autoOpenPreview && script.previewUrl && isPreviewSupportedInRuntime()) { | ||
| if ( | ||
| script.autoOpenPreview && | ||
| script.previewUrl && | ||
| isPreviewAvailableFor(activeThreadRef.environmentId) | ||
| ) { | ||
| const previewResult = await openUrlInPreview({ | ||
| threadRef: activeThreadRef, | ||
| url: resolveDiscoveredServerUrl(activeThreadRef.environmentId, script.previewUrl), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: pingdotgg/t3code
Length of output: 3429
Script executed:
Repository: pingdotgg/t3code
Length of output: 24057
Script executed:
Repository: pingdotgg/t3code
Length of output: 7997
Add a regression test for web auto-open.
Run a project action with desktop preview unavailable and
serverBrowserenabled. After a successful terminal write, assert that the resolved configured URL opens for the active environment. The old gate would skip the open call.