The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat(studio): add the pipeline creation wizard preview foundation (#51425)
Danny Whitecd00775dd7c4
diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsxindex 8ee334b54b1..58fd3f6d341 100644--- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx+++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewContext.tsx@@ -97,6 +97,18 @@ export const FeaturePreviewContextProvider = ({ children }: PropsWithChildren) =// Helpers+export const usePipelineCreationPreview = () => {+ const { flags, isInitialized } = useFeaturePreviewContext()+ const isAvailable = useFlag('pipelineCreationWizard')+ const isEnabled =+ IS_PLATFORM &&+ isInitialized &&+ isAvailable &&+ flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_PIPELINE_CREATION] === true++ return { isEnabled, isLoading: !isInitialized }+}+export const useIsColumnLevelPrivilegesEnabled = () => {const { flags } = useFeaturePreviewContext()return flags[LOCAL_STORAGE_KEYS.UI_PREVIEW_CLS]diff --git a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsxindex cd231b2deea..6543c2e0b26 100644--- a/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx+++ b/apps/studio/components/interfaces/App/FeaturePreview/FeaturePreviewModal.tsx@@ -36,6 +36,7 @@ import { useFeaturePreviewContext, useFeaturePreviewModal } from './FeaturePreviimport { IntegrationsLayoutPreview } from './IntegrationsLayoutPreview'import { JitDbAccessPreview } from './JitDbAccessPreview'import { PgDeltaDiffPreview } from './PgDeltaDiffPreview'+import { PipelineCreationPreview } from './PipelineCreationPreview'import { PlatformWebhooksPreview } from './PlatformWebhooksPreview'import { SqlEditorManualSavePreview } from './SqlEditorManualSavePreview'import { StorageVersioningPreview } from './StorageVersioningPreview'@@ -48,6 +49,7 @@ import { useTrack } from '@/lib/telemetry/track'const FEATURE_PREVIEW_KEY_TO_CONTENT: {[key: string]: ReactNode} = {+ [LOCAL_STORAGE_KEYS.UI_PREVIEW_PIPELINE_CREATION]: <PipelineCreationPreview />,[LOCAL_STORAGE_KEYS.UI_PREVIEW_PG_DELTA_DIFF]: <PgDeltaDiffPreview />,[LOCAL_STORAGE_KEYS.UI_PREVIEW_ADVISOR_RULES]: <AdvisorRulesPreview />,[LOCAL_STORAGE_KEYS.UI_PREVIEW_CLS]: <CLSPreview />,diff --git a/apps/studio/components/interfaces/App/FeaturePreview/PipelineCreationPreview.test.tsx b/apps/studio/components/interfaces/App/FeaturePreview/PipelineCreationPreview.test.tsxnew file mode 100644index 00000000000..bb008c5767a--- /dev/null+++ b/apps/studio/components/interfaces/App/FeaturePreview/PipelineCreationPreview.test.tsx@@ -0,0 +1,41 @@+import { renderHook, waitFor } from '@testing-library/react'+import { beforeEach, expect, test, vi } from 'vitest'++import { FeaturePreviewContextProvider, usePipelineCreationPreview } from './FeaturePreviewContext'++vi.mock('@/lib/constants', async (importOriginal) => ({+ ...(await importOriginal<typeof import('@/lib/constants')>()),+ IS_PLATFORM: true,+}))++const rollout = vi.hoisted(() => ({ enabled: false }))+vi.mock('common', async (importOriginal) => {+ const common = await importOriginal<typeof import('common')>()+ const { createContext } = await import('react')+ return {+ ...common,+ FeatureFlagContext: createContext({ hasLoaded: true }),+ LOCAL_STORAGE_KEYS: {+ ...common.LOCAL_STORAGE_KEYS,+ UI_PREVIEW_PIPELINE_CREATION: 'supabase-ui-pipeline-creation',+ },+ useFlag: (key: string) => key === 'pipelineCreationWizard' && rollout.enabled,+ }+})++beforeEach(() => localStorage.clear())++test.each([+ [false, false, false],+ [false, true, false],+ [true, false, false],+ [true, true, true],+])('rollout %s and opt-in %s enable the preview: %s', async (available, optedIn, expected) => {+ rollout.enabled = available+ localStorage.setItem('supabase-ui-pipeline-creation', String(optedIn))+ const { result } = renderHook(usePipelineCreationPreview, {+ wrapper: FeaturePreviewContextProvider,+ })+ await waitFor(() => expect(result.current.isLoading).toBe(false))+ expect(result.current.isEnabled).toBe(expected)+})diff --git a/apps/studio/components/interfaces/App/FeaturePreview/PipelineCreationPreview.tsx b/apps/studio/components/interfaces/App/FeaturePreview/PipelineCreationPreview.tsxnew file mode 100644index 00000000000..410c135784c--- /dev/null+++ b/apps/studio/components/interfaces/App/FeaturePreview/PipelineCreationPreview.tsx@@ -0,0 +1,9 @@+export const PipelineCreationPreview = () => (+ <div className="space-y-4 text-sm text-foreground-light">+ <p>Create pipelines in a redesigned flow spread across several full-viewport steps.</p>+ <p>+ Existing pipelines still open in the editing sheet. Turn this preview off to use the creation+ sheet again.+ </p>+ </div>+)diff --git a/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts b/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.tsindex 3f79e31bfb9..1d61b8ec268 100644--- a/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts+++ b/apps/studio/components/interfaces/App/FeaturePreview/useFeaturePreviews.ts@@ -32,6 +32,7 @@ export type FeaturePreview = {}export const useFeaturePreviews = (): FeaturePreview[] => {+ const isPipelineCreationWizardAvailable = useFlag('pipelineCreationWizard')const isPlatformWebhooksEnabled = useFlag('platformWebhooks')const jitDbAccessEnabled = useFlag('jitDbAccess')const isMarketplaceEnabled = useFlag('marketplaceIntegrations')@@ -42,6 +43,15 @@ export const useFeaturePreviews = (): FeaturePreview[] => {return useMemo(() => {const previews: FeaturePreview[] = [+ {+ key: LOCAL_STORAGE_KEYS.UI_PREVIEW_PIPELINE_CREATION,+ name: 'Pipeline creation wizard',+ category: 'database',+ enabled: isPipelineCreationWizardAvailable,+ isNew: true,+ isPlatformOnly: true,+ isDefaultOptIn: false,+ },{key: LOCAL_STORAGE_KEYS.UI_PREVIEW_EXPLORER,name: 'Explorer & Notebooks',@@ -59,7 +69,7 @@ export const useFeaturePreviews = (): FeaturePreview[] => {category: 'observability',discussionsUrl: 'https://github.com/orgs/supabase/discussions/37234',enabled: true,- isNew: true,+ isNew: false,isPlatformOnly: true,isDefaultOptIn: true,getRoute: (ref?: string) => `/project/${ref}/logs`,@@ -76,7 +86,7 @@ export const useFeaturePreviews = (): FeaturePreview[] => {},{key: LOCAL_STORAGE_KEYS.UI_PREVIEW_PG_DELTA_DIFF,- name: 'PG Delta Diff',+ name: 'PG Delta diff',discussionsUrl: undefined,isNew: false,isPlatformOnly: true,@@ -117,10 +127,10 @@ export const useFeaturePreviews = (): FeaturePreview[] => {},{key: LOCAL_STORAGE_KEYS.UI_PREVIEW_MARKETPLACE,- name: 'One-Click Integrations',+ name: 'One-click Integrations',discussionsUrl: undefined,enabled: isMarketplaceEnabled,- isNew: true,+ isNew: false,isPlatformOnly: false,isDefaultOptIn: true,getRoute: (ref?: string) => `/project/${ref}/integrations`,@@ -130,7 +140,7 @@ export const useFeaturePreviews = (): FeaturePreview[] => {category: 'editors',name: 'Disable snippet auto-saving',discussionsUrl: undefined,- isNew: true,+ isNew: false,isPlatformOnly: true,isDefaultOptIn: false,enabled: true,@@ -153,6 +163,7 @@ export const useFeaturePreviews = (): FeaturePreview[] => {return previews.sort((a, b) => Number(b.isNew) - Number(a.isNew))}, [+ isPipelineCreationWizardAvailable,isSqlEditorManualSaveForced,isPlatformWebhooksEnabled,jitDbAccessEnabled,diff --git a/packages/common/constants/local-storage.ts b/packages/common/constants/local-storage.tsindex ba04a924d93..18f1e93c51b 100644--- a/packages/common/constants/local-storage.ts+++ b/packages/common/constants/local-storage.ts@@ -32,6 +32,7 @@ export const LOCAL_STORAGE_KEYS = {UI_PREVIEW_SQL_EDITOR_MANUAL_SAVE: 'supabase-ui-sql-editor-manual-save',UI_PREVIEW_MARKETPLACE: 'supabase-ui-marketplace',UI_PREVIEW_EXPLORER: 'preview-explorer',+ UI_PREVIEW_PIPELINE_CREATION: 'supabase-ui-pipeline-creation',UI_PREVIEW_STORAGE_VERSIONING: 'supabase-ui-storage-versioning',AI_ASSISTANT_MCP_OPT_IN: 'ai-assistant-mcp-opt-in',@@ -168,6 +169,7 @@ const LOCAL_STORAGE_KEYS_ALLOWLIST = [LOCAL_STORAGE_KEYS.UI_PREVIEW_SQL_EDITOR_MANUAL_SAVE,LOCAL_STORAGE_KEYS.SQL_EDITOR_MANUAL_SAVE_NOTICE_DISMISSED,LOCAL_STORAGE_KEYS.UI_PREVIEW_MARKETPLACE,+ LOCAL_STORAGE_KEYS.UI_PREVIEW_PIPELINE_CREATION,LOCAL_STORAGE_KEYS.UI_PREVIEW_STORAGE_VERSIONING,LOCAL_STORAGE_KEYS.LAST_SIGN_IN_METHOD,LOCAL_STORAGE_KEYS.HIDE_PROMO_TOAST,