Skip to content

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

fix(studio): preserve pipeline wizard loading context and guidance (#52053)

Danny Whiteb7638a72447b
diff --git a/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow.constants.ts b/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow.constants.ts
new file mode 100644
index 00000000000..5e7f1293eee
--- /dev/null
+++ b/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow.constants.ts
@@ -0,0 +1,29 @@
+import type { FlowDestination } from '../DestinationPanel/DestinationPanel.types'
+
+export const PIPELINE_CREATION_STEPS = [
+ {
+ id: 'destination',
+ label: 'Destination',
+ title: 'Choose a destination',
+ description: () => 'Where should this database be replicated?',
+ },
+ {
+ id: 'connection',
+ label: 'Connection',
+ title: 'Authorize the destination',
+ description: (destination: FlowDestination) =>
+ `Name this pipeline and enter credentials for ${destination}.`,
+ },
+ {
+ id: 'data',
+ label: 'Data',
+ title: 'Choose what to replicate',
+ description: () => 'Select a publication and which existing rows to copy during initial sync.',
+ },
+ {
+ id: 'review',
+ label: 'Review',
+ title: 'Review and create',
+ description: () => 'Check these details, then start the pipeline.',
+ },
+] satisfies [unknown, ...unknown[]]
diff --git a/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow.test.tsx b/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow.test.tsx
index 341e69668ff..6a5077530d0 100644
--- a/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow.test.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow.test.tsx
@@ -3,12 +3,14 @@ import { act, fireEvent, screen, waitFor, within } from '@testing-library/react'
import type { components } from 'api-types'
import { mockAnimationsApi } from 'jsdom-testing-mocks'
import { delay, HttpResponse } from 'msw'
+import router from 'next-router-mock'
import { NuqsAdapter } from 'nuqs/adapters/react'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { PipelineCreationFlow as CreationFlow } from './PipelineCreationFlow'
import type { ReplicationCostEstimateData } from '@/data/replication/cost-estimate-query'
import { replicationKeys } from '@/data/replication/keys'
+import { DOCS_URL } from '@/lib/constants'
import { PipelineRequestStatusProvider } from '@/state/replication-pipeline-request-status'
import { customRender } from '@/tests/lib/custom-render'
import { addAPIMock } from '@/tests/lib/msw'
@@ -137,6 +139,80 @@ const selectPublication = async () => {
const back = () => fireEvent.click(within(stepCard()).getByRole('button', { name: 'Back' }))
describe('PipelineCreationFlow', () => {
+ it('keeps header navigation pending until dirty changes are discarded', async () => {
+ const push = vi.spyOn(router, 'push')
+ customRender(
+ <PipelineCreationFlow availableDestinations={['BigQuery', 'Snowflake']} onClose={vi.fn()} />
+ )
+ fireEvent.click(destinationType().getByRole('radio', { name: /Snowflake/ }))
+ fireEvent.click(screen.getByRole('link', { name: 'Supabase home' }))
+ expect(await screen.findByRole('alertdialog')).toBeInTheDocument()
+ expect(push).not.toHaveBeenCalled()
+
+ fireEvent.click(screen.getByRole('button', { name: 'Keep editing' }))
+ expect(push).not.toHaveBeenCalled()
+ fireEvent.click(screen.getByRole('link', { name: 'Supabase home' }))
+ const discard = await screen.findByRole('button', { name: 'Discard changes' })
+ fireEvent.click(discard)
+
+ await waitFor(() =>
+ expect(push).toHaveBeenCalledWith(`${window.location.origin}/organizations`)
+ )
+ push.mockRestore()
+ })
+
+ it.each([
+ ['BigQuery', 'bigquery#configure-bigquery-as-a-destination'],
+ ['DuckLake', 'ducklake#choose-a-configuration-mode'],
+ ['Snowflake', 'snowflake#prepare-snowflake-resources'],
+ ['ClickHouse', 'clickhouse#configure-clickhouse-as-a-destination'],
+ ] as const)('matches the connection subtitle and Docs to %s', (type, path) => {
+ addAPIMock({
+ method: 'get',
+ path: '/platform/projects/:ref',
+ response: () =>
+ HttpResponse.json<components['schemas']['ProjectDetailResponse_Output']>({
+ id: 1,
+ ref: 'default',
+ name: 'Test project',
+ organization_id: 1,
+ status: 'ACTIVE_HEALTHY',
+ cloud_provider: 'AWS',
+ region: 'us-east-1',
+ db_host: 'db.default.supabase.co',
+ restUrl: 'https://default.supabase.co/rest/v1/',
+ connectionString: null,
+ inserted_at: '2026-01-01T00:00:00Z',
+ updated_at: '2026-01-01T00:00:00Z',
+ subscription_id: 'subscription',
+ is_branch_enabled: false,
+ is_physical_backups_enabled: false,
+ high_availability: false,
+ integration_source: null,
+ }),
+ })
+ customRender(
+ <PipelineCreationFlow
+ availableDestinations={['BigQuery', 'DuckLake', 'Snowflake', 'ClickHouse']}
+ onClose={vi.fn()}
+ />,
+ { nuqs: { hasMemory: true } }
+ )
+ expect(screen.getByText('Where should this database be replicated?')).toBeInTheDocument()
+ expect(screen.queryByRole('link', { name: 'Docs' })).not.toBeInTheDocument()
+ fireEvent.click(destinationType().getByRole('radio', { name: new RegExp(type) }))
+ next()
+ expect(
+ screen.getByText(`Name this pipeline and enter credentials for ${type}.`)
+ ).toBeInTheDocument()
+ expect(screen.getByRole('link', { name: 'Docs' })).toHaveAttribute(
+ 'href',
+ `${DOCS_URL}/guides/database/replication/pipelines/${path}`
+ )
+ back()
+ expect(screen.queryByRole('link', { name: 'Docs' })).not.toBeInTheDocument()
+ })
+
const reachReview = async (
onClose = vi.fn(),
onUrlUpdate = vi.fn(),
@@ -353,12 +429,21 @@ describe('PipelineCreationFlow', () => {
)
)
await reachReview(vi.fn(), onUrlUpdate)
+ expect(screen.getByText('Check these details, then start the pipeline.')).toBeInTheDocument()
+ expect(screen.queryByRole('link', { name: 'Docs' })).not.toBeInTheDocument()
await waitForReview()
fireEvent.click(screen.getByRole('button', { name: 'Edit connection' }))
await screen.findByText(/Step 2 of 4/)
expect(screen.getByRole('textbox', { name: 'Pipeline name' })).toHaveValue('Warehouse')
next()
await screen.findByText(/Step 3 of 4/)
+ expect(
+ screen.getByText('Select a publication and which existing rows to copy during initial sync.')
+ ).toBeInTheDocument()
+ expect(screen.getByRole('link', { name: 'Docs' })).toHaveAttribute(
+ 'href',
+ `${DOCS_URL}/guides/database/replication/pipelines#choosing-which-tables-to-copy`
+ )
next()
await waitForReview()
fireEvent.click(screen.getByRole('button', { name: 'Edit data' }))
diff --git a/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow.tsx b/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow.tsx
index 4075e6422b0..5c0f399606d 100644
--- a/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow.tsx
@@ -1,4 +1,5 @@
import { useParams } from 'common'
+import { useRouter } from 'next/router'
import { parseAsStringEnum, useQueryState } from 'nuqs'
import { useEffect, useRef, useState } from 'react'
import { useForm } from 'react-hook-form'
@@ -13,7 +14,10 @@ import { generateDefaultValues } from '../DestinationPanel/DestinationForm/Desti
import { DuckLakeFields } from '../DestinationPanel/DestinationForm/DuckLake/Fields'
import { NewPublicationPanel } from '../DestinationPanel/DestinationForm/NewPublicationPanel'
import { SnowflakeFields } from '../DestinationPanel/DestinationForm/Snowflake/Fields'
+import { DESTINATION_DOCS_PATHS } from '../DestinationPanel/DestinationPanel.constants'
+import type { FlowDestination } from '../DestinationPanel/DestinationPanel.types'
import { PipelineConnectionSection } from './PipelineConnectionSection'
+import { PIPELINE_CREATION_STEPS as steps } from './PipelineCreationFlow.constants'
import { PipelineCreationHeader } from './PipelineCreationHeader'
import { PipelineDataReview } from './PipelineDataReview'
import { PipelineDataSection } from './PipelineDataSection'
@@ -30,16 +34,17 @@ import { usePipelineDataValidation } from './usePipelineDataValidation'
import { usePipelineNavigationGuard } from './usePipelineNavigationGuard'
import { usePipelineReviewCosts } from './usePipelineReviewCosts'
import { DiscardChangesConfirmationDialog } from '@/components/ui-patterns/Dialogs/DiscardChangesConfirmationDialog'
+import { DocsButton } from '@/components/ui/DocsButton'
import { SteppedFlow, SteppedFlowHeader } from '@/components/ui/SteppedFlow/SteppedFlow'
import { useReplicationSourceId } from '@/data/replication/sources-query'
+import { DOCS_URL } from '@/lib/constants'
-type FlowDestination = 'BigQuery' | 'DuckLake' | 'Snowflake' | 'ClickHouse'
-const steps = [
- { id: 'destination', label: 'Destination', title: 'Choose a destination' },
- { id: 'connection', label: 'Connection', title: 'Authorize the destination' },
- { id: 'data', label: 'Data', title: 'Choose what to replicate' },
- { id: 'review', label: 'Review', title: 'Review and create' },
-]
+const getDocsUrl = (step: string, destination: FlowDestination) => {
+ if (step === 'connection') return `${DOCS_URL}${DESTINATION_DOCS_PATHS[destination]}`
+ if (step === 'data')
+ return `${DOCS_URL}/guides/database/replication/pipelines#choosing-which-tables-to-copy`
+ return undefined
+}
const stepParser = parseAsStringEnum(steps.map(({ id }) => id))
.withDefault('destination')
@@ -52,6 +57,7 @@ export const PipelineCreationFlow = ({
availableDestinations: FlowDestination[]
onClose: () => void
}) => {
+ const router = useRouter()
const [step, setStep] = useQueryState('step', stepParser)
const hasInitializedStepRef = useRef(false)
@@ -125,6 +131,7 @@ export const PipelineCreationFlow = ({
if (next) void setStep(next.id)
}
const currentStep = steps.find((item) => item.id === accessibleStep) ?? steps[0]
+ const docsUrl = getDocsUrl(accessibleStep, type)
const canSelectDestination = availableDestinations.includes(type)
useEffect(() => {
@@ -141,7 +148,7 @@ export const PipelineCreationFlow = ({
<PipelineCreationHeader
onClose={handleClose}
onNavigate={(href) => {
- if (!isSubmitting) requestNavigation(() => window.location.assign(href))
+ if (!isSubmitting) requestNavigation(() => void router.push(href))
}}
/>
<main className="flex-1">
@@ -164,7 +171,11 @@ export const PipelineCreationFlow = ({
disabled: costs.isInitialCostEstimateLoading,
}}
>
- <SteppedFlowHeader title={currentStep.title} />
+ <SteppedFlowHeader
+ title={currentStep.title}
+ description={currentStep.description(type)}
+ actions={docsUrl && <DocsButton href={docsUrl} />}
+ />
{accessibleStep === 'destination' && (
<div className="p-5">
<PipelineDestinationSelection
diff --git a/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationPage.test.tsx b/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationPage.test.tsx
index 5e881ccb1b8..abaee60d7ae 100644
--- a/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationPage.test.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationPage.test.tsx
@@ -1,7 +1,7 @@
import { QueryClient } from '@tanstack/react-query'
import { fireEvent, screen } from '@testing-library/react'
import type { components } from 'api-types'
-import { HttpResponse } from 'msw'
+import { delay, HttpResponse } from 'msw'
import { beforeEach, expect, it, vi } from 'vitest'
import { replicationKeys } from '@/data/replication/keys'
@@ -12,6 +12,7 @@ import { addAPIMock, type APIErrorBody } from '@/tests/lib/msw'
const state = vi.hoisted(() => ({
hasProjectRef: true,
push: vi.fn(),
+ replace: vi.fn(),
enabled: false,
loading: false,
flagsLoaded: true,
@@ -21,7 +22,11 @@ const state = vi.hoisted(() => ({
}))
vi.mock('next/router', async (importOriginal) => ({
...(await importOriginal<typeof import('next/router')>()),
- useRouter: () => ({ push: state.push, events: { on: vi.fn(), off: vi.fn() } }),
+ useRouter: () => ({
+ push: state.push,
+ replace: state.replace,
+ events: { on: vi.fn(), off: vi.fn() },
+ }),
}))
vi.mock('common', async (importOriginal) => ({
...(await importOriginal<typeof import('common')>()),
@@ -47,6 +52,18 @@ vi.mock('@/components/interfaces/Database/Replication/useIsETLPrivateAlpha', ()
useIsETLSnowflakePrivateAlpha: () => false,
useIsETLClickHousePrivateAlpha: () => false,
}))
+vi.mock('@/components/layouts/Navigation/LayoutHeader/HomeIcon', () => ({
+ HomeIcon: () => <a href="/dashboard/projects">Supabase home</a>,
+}))
+vi.mock('@/components/layouts/AppLayout/OrganizationDropdown', () => ({
+ OrganizationDropdown: () => <span>Organization</span>,
+}))
+vi.mock('@/components/layouts/Navigation/NavigationBar/OrgSelector', () => ({
+ OrgSelector: () => <span>Organization</span>,
+}))
+vi.mock('@/components/layouts/AppLayout/ProjectDropdown', () => ({
+ ProjectDropdown: () => <span>Project</span>,
+}))
vi.mock('./PipelineCreationFlow', () => ({
PipelineCreationFlow: ({ onClose }: { onClose: () => void }) => (
<button tabIndex={0} onClick={onClose}>
@@ -62,6 +79,8 @@ const mockSources = (sources: components['schemas']['SourcesResponse_Output']['s
response: () => HttpResponse.json<components['schemas']['SourcesResponse_Output']>({ sources }),
})
beforeEach(() => {
+ state.push.mockClear()
+ state.replace.mockClear()
mockSources([
{
id: 42,
@@ -118,7 +137,12 @@ it('falls back when the preview is off even if organisation and project queries
state.orgPending = true
state.flagsLoaded = false
customRender(<PipelineCreationPage />)
- expect(screen.getByRole('status')).toHaveTextContent('Returning to Pipelines')
+ expect(screen.getByRole('status', { name: 'Pipeline creation status' })).toHaveTextContent(
+ 'Opening Pipelines…'
+ )
+ expect(state.replace).toHaveBeenCalledWith(
+ '/project/default/database/pipelines?destinationType=BigQuery'
+ )
})
it('returns through the shared router without reloading the toast host', async () => {
@@ -142,8 +166,9 @@ it.each(['disabled', 'error'])(
),
})
customRender(<PipelineCreationPage />)
- expect(await screen.findByRole('status')).toHaveTextContent('Returning to Pipelines')
+ expect(await screen.findByText('Returning to Pipelines…')).toBeInTheDocument()
expect(screen.queryByText('Wizard form')).not.toBeInTheDocument()
+ expect(state.replace).toHaveBeenCalledWith('/project/default/database/pipelines')
}
)
@@ -151,8 +176,9 @@ it.each([false, true])('waits for the project reference (preview: %s)', (enabled
state.enabled = enabled
state.hasProjectRef = false
customRender(<PipelineCreationPage />)
- expect(screen.queryByRole('status')).not.toBeInTheDocument()
+ expect(screen.queryByText('Returning to Pipelines…')).not.toBeInTheDocument()
expect(screen.queryByText('Wizard form')).not.toBeInTheDocument()
+ expect(state.replace).not.toHaveBeenCalled()
})
it('rechecks cached enablement before allowing direct entry', async () => {
const queryClient = new QueryClient()
@@ -173,8 +199,91 @@ it('rechecks cached enablement before allowing direct entry', async () => {
})
customRender(<PipelineCreationPage />, { queryClient })
expect(screen.queryByText('Wizard form')).not.toBeInTheDocument()
- expect(screen.queryByRole('status')).not.toBeInTheDocument()
+ expect(screen.queryByText('Returning to Pipelines…')).not.toBeInTheDocument()
finish?.()
- expect(await screen.findByRole('status')).toHaveTextContent('Returning to Pipelines')
+ expect(await screen.findByText('Returning to Pipelines…')).toBeInTheDocument()
+ expect(screen.getByRole('navigation', { name: 'Pipeline creation' })).toBeInTheDocument()
+ expect(screen.queryByText('Wizard form')).not.toBeInTheDocument()
+})
+
+it('keeps the header and disabled destination step visible while preview access loads', () => {
+ state.loading = true
+ customRender(<PipelineCreationPage />)
+ expect(screen.getByRole('navigation', { name: 'Pipeline creation' })).toBeInTheDocument()
+ expect(screen.getByRole('heading', { name: 'Choose a destination' })).toBeInTheDocument()
+ expect(screen.getByRole('button', { name: 'Continue' })).toBeDisabled()
+ expect(screen.getByRole('button', { name: 'Cancel' })).toBeDisabled()
+ fireEvent.click(screen.getByRole('button', { name: 'Close' }))
+ expect(state.push).toHaveBeenCalledWith('/project/default/database/pipelines')
+})
+
+it('uses the shared router for loading header links with their existing base path', () => {
+ state.loading = true
+ customRender(<PipelineCreationPage />)
+ const home = screen.getByRole('link', { name: 'Supabase home' })
+
+ fireEvent.click(home)
+
+ expect(state.push).toHaveBeenCalledWith(`${window.location.origin}/dashboard/projects`)
+ expect(state.replace).not.toHaveBeenCalled()
+})
+
+it('keeps the header visible while source enablement loads', async () => {
+ addAPIMock({
+ method: 'get',
+ path: '/platform/replication/:ref/sources',
+ response: async () => {
+ await delay('infinite')
+ return HttpResponse.json<components['schemas']['SourcesResponse_Output']>({ sources: [] })
+ },
+ })
+ customRender(<PipelineCreationPage />)
+ expect(await screen.findByRole('navigation', { name: 'Pipeline creation' })).toBeInTheDocument()
+ expect(screen.getByRole('heading', { name: 'Choose a destination' })).toBeInTheDocument()
expect(screen.queryByText('Wizard form')).not.toBeInTheDocument()
})
+
+it('keeps the same live status when loading finishes and the wizard is ready', async () => {
+ state.loading = true
+ const { rerender } = customRender(<PipelineCreationPage />)
+ const status = screen.getByRole('status', { name: 'Pipeline creation status' })
+ expect(status).toHaveTextContent('Loading pipeline creation…')
+
+ state.loading = false
+ rerender(<PipelineCreationPage />)
+
+ expect(await screen.findByText('Wizard form')).toBeInTheDocument()
+ expect(screen.getByRole('status', { name: 'Pipeline creation status' })).toBe(status)
+ expect(status).toHaveTextContent('Pipeline creation ready')
+})
+
+it('keeps the same live status when loading finishes with a redirect', () => {
+ state.loading = true
+ const { rerender } = customRender(<PipelineCreationPage />)
+ const status = screen.getByRole('status', { name: 'Pipeline creation status' })
+ expect(status).toHaveTextContent('Loading pipeline creation…')
+
+ state.loading = false
+ state.enabled = false
+ rerender(<PipelineCreationPage />)
+
+ expect(screen.getByRole('status', { name: 'Pipeline creation status' })).toBe(status)
+ expect(status).toHaveTextContent('Opening Pipelines…')
+})
+
+it('only navigates on Close once the project reference is available', () => {
+ state.hasProjectRef = false
+ state.loading = true
+ const { rerender } = customRender(<PipelineCreationPage />)
+ const close = screen.getByRole('button', { name: 'Close' })
+ expect(close).toBeEnabled()
+ fireEvent.click(close)
+ expect(state.push).not.toHaveBeenCalled()
+
+ state.hasProjectRef = true
+ rerender(<PipelineCreationPage />)
+
+ expect(close).toBeEnabled()
+ fireEvent.click(close)
+ expect(state.push).toHaveBeenCalledWith('/project/default/database/pipelines')
+})
diff --git a/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationSkeleton.tsx b/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationSkeleton.tsx
new file mode 100644
index 00000000000..39b05988b47
--- /dev/null
+++ b/apps/studio/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationSkeleton.tsx
@@ -0,0 +1,42 @@
+import { RadioGroupStacked, RadioGroupStackedItem, Skeleton } from 'ui'
+
+import { PIPELINE_CREATION_STEPS } from './PipelineCreationFlow.constants'
+import { SteppedFlow, SteppedFlowHeader } from '@/components/ui/SteppedFlow/SteppedFlow'
+
+export const PipelineCreationSkeleton = () => {
+ const initialStep = PIPELINE_CREATION_STEPS[0]
+
+ return (
+ <SteppedFlow
+ steps={PIPELINE_CREATION_STEPS}
+ currentStep={initialStep.id}
+ onStepChange={() => {}}
+ onCancel={() => {}}
+ nextLabel="Continue"
+ navigationDisabled
+ >
+ <SteppedFlowHeader title={initialStep.title} description={initialStep.description()} />
+ <div className="space-y-3 p-5" aria-busy="true" aria-label="Loading destinations">
+ <p className="text-sm font-medium text-foreground">Destination type</p>
+ <RadioGroupStacked disabled aria-hidden="true" className="pointer-events-none">
+ {[0, 1, 2, 3].map((index) => (
+ <RadioGroupStackedItem
+ key={index}
+ value={String(index)}
+ className="opacity-100! [&>div]:items-center [&>div]:py-3.5"
+ label={
+ <span className="flex items-center gap-x-3.5">
+ <Skeleton className="h-8 w-8 rounded-md" />
+ <span className="flex flex-col gap-2">
+ <Skeleton className="h-4 w-24" />
+ <Skeleton className="h-4 w-40 sm:w-72" />
+ </span>
+ </span>
+ }
+ />
+ ))}
+ </RadioGroupStacked>
+ </div>
+ </SteppedFlow>
+ )
+}
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.constants.ts b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.constants.ts
new file mode 100644
index 00000000000..5d6251085b4
--- /dev/null
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.constants.ts
@@ -0,0 +1,9 @@
+import type { FlowDestination } from './DestinationPanel.types'
+
+export const DESTINATION_DOCS_PATHS: Record<FlowDestination, string> = {
+ BigQuery: '/guides/database/replication/pipelines/bigquery#configure-bigquery-as-a-destination',
+ ClickHouse:
+ '/guides/database/replication/pipelines/clickhouse#configure-clickhouse-as-a-destination',
+ DuckLake: '/guides/database/replication/pipelines/ducklake#choose-a-configuration-mode',
+ Snowflake: '/guides/database/replication/pipelines/snowflake#prepare-snowflake-resources',
+}
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
index 525141fc622..f364d972f95 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
@@ -22,6 +22,7 @@ import { PipelineStatusName } from '../Replication.constants'
import { useDestinationInformation } from '../useDestinationInformation'
import { useIsETLPrivateAlpha } from '../useIsETLPrivateAlpha'
import { DestinationForm } from './DestinationForm'
+import { DESTINATION_DOCS_PATHS } from './DestinationPanel.constants'
import { DestinationType } from './DestinationPanel.types'
import { DestinationTypeSelection } from './DestinationTypeSelection'
import { DiscardChangesConfirmationDialog } from '@/components/ui-patterns/Dialogs/DiscardChangesConfirmationDialog'
@@ -32,14 +33,6 @@ import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganizati
import { useConfirmOnClose } from '@/hooks/ui/useConfirmOnClose'
import { DOCS_URL, IS_PLATFORM } from '@/lib/constants'
-const DESTINATION_DOCS_PATHS: Partial<Record<DestinationType, string>> = {
- BigQuery: '/guides/database/replication/pipelines/bigquery#configure-bigquery-as-a-destination',
- ClickHouse:
- '/guides/database/replication/pipelines/clickhouse#configure-clickhouse-as-a-destination',
- DuckLake: '/guides/database/replication/pipelines/ducklake#choose-a-configuration-mode',
- Snowflake: '/guides/database/replication/pipelines/snowflake#prepare-snowflake-resources',
-}
-
export const DestinationPanel = () => {
const { ref: projectRef } = useParams()
const { hasLoaded: flagsLoaded } = useFeatureFlags()
@@ -112,9 +105,12 @@ export const DestinationPanel = () => {
onClose,
})
+ const destinationDocsPath =
+ destinationType && destinationType !== 'Analytics Bucket'
+ ? DESTINATION_DOCS_PATHS[destinationType]
+ : undefined
const docsUrl = `${DOCS_URL}${
- (destinationType && DESTINATION_DOCS_PATHS[destinationType]) ??
- '/guides/database/replication/pipelines#step-3-configure-a-destination'
+ destinationDocsPath ?? '/guides/database/replication/pipelines#step-3-configure-a-destination'
}`
useEffect(() => {
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.types.ts b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.types.ts
index 6f29ffd1ded..77dd44796a1 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.types.ts
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.types.ts
@@ -5,6 +5,8 @@ export type DestinationType =
| 'Snowflake'
| 'ClickHouse'
+export type FlowDestination = Exclude<DestinationType, 'Analytics Bucket'>
+
export type ExistingDestination = {
sourceId?: number
destinationId: number
diff --git a/apps/studio/components/ui/SteppedFlow/SteppedFlow.tsx b/apps/studio/components/ui/SteppedFlow/SteppedFlow.tsx
index a5d795bebe0..6d6cf885c4d 100644
--- a/apps/studio/components/ui/SteppedFlow/SteppedFlow.tsx
+++ b/apps/studio/components/ui/SteppedFlow/SteppedFlow.tsx
@@ -106,7 +106,9 @@ export const SteppedFlow = ({
</p>
<Card
key={currentStep}
- className="animate-in fade-in-0 duration-200 motion-reduce:animate-none"
+ className={cn(
+ currentIndex > 0 && 'animate-in fade-in-0 duration-200 motion-reduce:animate-none'
+ )}
>
{children}
<CardFooter
diff --git a/apps/studio/pages/project/[ref]/database/pipelines/new.tsx b/apps/studio/pages/project/[ref]/database/pipelines/new.tsx
index 7137492e358..7543be74cec 100644
--- a/apps/studio/pages/project/[ref]/database/pipelines/new.tsx
+++ b/apps/studio/pages/project/[ref]/database/pipelines/new.tsx
@@ -2,10 +2,11 @@ import { useFeatureFlags, useParams } from 'common'
import Head from 'next/head'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
-import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
import { usePipelineCreationPreview } from '@/components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import { PipelineCreationFlow } from '@/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationFlow'
+import { PipelineCreationHeader } from '@/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationHeader'
+import { PipelineCreationSkeleton } from '@/components/interfaces/Database/Replication/CreatePipeline/PipelineCreationSkeleton'
import {
useIsETLBigQueryPrivateAlpha,
useIsETLClickHousePrivateAlpha,
@@ -17,7 +18,6 @@ import { useHighAvailability } from '@/hooks/misc/useHighAvailability'
import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
import { withAuth } from '@/hooks/misc/withAuth'
-import { BASE_PATH } from '@/lib/constants'
import { PipelineRequestStatusProvider } from '@/state/replication-pipeline-request-status'
import type { NextPageWithLayout } from '@/types'
@@ -41,21 +41,55 @@ const PipelineCreationPage: NextPageWithLayout<Record<string, never>> = () => {
{ enabled: !isProjectAccessLoading && canAccessFlow, refetchOnMount: 'always' }
)
const hasSource = sources.data?.sources.some((source) => source.name === ref) === true
- const listHref = `${BASE_PATH}/project/${ref}/database/pipelines`
+ const listHref = `/project/${ref}/database/pipelines`
const isAccessLoading =
!ref || isProjectAccessLoading || (canAccessFlow && !sources.isFetchedAfterMount)
const canOpenFlow = canAccessFlow && sources.isSuccess && hasSource
useEffect(() => {
if (!isAccessLoading && !canOpenFlow) {
const fallback = isEnabled ? listHref : `${listHref}?destinationType=BigQuery`
- window.location.replace(fallback)
+ void router.replace(fallback)
}
- }, [isAccessLoading, canOpenFlow, isEnabled, listHref])
- if (isAccessLoading)
- return <GenericSkeletonLoader className="mx-auto w-full max-w-[760px] px-6 py-8" />
- if (!canOpenFlow) return <p role="status">Returning to Pipelines…</p>
+ }, [isAccessLoading, canOpenFlow, isEnabled, listHref, router])
+ const handleClose = () => {
+ if (!ref) return
+ void router.push(`/project/${ref}/database/pipelines`)
+ }
+
+ let statusMessage = 'Pipeline creation ready'
+ if (isAccessLoading) statusMessage = 'Loading pipeline creation…'
+ else if (!canOpenFlow) statusMessage = 'Opening Pipelines…'
+ const status = (
+ <p role="status" aria-label="Pipeline creation status" className="sr-only">
+ {statusMessage}
+ </p>
+ )
+
+ if (isAccessLoading || !canOpenFlow) {
+ return (
+ <>
+ {status}
+ <div className="flex min-h-screen flex-col bg-dash-sidebar">
+ <Head>
+ <title>New Pipeline | Supabase</title>
+ </Head>
+ <PipelineCreationHeader
+ onClose={handleClose}
+ onNavigate={(href) => void router.push(href)}
+ />
+ <main className="flex-1">
+ {isAccessLoading && <PipelineCreationSkeleton />}
+ {!isAccessLoading && (
+ <p className="mx-auto w-full max-w-[760px] px-6 py-8">Returning to Pipelines…</p>
+ )}
+ </main>
+ </div>
+ </>
+ )
+ }
return (
<>
+ {status}
<Head>
<title>New Pipeline | Supabase</title>
</Head>
@@ -66,10 +100,7 @@ const PipelineCreationPage: NextPageWithLayout<Record<string, never>> = () => {
...(snowflake ? ['Snowflake' as const] : []),
...(clickHouse ? ['ClickHouse' as const] : []),
]}
- onClose={() => {
- if (!ref) return
- void router.push(`/project/${ref}/database/pipelines`)
- }}
+ onClose={handleClose}
/>
</>
)