Added feature flag for opening vscode in a new tab (#8917)

This commit is contained in:
tofarr 2025-06-05 10:32:07 -06:00 committed by GitHub
parent dee89462c2
commit b76553136e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import { I18nKey } from "#/i18n/declaration";
import { RootState } from "#/store";
import { RUNTIME_INACTIVE_STATES } from "#/types/agent-state";
import { useVSCodeUrl } from "#/hooks/query/use-vscode-url";
import { VSCODE_IN_NEW_TAB } from "#/utils/feature-flags";
function VSCodeTab() {
const { t } = useTranslation();
@ -22,7 +23,9 @@ function VSCodeTab() {
const currentProtocol = window.location.protocol;
// Check if the iframe URL has a different protocol than the current page
setIsCrossProtocol(iframeProtocol !== currentProtocol);
setIsCrossProtocol(
VSCODE_IN_NEW_TAB() || iframeProtocol !== currentProtocol,
);
} catch (e) {
// Silently handle URL parsing errors
setIframeError(t("VSCODE$URL_PARSE_ERROR"));

View File

@ -14,5 +14,6 @@ export function loadFeatureFlag(
export const BILLING_SETTINGS = () => loadFeatureFlag("BILLING_SETTINGS");
export const HIDE_LLM_SETTINGS = () => loadFeatureFlag("HIDE_LLM_SETTINGS");
export const VSCODE_IN_NEW_TAB = () => loadFeatureFlag("VSCODE_IN_NEW_TAB");
export const ENABLE_TRAJECTORY_REPLAY = () =>
loadFeatureFlag("TRAJECTORY_REPLAY");