mirror of
https://github.com/supabase/supabase.git
synced 2026-05-08 01:40:13 -04:00
edacf2413d
## Summary The `connectSection` A/B experiment concluded as a true null (no effect on activation or any downstream metric after 13 days at 50/50, ~153K mature orgs). Saxon decided to ship the Connect section as the permanent experience. This PR removes the Getting Started control variant, the old Connect modal, all experiment flag gating, and related telemetry types. ## Changes - Delete `GettingStarted/` directory (5 files: section component, types, utils, progress hook) - Delete old `Connect.tsx` dialog modal (replaced by ConnectSheet) - Remove `connectSection` PostHog flag reads from `Home.tsx` and `LayoutHeader.tsx` - Remove `getSectionVisibility()` experiment logic and `ConnectSectionVariant` type - Remove `getting-started` from `DEFAULT_SECTION_ORDER` - Always render `<ConnectSheet />` in header (no more conditional with old `<Connect />` modal) - Remove `variant` prop from `ConnectSection` component - Remove 4 getting-started telemetry event interfaces from `telemetry-constants.ts` - Update `mergeSectionOrder` tests to reflect new section order ## Testing Tested on Vercel preview: - [x] Project homepage shows Connect section for new projects (< 10 days old) - [x] Connect section hidden for mature projects (> 10 days old) - [x] Header Connect button opens ConnectSheet (not old modal) - [x] Connect tiles open ConnectSheet with correct tab - [x] Section drag-and-drop still works without getting-started in the order - [x] Existing users with `getting-started` in localStorage order don't break (mergeSectionOrder strips it) ## Linear - fixes GROWTH-730 --------- Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
27 lines
917 B
TypeScript
27 lines
917 B
TypeScript
export const DEFAULT_SECTION_ORDER = ['connect', 'usage', 'advisor', 'custom-report']
|
|
|
|
/**
|
|
* Reconciles a stored section order with the canonical list.
|
|
* Preserves user ordering for known sections, inserts missing
|
|
* sections at their default-relative position.
|
|
*/
|
|
export function mergeSectionOrder(stored: string[]): string[] {
|
|
const known = stored.filter((id) => DEFAULT_SECTION_ORDER.includes(id))
|
|
const missing = DEFAULT_SECTION_ORDER.filter((id) => !known.includes(id))
|
|
|
|
if (missing.length === 0 && known.length === stored.length) return stored
|
|
|
|
const merged = [...known]
|
|
for (const id of missing) {
|
|
const defaultIndex = DEFAULT_SECTION_ORDER.indexOf(id)
|
|
const nextKnown = DEFAULT_SECTION_ORDER.slice(defaultIndex + 1).find((c) => merged.includes(c))
|
|
|
|
if (!nextKnown) {
|
|
merged.push(id)
|
|
} else {
|
|
merged.splice(merged.indexOf(nextKnown), 0, id)
|
|
}
|
|
}
|
|
return merged
|
|
}
|