diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index 48a87158e..fa6d2de14 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -1166,7 +1166,10 @@ export default class Explorer { } await this.refreshSampleData(); - this.restoreOpenTabs(); + + if (userContext.features.restoreTabs) { + this.restoreOpenTabs(); + } } public async configureCopilot(): Promise { diff --git a/src/Explorer/OpenActions/OpenActions.tsx b/src/Explorer/OpenActions/OpenActions.tsx index 38ca61838..53fb896b5 100644 --- a/src/Explorer/OpenActions/OpenActions.tsx +++ b/src/Explorer/OpenActions/OpenActions.tsx @@ -1,4 +1,5 @@ // TODO convert this file to an action registry in order to have actions and their handlers be more tightly coupled. +import { configContext, Platform } from "ConfigContext"; import { useDatabases } from "Explorer/useDatabases"; import React from "react"; import { ActionContracts } from "../../Contracts/ExplorerContracts"; @@ -56,6 +57,19 @@ function openCollectionTab( continue; } + if ( + configContext.platform === Platform.Fabric && + !( + // whitelist the tab kinds that are allowed to be opened in Fabric + ( + action.tabKind === ActionContracts.TabKind.SQLDocuments || + action.tabKind === ActionContracts.TabKind.SQLQuery + ) + ) + ) { + continue; + } + //expand database first if not expanded to load the collections if (!database.isDatabaseExpanded?.()) { database.expandDatabase?.(); diff --git a/src/Platform/Hosted/extractFeatures.ts b/src/Platform/Hosted/extractFeatures.ts index 5bd84516e..e26cb9c12 100644 --- a/src/Platform/Hosted/extractFeatures.ts +++ b/src/Platform/Hosted/extractFeatures.ts @@ -38,6 +38,7 @@ export type Features = { readonly copilotChatFixedMonacoEditorHeight: boolean; readonly enablePriorityBasedExecution: boolean; readonly disableConnectionStringLogin: boolean; + readonly restoreTabs: boolean; // can be set via both flight and feature flag autoscaleDefault: boolean; @@ -108,6 +109,7 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear copilotChatFixedMonacoEditorHeight: "true" === get("copilotchatfixedmonacoeditorheight"), enablePriorityBasedExecution: "true" === get("enableprioritybasedexecution"), disableConnectionStringLogin: "true" === get("disableconnectionstringlogin"), + restoreTabs: "true" === get("restoretabs"), }; } diff --git a/test/sql/query.spec.ts b/test/sql/query.spec.ts index 4c1392dd0..5872346bb 100644 --- a/test/sql/query.spec.ts +++ b/test/sql/query.spec.ts @@ -1,6 +1,5 @@ import { expect, test } from "@playwright/test"; -import { StorageKey } from "../../src/Shared/StorageUtility"; import { DataExplorer, Editor, QueryTab, TestAccount } from "../fx"; import { TestContainerContext, TestItem, createTestSQLContainer } from "../testData"; @@ -17,9 +16,6 @@ test.beforeEach("Open new query tab", async ({ page }) => { // Open a query tab explorer = await DataExplorer.open(page, TestAccount.SQL); - // Clear previous settings - page.evaluate(() => localStorage.removeItem(StorageKey[StorageKey.AppState])); - // Container nodes should be visible. The explorer auto-expands database nodes when they are first loaded. const containerNode = await explorer.waitForContainerNode(context.database.id, context.container.id); await containerNode.openContextMenu();