No secrets created
There are no secrets associated with your project yet
diff --git a/apps/studio/components/interfaces/SQLEditor/RenameQueryModal.tsx b/apps/studio/components/interfaces/SQLEditor/RenameQueryModal.tsx
index 2f062081911e5..35af13d854351 100644
--- a/apps/studio/components/interfaces/SQLEditor/RenameQueryModal.tsx
+++ b/apps/studio/components/interfaces/SQLEditor/RenameQueryModal.tsx
@@ -3,6 +3,7 @@ import { toast } from 'sonner'
import { useParams } from 'common'
import { useSqlTitleGenerateMutation } from 'data/ai/sql-title-mutation'
+import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
import { getContentById } from 'data/content/content-id-query'
import {
UpsertContentPayload,
@@ -11,12 +12,10 @@ import {
import { Snippet } from 'data/content/sql-folders-query'
import type { SqlSnippet } from 'data/content/sql-snippets-query'
import { useOrgSubscriptionQuery } from 'data/subscriptions/org-subscription-query'
-import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
import { useSelectedOrganization } from 'hooks/misc/useSelectedOrganization'
import { useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2'
import { createTabId, useTabsStateSnapshot } from 'state/tabs'
import { AiIconAnimation, Button, Form, Input, Modal } from 'ui'
-import { useIsSQLEditorTabsEnabled } from '../App/FeaturePreview/FeaturePreviewContext'
import { subscriptionHasHipaaAddon } from '../Billing/Subscription/Subscription.utils'
export interface RenameQueryModalProps {
@@ -42,7 +41,6 @@ const RenameQueryModal = ({
{ enabled: visible }
)
const isSQLSnippet = snippet.type === 'sql'
- const isSQLEditorTabsEnabled = useIsSQLEditorTabsEnabled()
const { data: projectSettings } = useProjectSettingsV2Query({ projectRef: ref })
// Customers on HIPAA plans should not have access to Supabase AI
@@ -112,10 +110,8 @@ const RenameQueryModal = ({
snapV2.renameSnippet({ id, name: nameInput, description: descriptionInput })
- if (isSQLEditorTabsEnabled && ref) {
- const tabId = createTabId('sql', { id })
- tabsSnap.updateTab(tabId, { label: nameInput })
- }
+ const tabId = createTabId('sql', { id })
+ tabsSnap.updateTab(tabId, { label: nameInput })
toast.success('Successfully renamed snippet!')
if (onComplete) onComplete()
diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx
index 054174f05f34d..fb4e091477247 100644
--- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx
+++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx
@@ -51,7 +51,6 @@ import {
TooltipTrigger,
cn,
} from 'ui'
-import { useIsSQLEditorTabsEnabled } from '../App/FeaturePreview/FeaturePreviewContext'
import { useSqlEditorDiff, useSqlEditorPrompt } from './hooks'
import { RunQueryWarningModal } from './RunQueryWarningModal'
import {
@@ -95,7 +94,6 @@ export const SQLEditor = () => {
const { isOptedInToAI, isHipaaProjectDisallowed } = useOrgOptedIntoAiAndHippaProject()
const [selectedSchemas] = useSchemasForAi(project?.ref!)
const includeSchemaMetadata = (isOptedInToAI && !isHipaaProjectDisallowed) || !IS_PLATFORM
- const isSQLEditorTabsEnabled = useIsSQLEditorTabsEnabled()
const {
sourceSqlDiff,
@@ -212,10 +210,8 @@ export const SQLEditor = () => {
try {
const { title: name } = await generateSqlTitle({ sql })
snapV2.renameSnippet({ id, name })
- if (isSQLEditorTabsEnabled && ref) {
- const tabId = createTabId('sql', { id })
- tabs.updateTab(tabId, { label: name })
- }
+ const tabId = createTabId('sql', { id })
+ tabs.updateTab(tabId, { label: name })
} catch (error) {
// [Joshen] No error handler required as this happens in the background and not necessary to ping the user
}
diff --git a/apps/studio/components/interfaces/Sidebar.tsx b/apps/studio/components/interfaces/Sidebar.tsx
index 11ef4f28fa6eb..bb7625b410a7f 100644
--- a/apps/studio/components/interfaces/Sidebar.tsx
+++ b/apps/studio/components/interfaces/Sidebar.tsx
@@ -42,10 +42,7 @@ import {
Sidebar as SidebarPrimitive,
useSidebar,
} from 'ui'
-import {
- useIsAPIDocsSidePanelEnabled,
- useIsSQLEditorTabsEnabled,
-} from './App/FeaturePreview/FeaturePreviewContext'
+import { useIsAPIDocsSidePanelEnabled } from './App/FeaturePreview/FeaturePreviewContext'
export const ICON_SIZE = 32
export const ICON_STROKE_WIDTH = 1.5
@@ -228,7 +225,6 @@ const ProjectLinks = () => {
const showWarehouse = useFlag('warehouse')
const showUnifiedLogs = useFlag('unifiedLogs')
- const isSqlEditorTabsEnabled = useIsSQLEditorTabsEnabled()
const activeRoute = router.pathname.split('/')[3]
@@ -244,9 +240,7 @@ const ProjectLinks = () => {
'realtime:all',
])
- const toolRoutes = generateToolRoutes(ref, project, {
- sqlEditorTabs: isSqlEditorTabsEnabled,
- })
+ const toolRoutes = generateToolRoutes(ref, project)
const productRoutes = generateProductRoutes(ref, project, {
auth: authEnabled,
edgeFunctions: edgeFunctionsEnabled,
diff --git a/apps/studio/components/interfaces/TableGridEditor/EmptyState.tsx b/apps/studio/components/interfaces/TableGridEditor/EmptyState.tsx
deleted file mode 100644
index 0fbf052477c17..0000000000000
--- a/apps/studio/components/interfaces/TableGridEditor/EmptyState.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-import { PermissionAction } from '@supabase/shared-types/out/constants'
-
-import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
-import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState'
-import { useEntityTypesQuery } from 'data/entity-types/entity-types-infinite-query'
-import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
-import { useLocalStorage } from 'hooks/misc/useLocalStorage'
-import { useQuerySchemaState } from 'hooks/misc/useSchemaQueryState'
-import { PROTECTED_SCHEMAS } from 'lib/constants/schemas'
-import { useTableEditorStateSnapshot } from 'state/table-editor'
-
-export interface EmptyStateProps {}
-
-const EmptyState = ({}: EmptyStateProps) => {
- const snap = useTableEditorStateSnapshot()
- const { selectedSchema } = useQuerySchemaState()
- const isProtectedSchema = PROTECTED_SCHEMAS.includes(selectedSchema)
- const canCreateTables =
- useCheckPermissions(PermissionAction.TENANT_SQL_ADMIN_WRITE, 'tables') && !isProtectedSchema
-
- const [sort] = useLocalStorage<'alphabetical' | 'grouped-alphabetical'>(
- 'table-editor-sort',
- 'alphabetical'
- )
-
- const { project } = useProjectContext()
- const { data } = useEntityTypesQuery({
- projectRef: project?.ref,
- connectionString: project?.connectionString,
- schemas: [selectedSchema],
- sort,
- })
-
- const totalCount = data?.pages?.[0].data.count ?? 0
-
- return (
-
- {totalCount === 0 ? (
-
-
- There are no tables available in this schema.
-
-
- ) : (
-
-
-
- Select a table from the navigation panel on the left to view its data
- {canCreateTables && ', or create a new one.'}
-
-
-
- )}
-
- )
-}
-
-export default EmptyState
diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
index 2bfb205ed15b4..debbd89ef68ff 100644
--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
@@ -5,7 +5,6 @@ import { useState } from 'react'
import { toast } from 'sonner'
import { useParams } from 'common'
-import { useIsTableEditorTabsEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
import { useDatabasePublicationCreateMutation } from 'data/database-publications/database-publications-create-mutation'
import { useDatabasePublicationsQuery } from 'data/database-publications/database-publications-query'
@@ -21,6 +20,7 @@ import { tableRowKeys } from 'data/table-rows/keys'
import { useTableRowCreateMutation } from 'data/table-rows/table-row-create-mutation'
import { useTableRowUpdateMutation } from 'data/table-rows/table-row-update-mutation'
import { tableKeys } from 'data/tables/keys'
+import { RetrieveTableResult } from 'data/tables/table-retrieve-query'
import { getTables } from 'data/tables/tables-query'
import { useUrlState } from 'hooks/ui/useUrlState'
import { useGetImpersonatedRoleState } from 'state/role-impersonation-state'
@@ -50,7 +50,6 @@ import {
import SpreadsheetImport from './SpreadsheetImport/SpreadsheetImport'
import TableEditor from './TableEditor/TableEditor'
import type { ImportContent } from './TableEditor/TableEditor.types'
-import { RetrieveTableResult } from 'data/tables/table-retrieve-query'
export interface SidePanelEditorProps {
editable?: boolean
@@ -71,7 +70,6 @@ const SidePanelEditor = ({
const { ref } = useParams()
const snap = useTableEditorStateSnapshot()
const tabsSnap = useTabsStateSnapshot()
- const isTableEditorTabsEnabled = useIsTableEditorTabsEnabled()
const [_, setParams] = useUrlState({ arrayKeys: ['filter', 'sort'] })
const queryClient = useQueryClient()
@@ -493,7 +491,7 @@ const SidePanelEditor = ({
`Table ${table.name} has been updated but there were some errors. Please check these errors separately.`
)
} else {
- if (isTableEditorTabsEnabled && ref && payload.name) {
+ if (ref && payload.name) {
// [Joshen] Only table entities can be updated via the dashboard
const tabId = createTabId(ENTITY_TYPE.TABLE, { id: selectedTable.id })
tabsSnap.updateTab(tabId, { label: payload.name })
diff --git a/apps/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx b/apps/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx
index 08ec744a22f06..a29a158fc05a3 100644
--- a/apps/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx
+++ b/apps/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx
@@ -1,5 +1,5 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { isUndefined } from 'lodash'
+import Link from 'next/link'
import { useRouter } from 'next/router'
import { useCallback } from 'react'
@@ -18,13 +18,11 @@ import { useQuerySchemaState } from 'hooks/misc/useSchemaQueryState'
import { useSelectedProject } from 'hooks/misc/useSelectedProject'
import { useUrlState } from 'hooks/ui/useUrlState'
import { PROTECTED_SCHEMAS } from 'lib/constants/schemas'
-import Link from 'next/link'
import { useAppStateSnapshot } from 'state/app-state'
import { TableEditorTableStateContextProvider } from 'state/table-editor-table'
import { createTabId, useTabsStateSnapshot } from 'state/tabs'
import { Button } from 'ui'
import { Admonition, GenericSkeletonLoader } from 'ui-patterns'
-import { useIsTableEditorTabsEnabled } from '../App/FeaturePreview/FeaturePreviewContext'
import DeleteConfirmationDialogs from './DeleteConfirmationDialogs'
import SidePanelEditor from './SidePanelEditor/SidePanelEditor'
import TableDefinition from './TableDefinition'
@@ -44,7 +42,6 @@ export const TableGridEditor = ({
const { ref: projectRef, id } = useParams()
const tabs = useTabsStateSnapshot()
- const isTableEditorTabsEnabled = useIsTableEditorTabsEnabled()
const { selectedSchema } = useQuerySchemaState()
useLoadTableEditorStateFromLocalStorageIntoUrl({
@@ -65,9 +62,9 @@ export const TableGridEditor = ({
connectionString: project?.connectionString,
})
- const onClearDashboardHistory = () => {
+ const onClearDashboardHistory = useCallback(() => {
if (projectRef) appSnap.setDashboardHistory(projectRef, 'editor', undefined)
- }
+ }, [appSnap, projectRef])
const onTableCreated = useCallback(
(table: { id: number }) => {
@@ -78,19 +75,12 @@ export const TableGridEditor = ({
const onTableDeleted = useCallback(async () => {
// For simplicity for now, we just open the first table within the same schema
- if (isTableEditorTabsEnabled && selectedTable) {
+ if (selectedTable) {
// Close tab
const tabId = createTabId(selectedTable.entity_type, { id: selectedTable.id })
tabs.handleTabClose({ id: tabId, router, editor: 'table', onClearDashboardHistory })
- } else {
- const tables = await getTables(selectedSchema)
- if (tables.length > 0) {
- router.push(`/project/${projectRef}/editor/${tables[0].id}`)
- } else {
- router.push(`/project/${projectRef}/editor`)
- }
}
- }, [getTables, isTableEditorTabsEnabled, projectRef, router, selectedSchema])
+ }, [onClearDashboardHistory, router, selectedTable, tabs])
// NOTE: DO NOT PUT HOOKS AFTER THIS LINE
if (isLoadingSelectedTable || !projectRef) {
@@ -105,7 +95,7 @@ export const TableGridEditor = ({
)
}
- if (isUndefined(selectedTable)) {
+ if (!selectedTable) {
return (
@@ -114,45 +104,41 @@ export const TableGridEditor = ({
title={`Unable to find your table with ID ${id}`}
description="This table doesn't exist in your database"
>
- {isTableEditorTabsEnabled && (
- <>
- {!!tabId ? (
- {
- tabs.handleTabClose({
- id: tabId,
- router,
- editor: 'table',
- onClearDashboardHistory,
- })
- }}
- >
- Close tab
-
- ) : openTabs.length > 0 ? (
- appSnap.setDashboardHistory(projectRef, 'editor', undefined)}
- >
-
- Close tab
-
-
- ) : (
- appSnap.setDashboardHistory(projectRef, 'editor', undefined)}
- >
- Head back
-
- )}
- >
+ {!!tabId ? (
+ {
+ tabs.handleTabClose({
+ id: tabId,
+ router,
+ editor: 'table',
+ onClearDashboardHistory,
+ })
+ }}
+ >
+ Close tab
+
+ ) : openTabs.length > 0 ? (
+ appSnap.setDashboardHistory(projectRef, 'editor', undefined)}
+ >
+
+ Close tab
+
+
+ ) : (
+ appSnap.setDashboardHistory(projectRef, 'editor', undefined)}
+ >
+ Head back
+
)}
diff --git a/apps/studio/components/interfaces/TableGridEditor/index.ts b/apps/studio/components/interfaces/TableGridEditor/index.ts
index 50e1839b9862c..52936211e7e82 100644
--- a/apps/studio/components/interfaces/TableGridEditor/index.ts
+++ b/apps/studio/components/interfaces/TableGridEditor/index.ts
@@ -1,2 +1 @@
-export { default as EmptyState } from './EmptyState'
export { default as SidePanelEditor } from './SidePanelEditor/SidePanelEditor'
diff --git a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx
index ac33ba4ff1da4..41a6434e1977e 100644
--- a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx
@@ -19,12 +19,7 @@ import {
} from 'icons'
import { IS_PLATFORM, PROJECT_STATUS } from 'lib/constants'
-export const generateToolRoutes = (
- ref?: string,
- project?: Project,
- features?: { sqlEditorTabs: boolean }
-): Route[] => {
- const { sqlEditorTabs } = features ?? {}
+export const generateToolRoutes = (ref?: string, project?: Project, features?: {}): Route[] => {
const isProjectBuilding = project?.status === PROJECT_STATUS.COMING_UP
const buildingUrl = `/project/${ref}`
@@ -42,8 +37,7 @@ export const generateToolRoutes = (
icon:
,
link: !IS_PLATFORM
? `/project/${ref}/sql/1`
- : ref &&
- (isProjectBuilding ? buildingUrl : `/project/${ref}/sql${!!sqlEditorTabs ? '' : '/new'}`),
+ : ref && (isProjectBuilding ? buildingUrl : `/project/${ref}/sql`),
},
]
}
diff --git a/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx b/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
index 3c887f9ac369e..0d6d6f1fcd957 100644
--- a/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
@@ -4,10 +4,6 @@ import { useRouter } from 'next/router'
import { forwardRef, Fragment, PropsWithChildren, ReactNode, useEffect, useState } from 'react'
import { useParams } from 'common'
-import {
- useIsSQLEditorTabsEnabled,
- useIsTableEditorTabsEnabled,
-} from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import ProjectAPIDocs from 'components/interfaces/ProjectAPIDocs/ProjectAPIDocs'
import { AIAssistant } from 'components/ui/AIAssistantPanel/AIAssistant'
import AISettingsModal from 'components/ui/AISettingsModal'
@@ -101,14 +97,8 @@ const ProjectLayout = forwardRef
{
const snapV2 = useSqlEditorV2StateSnapshot()
const tabs = useTabsStateSnapshot()
- const isSQLEditorTabsEnabled = useIsSQLEditorTabsEnabled()
const [sectionVisibility, setSectionVisibility] = useLocalStorage(
LOCAL_STORAGE_KEYS.SQL_EDITOR_SECTION_STATE(projectRef ?? ''),
@@ -293,12 +292,10 @@ export const SQLEditorNav = ({ sort = 'inserted_at' }: SQLEditorNavProps) => {
const { mutate: deleteContent, isLoading: isDeleting } = useContentDeleteMutation({
onSuccess: (data) => {
- if (isSQLEditorTabsEnabled) {
- // Update Tabs state - currently unknown how to differentiate between sql and non-sql content
- // so we're just deleting all tabs for with matching IDs
- const tabIds = data.map((id) => createTabId('sql', { id }))
- tabs.removeTabs(tabIds)
- }
+ // Update Tabs state - currently unknown how to differentiate between sql and non-sql content
+ // so we're just deleting all tabs for with matching IDs
+ const tabIds = data.map((id) => createTabId('sql', { id }))
+ tabs.removeTabs(tabIds)
},
onError: (error, data) => {
if (error.message.includes('Contents not found')) {
@@ -541,10 +538,10 @@ export const SQLEditorNav = ({ sort = 'inserted_at' }: SQLEditorNavProps) => {
const sqlEditorTabsCleanup = useSqlEditorTabsCleanup()
useEffect(() => {
- if (isSuccess && isSQLEditorTabsEnabled) {
+ if (isSuccess) {
sqlEditorTabsCleanup({ snippets: allSnippetsInView as any })
}
- }, [allSnippetsInView, isSQLEditorTabsEnabled, isSuccess, sqlEditorTabsCleanup])
+ }, [allSnippetsInView, isSuccess, sqlEditorTabsCleanup])
return (
<>
@@ -572,15 +569,13 @@ export const SQLEditorNav = ({ sort = 'inserted_at' }: SQLEditorNavProps) => {
data={projectSnippetsTreeState}
aria-label="project-level-snippets"
nodeRenderer={({ element, ...props }) => {
- const isOpened =
- isSQLEditorTabsEnabled &&
- Object.values(tabs.tabsMap).some(
- (tab) => tab.metadata?.sqlId === element.metadata?.id
- )
+ const isOpened = Object.values(tabs.tabsMap).some(
+ (tab) => tab.metadata?.sqlId === element.metadata?.id
+ )
const tabId = createTabId('sql', {
id: element?.metadata?.id as unknown as Snippet['id'],
})
- const isPreview = isSQLEditorTabsEnabled && tabs.previewTabId === tabId
+ const isPreview = tabs.previewTabId === tabId
const isActive = !isPreview && element.metadata?.id === id
const isSelected = selectedSnippets.some((x) => x.id === element.metadata?.id)
@@ -656,15 +651,13 @@ export const SQLEditorNav = ({ sort = 'inserted_at' }: SQLEditorNavProps) => {
data={favoritesTreeState}
aria-label="favorite-snippets"
nodeRenderer={({ element, ...props }) => {
- const isOpened =
- isSQLEditorTabsEnabled &&
- Object.values(tabs.tabsMap).some(
- (tab) => tab.metadata?.sqlId === element.metadata?.id
- )
+ const isOpened = Object.values(tabs.tabsMap).some(
+ (tab) => tab.metadata?.sqlId === element.metadata?.id
+ )
const tabId = createTabId('sql', {
id: element?.metadata?.id as unknown as Snippet['id'],
})
- const isPreview = isSQLEditorTabsEnabled && tabs.previewTabId === tabId
+ const isPreview = tabs.previewTabId === tabId
const isActive = !isPreview && element.metadata?.id === id
const isSelected = selectedSnippets.some((x) => x.id === element.metadata?.id)
@@ -746,15 +739,13 @@ export const SQLEditorNav = ({ sort = 'inserted_at' }: SQLEditorNavProps) => {
}}
expandedIds={expandedFolderIds}
nodeRenderer={({ element, ...props }) => {
- const isOpened =
- isSQLEditorTabsEnabled &&
- Object.values(tabs.tabsMap).some(
- (tab) => tab.metadata?.sqlId === element.metadata?.id
- )
+ const isOpened = Object.values(tabs.tabsMap).some(
+ (tab) => tab.metadata?.sqlId === element.metadata?.id
+ )
const tabId = createTabId('sql', {
id: element?.metadata?.id as unknown as Snippet['id'],
})
- const isPreview = isSQLEditorTabsEnabled && tabs.previewTabId === tabId
+ const isPreview = tabs.previewTabId === tabId
const isActive = !isPreview && element.metadata?.id === id
const isSelected = selectedSnippets.some((x) => x.id === element.metadata?.id)
diff --git a/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorTreeViewItem.tsx b/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorTreeViewItem.tsx
index 895eaee2bb292..3633fdf5b74f5 100644
--- a/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorTreeViewItem.tsx
+++ b/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorTreeViewItem.tsx
@@ -1,7 +1,6 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { IS_PLATFORM } from 'common'
import { useParams } from 'common/hooks/useParams'
-import { useIsSQLEditorTabsEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import { useSQLSnippetFolderContentsQuery } from 'data/content/sql-folder-contents-query'
import { Snippet } from 'data/content/sql-folders-query'
import { useCheckPermissions } from 'hooks/misc/useCheckPermissions'
@@ -83,7 +82,6 @@ export const SQLEditorTreeViewItem = ({
const { profile } = useProfile()
const { className, onClick } = getNodeProps()
const snapV2 = useSqlEditorV2StateSnapshot()
- const isSQLEditorTabsEnabled = useIsSQLEditorTabsEnabled()
const isOwner = profile?.id === element?.metadata.owner_id
const isSharedSnippet = element.metadata.visibility === 'project'
@@ -262,13 +260,12 @@ export const SQLEditorTreeViewItem = ({
{}}
onFocusCapture={(e) => e.stopPropagation()}
>
Open in new tab
diff --git a/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx b/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx
index d1e8269143b9c..62cea948bb687 100644
--- a/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx
+++ b/apps/studio/components/layouts/TableEditorLayout/EntityListItem.tsx
@@ -10,7 +10,6 @@ import {
MAX_EXPORT_ROW_COUNT_MESSAGE,
} from 'components/grid/components/header/Header'
import { parseSupaTable } from 'components/grid/SupabaseGrid.utils'
-import { useIsTableEditorTabsEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import {
formatTableRowsToSQL,
getEntityLintDetails,
@@ -70,11 +69,9 @@ const EntityListItem: ItemRenderer = ({
const snap = useTableEditorStateSnapshot()
const { selectedSchema } = useQuerySchemaState()
- // For tabs preview flag logic
- const isTableEditorTabsEnabled = useIsTableEditorTabsEnabled()
const tabId = createTabId(entity.type, { id: entity.id })
const tabs = useTabsStateSnapshot()
- const isPreview = isTableEditorTabsEnabled ? tabs.previewTabId === tabId : false
+ const isPreview = tabs.previewTabId === tabId
const isOpened = Object.values(tabs.tabsMap).some((tab) => tab.metadata?.tableId === entity.id)
const isActive = Number(id) === entity.id
diff --git a/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx b/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx
index a306730b11407..84bd7f4f689ac 100644
--- a/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx
+++ b/apps/studio/components/layouts/TableEditorLayout/TableEditorMenu.tsx
@@ -5,7 +5,6 @@ import { useEffect, useMemo, useState } from 'react'
import { useParams } from 'common'
import { useBreakpoint } from 'common/hooks/useBreakpoint'
-import { useIsTableEditorTabsEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import { ProtectedSchemaModal } from 'components/interfaces/Database/ProtectedSchemaWarning'
import EditorMenuListSkeleton from 'components/layouts/TableEditorLayout/EditorMenuListSkeleton'
import AlertError from 'components/ui/AlertError'
@@ -45,11 +44,10 @@ import EntityListItem from './EntityListItem'
import { TableMenuEmptyState } from './TableMenuEmptyState'
const TableEditorMenu = () => {
- const { ref, id: _id } = useParams()
+ const { id: _id } = useParams()
const id = _id ? Number(_id) : undefined
const snap = useTableEditorStateSnapshot()
const { selectedSchema, setSelectedSchema } = useQuerySchemaState()
- const isTableEditorTabsEnabled = useIsTableEditorTabsEnabled()
const isMobile = useBreakpoint()
const [showModal, setShowModal] = useState(false)
@@ -118,10 +116,10 @@ const TableEditorMenu = () => {
const tableEditorTabsCleanUp = useTableEditorTabsCleanUp()
useEffect(() => {
// Clean up tabs + recent items for any tables that might have been removed outside of the dashboard session
- if (isTableEditorTabsEnabled && entityTypes && !searchText) {
+ if (entityTypes && !searchText) {
tableEditorTabsCleanUp({ schemas: [selectedSchema], entities: entityTypes })
}
- }, [entityTypes, isTableEditorTabsEnabled, searchText, selectedSchema, tableEditorTabsCleanUp])
+ }, [entityTypes, searchText, selectedSchema, tableEditorTabsCleanUp])
return (
<>
diff --git a/apps/studio/components/layouts/Tabs/NewTab.tsx b/apps/studio/components/layouts/Tabs/NewTab.tsx
index ba199aab48051..8afcfe3bd4d4e 100644
--- a/apps/studio/components/layouts/Tabs/NewTab.tsx
+++ b/apps/studio/components/layouts/Tabs/NewTab.tsx
@@ -6,7 +6,6 @@ import { useRouter } from 'next/router'
import { toast } from 'sonner'
import { useParams } from 'common'
-import { TabsUpdateCallout } from 'components/interfaces/App/FeaturePreview/TableEditorTabs'
import { SQL_TEMPLATES } from 'components/interfaces/SQLEditor/SQLEditor.queries'
import { createSqlSnippetSkeletonV2 } from 'components/interfaces/SQLEditor/SQLEditor.utils'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
@@ -114,7 +113,6 @@ export function NewTab() {
return (
-
{actions.map((item, i) => (
diff --git a/apps/studio/components/layouts/Tabs/Tabs.tsx b/apps/studio/components/layouts/Tabs/Tabs.tsx
index 66fb4b9b71538..847a3c11d4545 100644
--- a/apps/studio/components/layouts/Tabs/Tabs.tsx
+++ b/apps/studio/components/layouts/Tabs/Tabs.tsx
@@ -12,7 +12,6 @@ import { Plus, X } from 'lucide-react'
import { useRouter } from 'next/router'
import { useParams } from 'common'
-import { TabsUpdateTooltip } from 'components/interfaces/App/FeaturePreview/TableEditorTabs'
import { useAppStateSnapshot } from 'state/app-state'
import { editorEntityTypes, useTabsStateSnapshot, type Tab } from 'state/tabs'
import {
@@ -173,43 +172,41 @@ export const EditorTabs = () => {
{/* Non-draggable new tab */}
{hasNewTab && (
- <>
-
+
+
+ New
+
+ {
+ e.preventDefault()
+ e.stopPropagation()
+ }}
+ className="ml-1 opacity-0 group-hover:opacity-100 hover:bg-200 rounded-sm cursor-pointer"
+ onMouseDown={(e) => {
+ e.preventDefault()
+ e.stopPropagation()
+ }}
+ onPointerDown={(e) => {
+ e.preventDefault()
+ e.stopPropagation()
+ handleClose('new')
+ }}
>
-
-
- New
-
- {
- e.preventDefault()
- e.stopPropagation()
- }}
- className="ml-1 opacity-0 group-hover:opacity-100 hover:bg-200 rounded-sm cursor-pointer"
- onMouseDown={(e) => {
- e.preventDefault()
- e.stopPropagation()
- }}
- onPointerDown={(e) => {
- e.preventDefault()
- e.stopPropagation()
- handleClose('new')
- }}
- >
-
- {' '}
-
-
- >
+
+ {' '}
+
+
)}
@@ -235,8 +232,6 @@ export const EditorTabs = () => {
-
-
diff --git a/apps/studio/components/layouts/editors/EditorBaseLayout.tsx b/apps/studio/components/layouts/editors/EditorBaseLayout.tsx
index eafb111c3b0b5..9f0da404d7fb4 100644
--- a/apps/studio/components/layouts/editors/EditorBaseLayout.tsx
+++ b/apps/studio/components/layouts/editors/EditorBaseLayout.tsx
@@ -2,10 +2,6 @@ import { usePathname } from 'next/navigation'
import { ComponentProps, ReactNode } from 'react'
import { useParams } from 'common'
-import {
- useIsSQLEditorTabsEnabled,
- useIsTableEditorTabsEnabled,
-} from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import { useTabsStateSnapshot } from 'state/tabs'
import { cn } from 'ui'
import { ProjectLayoutWithAuth } from '../ProjectLayout/ProjectLayout'
@@ -26,12 +22,6 @@ export const EditorBaseLayout = ({ children, title, product, ...props }: Explore
const editor = useEditorType()
const tabs = useTabsStateSnapshot()
- const isTableEditorTabsEnabled = useIsTableEditorTabsEnabled()
- const isSQLEditorTabsEnabled = useIsSQLEditorTabsEnabled()
-
- const tableEditorTabsEnabled = editor === 'table' && isTableEditorTabsEnabled
- const sqlEditorTabsEnabled = editor === 'sql' && isSQLEditorTabsEnabled
-
const hasNoOpenTabs =
editor === 'table' ? tabs.openTabs.filter((x) => !x.startsWith('sql')).length === 0 : false
const hideTabs =
@@ -40,16 +30,14 @@ export const EditorBaseLayout = ({ children, title, product, ...props }: Explore
return (
- {tableEditorTabsEnabled || sqlEditorTabsEnabled ? (
-
- {hideTabs ? : }
-
- ) : null}
+
+ {hideTabs ? : }
+
{children}
diff --git a/apps/studio/pages/_app.tsx b/apps/studio/pages/_app.tsx
index f8f95bfbb55a1..feb9b18b02643 100644
--- a/apps/studio/pages/_app.tsx
+++ b/apps/studio/pages/_app.tsx
@@ -109,6 +109,7 @@ function CustomApp({ Component, pageProps }: AppPropsWithLayout) {
Supabase
+
{/* [Alaister]: This has to be an inline style tag here and not a separate component due to next/font */}