Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Properly hook up browser tab label for explorer (#49240)

Joshen Lim5d851f12ec42
diff --git a/apps/studio/components/layouts/ExplorerLayout/ExplorerLayout.tsx b/apps/studio/components/layouts/ExplorerLayout/ExplorerLayout.tsx
index ce1fc5158f3..75ed7b5d2bb 100644
--- a/apps/studio/components/layouts/ExplorerLayout/ExplorerLayout.tsx
+++ b/apps/studio/components/layouts/ExplorerLayout/ExplorerLayout.tsx
@@ -37,9 +37,12 @@ export interface ExplorerLayoutProps extends ComponentProps<typeof ProjectLayout
export const ExplorerLayout = ({ browserTitle, children, title }: ExplorerLayoutProps) => {
const [section, setSection] = useState<ExplorerResourceType>()
+ const tabs = useTabsStateSnapshot()
- // [Joshen] Temporary, to hook up with tabs store
- const activeTabLabel = 'Active Tab Label'
+ const activeTab = tabs.activeTab ? tabs.tabsMap[tabs.activeTab] : undefined
+ const isActiveExplorerTab =
+ activeTab !== undefined && editorEntityTypes.explorer.includes(activeTab.type)
+ const activeTabLabel = isActiveExplorerTab ? activeTab.label || 'Untitled' : 'Explorer'
const mergedBrowserTitle = {
...browserTitle,