diff --git a/apps/studio/components/layouts/SQLEditorLayout/sql-editor-menu-static-links.tsx b/apps/studio/components/layouts/SQLEditorLayout/sql-editor-menu-static-links.tsx
index 9a576682a0a..7991bc43b85 100644
--- a/apps/studio/components/layouts/SQLEditorLayout/sql-editor-menu-static-links.tsx
+++ b/apps/studio/components/layouts/SQLEditorLayout/sql-editor-menu-static-links.tsx
@@ -22,11 +22,12 @@ export function SqlEditorMenuStaticLinks() {
return (
{OPTIONS.map((pageId) => {
+ const pageActive = isPageActive(pageId)
const isPreview = isSqlEditorTabsEnabled ? tabs.previewTabId === `sql-${pageId}` : false
- const isOpen = tabs.openTabs.includes(`sql-${pageId}`)
- const isActive = !isSqlEditorTabsEnabled
+ const isOpen = !isSqlEditorTabsEnabled
? isPageActive(pageId)
: Object.values(tabs.tabsMap).some((tab) => tab?.id === `sql-${pageId}`)
+ const isActive = tabs.openTabs.includes(`sql-${pageId}`) && pageActive
return (