From d36acaf0ee6639b5e1cb366d18ade2be52d73ffb Mon Sep 17 00:00:00 2001 From: Jordi Enric Date: Fri, 26 Jun 2026 14:17:04 +0200 Subject: [PATCH] feat(studio): gate the SQL Editor Logs source behind otelLegacyLogs Keeps the new source consistent with the rest of the logs migration and out of everyone's editor until the flag is rolled out. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../studio/components/interfaces/SQLEditor/SQLEditor.tsx | 3 ++- .../interfaces/SQLEditor/UtilityPanel/UtilityActions.tsx | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx index b826c0c68ac..3aae77c19fe 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx +++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx @@ -125,7 +125,8 @@ export const SQLEditor = () => { const getImpersonatedRoleState = useGetImpersonatedRoleState() const databaseSelectorState = useDatabaseSelectorStateSnapshot() const logsTimeRange = useSqlEditorLogsStateSnapshot() - const queryingLogs = isLogsSource(databaseSelectorState.selectedDatabaseId) + const logsSourceEnabled = useFlag('otelLegacyLogs') + const queryingLogs = logsSourceEnabled && isLogsSource(databaseSelectorState.selectedDatabaseId) const { aiOptInLevel } = useOrgAiOptInLevel() const showPrettyExplain = useFlag('ShowPrettyExplain') diff --git a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityActions.tsx b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityActions.tsx index c7ee899b238..b8b1ee94802 100644 --- a/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityActions.tsx +++ b/apps/studio/components/interfaces/SQLEditor/UtilityPanel/UtilityActions.tsx @@ -1,5 +1,5 @@ import { Hotkey } from '@tanstack/react-hotkeys' -import { LOCAL_STORAGE_KEYS, useParams } from 'common' +import { LOCAL_STORAGE_KEYS, useFlag, useParams } from 'common' import { AlignLeft, Check, Heart, Keyboard, MoreVertical } from 'lucide-react' import { toast } from 'sonner' import { @@ -56,7 +56,8 @@ export const UtilityActions = ({ const snapV2 = useSqlEditorV2StateSnapshot() const databaseSelectorState = useDatabaseSelectorStateSnapshot() const logsTimeRange = useSqlEditorLogsStateSnapshot() - const queryingLogs = isLogsSource(databaseSelectorState.selectedDatabaseId) + const logsSourceEnabled = useFlag('otelLegacyLogs') + const queryingLogs = logsSourceEnabled && isLogsSource(databaseSelectorState.selectedDatabaseId) const [isAiOpen] = useLocalStorageQuery(LOCAL_STORAGE_KEYS.SQL_EDITOR_AI_OPEN, true) const [intellisenseEnabled, setIntellisenseEnabled] = useLocalStorageQuery( @@ -220,7 +221,9 @@ export const UtilityActions = ({ )}