Skip to content

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

feat: show new org page on first login for subset of users (#29188)

Long Hoangdb35ef9f3c52
diff --git a/apps/studio/lib/constants/index.ts b/apps/studio/lib/constants/index.ts
index f16e1270315..8dc44a4ef5e 100644
--- a/apps/studio/lib/constants/index.ts
+++ b/apps/studio/lib/constants/index.ts
@@ -36,6 +36,7 @@ export const LOCAL_STORAGE_KEYS = {
UI_PREVIEW_API_SIDE_PANEL: 'supabase-ui-api-side-panel',
UI_PREVIEW_RLS_AI_ASSISTANT: 'supabase-ui-rls-ai-assistant',
UI_PREVIEW_CLS: 'supabase-ui-cls',
+ UI_ONBOARDING_NEW_PAGE_SHOWN: 'supabase-ui-onboarding-new-page-shown',
DASHBOARD_HISTORY: (ref: string) => `dashboard-history-${ref}`,
diff --git a/apps/studio/pages/projects.tsx b/apps/studio/pages/projects.tsx
index 95d5e4bced8..2bce6eaec77 100644
--- a/apps/studio/pages/projects.tsx
+++ b/apps/studio/pages/projects.tsx
@@ -26,6 +26,7 @@ const ProjectsPage: NextPageWithLayout = () => {
const projectCreationEnabled = useIsFeatureEnabled('projects:create')
const navLayoutV2 = useFlag('navigationLayoutV2')
+ const orgCreationExperimentGroup = useFlag<string>('orgCreationExperimentGroup')
const hasWindowLoaded = typeof window !== 'undefined'
useEffect(() => {
@@ -39,6 +40,15 @@ const ProjectsPage: NextPageWithLayout = () => {
else if (localStorageSlug && verifiedSlug) router.push(`/org/${localStorageSlug}`)
else router.push(`/org/${organizations[0].slug}`)
}
+
+ if (orgCreationExperimentGroup === 'group-b' && !navLayoutV2 && isSuccess && hasWindowLoaded) {
+ // navigate to new page exactly once
+ const hasShownNewPage = localStorage.getItem(LOCAL_STORAGE_KEYS.UI_ONBOARDING_NEW_PAGE_SHOWN)
+ if (!hasShownNewPage && organizations.length === 0) {
+ localStorage.setItem(LOCAL_STORAGE_KEYS.UI_ONBOARDING_NEW_PAGE_SHOWN, 'true')
+ router.push('/new')
+ }
+ }
}, [navLayoutV2, isSuccess, hasWindowLoaded])
return (