Skip to content

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

feat(studio): tune up replication page layout and empty state (#48265)

Danny White205527c716d8
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.tsx
index 69644ce02b0..a88710f4b53 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationForm/index.tsx
@@ -3,7 +3,7 @@ import { PermissionAction } from '@supabase/shared-types/out/constants'
import { useParams } from 'common'
import { AnimatePresence, motion } from 'framer-motion'
import { Loader2 } from 'lucide-react'
-import { useEffect, useMemo, useRef, useState } from 'react'
+import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
import { useForm, useWatch } from 'react-hook-form'
import { AWS_REGIONS } from 'shared-data'
import { toast } from 'sonner'
@@ -82,6 +82,7 @@ interface DestinationFormProps {
selectedType: DestinationType
visible: boolean
existingDestination?: ExistingDestination
+ typeSelection?: ReactNode
onClose: () => void
}
@@ -89,6 +90,7 @@ export const DestinationForm = ({
selectedType,
visible,
existingDestination,
+ typeSelection,
onClose,
}: DestinationFormProps) => {
const { ref: projectRef } = useParams()
@@ -422,6 +424,7 @@ export const DestinationForm = ({
return (
<>
<SheetSection className="grow overflow-auto px-0 py-0">
+ {typeSelection}
{hasNoAvailableDestinations && !editMode ? (
<NoDestinationsAvailable />
) : (
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
index a6e9f94be47..d0120d9ad59 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx
@@ -1,3 +1,4 @@
+import { useParams } from 'common'
import { ArrowUpRight } from 'lucide-react'
import Link from 'next/link'
import { parseAsInteger, parseAsStringEnum, useQueryState } from 'nuqs'
@@ -14,6 +15,7 @@ import {
SheetSection,
SheetTitle,
} from 'ui'
+import { Admonition } from 'ui-patterns/Admonition'
import { EnablePipelinesCallout } from '../EnablePipelinesCallout'
import { PipelineStatusName } from '../Replication.constants'
@@ -24,6 +26,8 @@ import { DestinationType } from './DestinationPanel.types'
import { DestinationTypeSelection } from './DestinationTypeSelection'
import { ReadReplicaForm } from './ReadReplicaForm'
import { DocsButton } from '@/components/ui/DocsButton'
+import { useReplicationDestinationsQuery } from '@/data/replication/destinations-query'
+import { checkLocalETLNotSetUp } from '@/data/replication/utils'
import { useCheckEntitlements } from '@/hooks/misc/useCheckEntitlements'
import { DOCS_URL } from '@/lib/constants'
@@ -32,8 +36,11 @@ interface DestinationPanelProps {
}
export const DestinationPanel = ({ onSuccessCreateReadReplica }: DestinationPanelProps) => {
+ const { ref: projectRef } = useParams()
const enablePgReplicate = useIsETLPrivateAlpha()
const { hasAccess: hasETLReplicationAccess } = useCheckEntitlements('replication.etl')
+ const { error: destinationsError } = useReplicationDestinationsQuery({ projectRef })
+ const isLocalETLNotSetUp = checkLocalETLNotSetUp(destinationsError)
const [urlDestinationType, setDestinationType] = useQueryState(
'destinationType',
@@ -89,7 +96,7 @@ export const DestinationPanel = ({ onSuccessCreateReadReplica }: DestinationPane
}
const docsUrl =
- urlDestinationType === 'BigQuery'
+ destinationType === 'BigQuery'
? `${DOCS_URL}/guides/database/replication/bigquery#configure-bigquery-as-a-destination`
: `${DOCS_URL}/guides/database/replication/pipelines#step-3-configure-a-destination`
@@ -100,71 +107,108 @@ export const DestinationPanel = ({ onSuccessCreateReadReplica }: DestinationPane
}
}, [edit, invalidExistingDestination, setEdit])
+ const typeSelection = (
+ <>
+ <DestinationTypeSelection />
+ <DialogSectionSeparator />
+ </>
+ )
+
+ const pipelinesTypeSelection = (
+ <>
+ {typeSelection}
+ {destinationType != null && isLocalETLNotSetUp && (
+ <SheetSection className="pb-0!">
+ <Admonition
+ type="warning"
+ title="Replication unavailable locally"
+ description="Configure the replication API to manage Pipelines destinations in local development."
+ />
+ </SheetSection>
+ )}
+ </>
+ )
+
return (
<>
- <Sheet open={visible} onOpenChange={onClose}>
- <SheetContent size="lg" showClose={false}>
- <div className="flex flex-col h-full" tabIndex={-1}>
+ <Sheet
+ open={visible}
+ onOpenChange={(open) => {
+ if (!open) onClose()
+ }}
+ >
+ <SheetContent size="lg" showClose={false} className="max-w-3xl">
+ <div className="flex flex-col h-full min-h-0" tabIndex={-1}>
<SheetHeader className="flex items-center justify-between">
<div>
- <SheetTitle>{editMode ? 'Edit destination' : 'Add new destination'}</SheetTitle>
+ <SheetTitle>{editMode ? 'Edit destination' : 'Add destination'}</SheetTitle>
<SheetDescription>
{editMode
? 'Update the configuration for this destination.'
- : 'Set up a read replica or Supabase Pipelines destination for near real-time replication'}
+ : 'Add a read replica or an external destination.'}
</SheetDescription>
</div>
- <DocsButton href={docsUrl} topic={`${urlDestinationType} pipeline settings`} />
+ <DocsButton
+ href={docsUrl}
+ topic={`${destinationType ?? 'destination'} pipeline settings`}
+ />
</SheetHeader>
- <DestinationTypeSelection />
-
- <DialogSectionSeparator />
-
{destinationType === 'Read Replica' ? (
- <ReadReplicaForm onClose={onClose} onSuccess={() => onSuccessCreateReadReplica?.()} />
+ <ReadReplicaForm
+ typeSelection={typeSelection}
+ onClose={onClose}
+ onSuccess={() => onSuccessCreateReadReplica?.()}
+ />
) : !enablePgReplicate ? (
- <SheetSection>
- <div className={cn('border rounded-md p-6 flex flex-col gap-y-4')}>
- <div className="flex flex-col gap-y-1">
- <h4>Request Pipelines access</h4>
- <p className="text-sm text-foreground-light">
- Pipelines is in <span className="text-foreground">public alpha</span> and
- being rolled out gradually. Request access below to join the waitlist. Read
- replicas are available now.
- </p>
- </div>
- <div className="flex gap-x-2">
- <Button
- asChild
- variant="secondary"
- iconRight={<ArrowUpRight size={16} strokeWidth={1.5} />}
- >
- <Link
- target="_blank"
- rel="noreferrer"
- href="https://forms.supabase.com/pg_replicate"
+ <div className="grow overflow-auto min-h-0">
+ {pipelinesTypeSelection}
+ <SheetSection>
+ <div className={cn('border rounded-md p-6 flex flex-col gap-y-4')}>
+ <div className="flex flex-col gap-y-1">
+ <h4>Request Pipelines access</h4>
+ <p className="text-sm text-foreground-light">
+ Pipelines is in <span className="text-foreground">public alpha</span> and
+ being rolled out gradually. Request access below to join the waitlist. Read
+ replicas are available now.
+ </p>
+ </div>
+ <div className="flex gap-x-2">
+ <Button
+ asChild
+ variant="secondary"
+ iconRight={<ArrowUpRight size={16} strokeWidth={1.5} />}
>
- Request Pipelines access
- </Link>
- </Button>
- <DocsButton href={`${DOCS_URL}/guides/database/replication#pipelines`} />
+ <Link
+ target="_blank"
+ rel="noreferrer"
+ href="https://forms.supabase.com/pg_replicate"
+ >
+ Request Pipelines access
+ </Link>
+ </Button>
+ <DocsButton href={`${DOCS_URL}/guides/database/replication#pipelines`} />
+ </div>
</div>
- </div>
- </SheetSection>
+ </SheetSection>
+ </div>
) : replicationNotEnabled ? (
- <SheetSection>
- <EnablePipelinesCallout
- className="p-6!"
- type={destinationType}
- hasAccess={hasETLReplicationAccess}
- />
- </SheetSection>
+ <div className="grow overflow-auto min-h-0">
+ {pipelinesTypeSelection}
+ <SheetSection>
+ <EnablePipelinesCallout
+ className="p-6!"
+ type={destinationType}
+ hasAccess={hasETLReplicationAccess}
+ />
+ </SheetSection>
+ </div>
) : (
<DestinationForm
visible={visible}
selectedType={destinationType ?? 'Read Replica'}
existingDestination={existingDestination}
+ typeSelection={pipelinesTypeSelection}
onClose={onClose}
/>
)}
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.test.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.test.tsx
index 7d62e31f8c6..9ef30c6a292 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.test.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.test.tsx
@@ -132,7 +132,7 @@ describe('DestinationTypeSelection', () => {
fireEvent.click(await screen.findByRole('combobox'))
fireEvent.click(await screen.findByText('BigQuery'))
- expect(await screen.findByText(/This destination type is in public alpha/)).toBeInTheDocument()
+ expect(await screen.findByText(/In public alpha and may change/)).toBeInTheDocument()
})
test('disables the selector in edit mode so the destination type cannot be changed', async () => {
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
index 6761906bc21..792e0f9f837 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx
@@ -1,6 +1,7 @@
import { AnalyticsBucket, BigQuery, ClickHouse, Database } from 'icons'
import { Snowflake } from 'lucide-react'
import { parseAsInteger, parseAsStringEnum, useQueryState } from 'nuqs'
+import type { ElementType } from 'react'
import {
Badge,
Select,
@@ -29,7 +30,7 @@ interface DestinationTypeOption {
value: DestinationType
label: string
description: string
- icon: typeof Database
+ icon: ElementType<{ size?: number; className?: string; strokeWidth?: number }>
stage: 'Public Alpha' | 'Early Access' | 'Deprecated' | null
enabled: boolean
}
@@ -39,6 +40,12 @@ interface DestinationTypeGroup {
options: DestinationTypeOption[]
}
+function DestinationOptionIcon({ option }: { option: DestinationTypeOption }) {
+ const Icon = option.icon
+
+ return <Icon size={20} strokeWidth={1.5} className="shrink-0 text-foreground-light" />
+}
+
export const DestinationTypeSelection = () => {
const etlEnableBigQuery = useIsETLBigQueryPrivateAlpha()
const etlEnableIceberg = useIsETLIcebergPrivateAlpha()
@@ -147,29 +154,41 @@ export const DestinationTypeSelection = () => {
.flatMap((group) => group.options)
.find((option) => option.value === destinationType)
+ const stageDescription =
+ selectedOption?.stage === 'Public Alpha' ? (
+ <>
+ In public alpha and may change.{' '}
+ <InlineLink href="https://github.com/orgs/supabase/discussions/39416">
+ Leave feedback
+ </InlineLink>
+ </>
+ ) : selectedOption?.stage === 'Early Access' ? (
+ <>
+ In early access and may change.{' '}
+ <InlineLink href="https://github.com/orgs/supabase/discussions/39416">
+ Leave feedback
+ </InlineLink>
+ </>
+ ) : selectedOption?.stage === 'Deprecated' ? (
+ 'This destination type is deprecated.'
+ ) : null
+
+ const typeDescription =
+ !editMode || stageDescription ? (
+ <span>
+ {!editMode && 'Cannot be changed after creation.'}
+ {!editMode && stageDescription ? ' ' : null}
+ {stageDescription}
+ </span>
+ ) : undefined
+
return (
<FormItemLayout
isReactForm={false}
layout="horizontal"
- className="p-5 [&>div]:gap-y-1"
+ className="p-5 [&>div]:gap-y-1 [&>div>span]:text-foreground-lighter"
label="Type"
- labelOptional="Destination type cannot be changed after creation"
- description={
- selectedOption?.stage && (
- <span className="block text-sm text-foreground-lighter mb-1">
- {selectedOption.stage === 'Public Alpha'
- ? 'This destination type is in public alpha and may change as we iterate based on customer feedback. '
- : selectedOption.stage === 'Deprecated'
- ? 'This destination type is deprecated.'
- : 'This destination type is available through early access and may change as we iterate based on customer feedback. '}
- {selectedOption.stage !== 'Deprecated' && (
- <InlineLink href="https://github.com/orgs/supabase/discussions/39416">
- Leave feedback
- </InlineLink>
- )}
- </span>
- )
- }
+ description={typeDescription}
>
<Select
disabled={editMode}
@@ -179,7 +198,7 @@ export const DestinationTypeSelection = () => {
<SelectTrigger className="h-auto py-2">
{selectedOption ? (
<div className="flex items-center gap-x-3 text-left">
- <selectedOption.icon size={20} className="shrink-0 text-foreground-light" />
+ <DestinationOptionIcon option={selectedOption} />
<div className="flex items-center gap-x-2">
<span className="text-sm text-foreground">{selectedOption.label}</span>
{selectedOption.stage && (
@@ -209,7 +228,7 @@ export const DestinationTypeSelection = () => {
{group.options.map((option) => (
<SelectItem key={option.value} value={option.value} className="py-2">
<div className="flex items-center gap-x-3">
- <option.icon size={20} className="shrink-0 text-foreground-light" />
+ <DestinationOptionIcon option={option} />
<div className="flex flex-col gap-y-0.5">
<div className="flex items-center gap-x-2">
<span className="text-foreground">{option.label}</span>
diff --git a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/ReadReplicaForm/index.tsx b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/ReadReplicaForm/index.tsx
index e5e89e08a2d..7e39afc1f00 100644
--- a/apps/studio/components/interfaces/Database/Replication/DestinationPanel/ReadReplicaForm/index.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/DestinationPanel/ReadReplicaForm/index.tsx
@@ -1,5 +1,5 @@
import { useParams } from 'common'
-import { useState } from 'react'
+import { useState, type ReactNode } from 'react'
import { AWS_REGIONS, AWS_REGIONS_KEYS } from 'shared-data'
import { toast } from 'sonner'
import {
@@ -24,11 +24,12 @@ import { useReadReplicasQuery } from '@/data/read-replicas/replicas-query'
import { AWS_REGIONS_DEFAULT, BASE_PATH } from '@/lib/constants'
interface ReadReplicaFormProps {
+ typeSelection?: ReactNode
onSuccess: () => void
onClose: () => void
}
-export const ReadReplicaForm = ({ onSuccess, onClose }: ReadReplicaFormProps) => {
+export const ReadReplicaForm = ({ typeSelection, onSuccess, onClose }: ReadReplicaFormProps) => {
const { ref: projectRef } = useParams()
const { data } = useReadReplicasQuery({ projectRef })
@@ -66,13 +67,13 @@ export const ReadReplicaForm = ({ onSuccess, onClose }: ReadReplicaFormProps) =>
return (
<>
- {!canDeployReplica && (
- <SheetSection>
- <ReadReplicaEligibilityWarnings />
- </SheetSection>
- )}
-
<SheetSection className="grow overflow-auto px-0 py-0">
+ {typeSelection}
+ {!canDeployReplica && (
+ <SheetSection>
+ <ReadReplicaEligibilityWarnings />
+ </SheetSection>
+ )}
<FormItemLayout
isReactForm={false}
layout="horizontal"
diff --git a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx b/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
index fec2cc142af..52767d0788d 100644
--- a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/Destinations.tsx
@@ -1,6 +1,7 @@
import { useQueryClient } from '@tanstack/react-query'
import { useParams } from 'common'
-import { ChartArea, MoreVertical, Plus, Search, X } from 'lucide-react'
+import { Database } from 'icons'
+import { MoreVertical, Plus, Search, X } from 'lucide-react'
import Link from 'next/link'
import { parseAsStringEnum, useQueryState } from 'nuqs'
import { useEffect, useMemo, useRef, useState } from 'react'
@@ -8,10 +9,10 @@ import {
Button,
Card,
CardContent,
- cn,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
+ DropdownMenuSeparator,
DropdownMenuTrigger,
Table,
TableBody,
@@ -20,8 +21,8 @@ import {
TableHeader,
TableRow,
} from 'ui'
-import { Admonition } from 'ui-patterns/Admonition'
import { Input } from 'ui-patterns/DataInputs/Input'
+import { EmptyStatePresentational } from 'ui-patterns/EmptyStatePresentational'
import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
import { REPLICA_STATUS } from '../../Settings/Infrastructure/InfrastructureConfiguration/InstanceConfiguration.constants'
@@ -39,6 +40,7 @@ import {
} from './useIsETLPrivateAlpha'
import { AlertError } from '@/components/ui/AlertError'
import { DocsButton } from '@/components/ui/DocsButton'
+import { DropdownMenuItemTooltip } from '@/components/ui/DropdownMenuItemTooltip'
import { Shortcut } from '@/components/ui/Shortcut'
import { useReadReplicasQuery } from '@/data/read-replicas/replicas-query'
import { useReplicationDestinationsQuery } from '@/data/replication/destinations-query'
@@ -50,6 +52,7 @@ import { checkLocalETLNotSetUp } from '@/data/replication/utils'
import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization'
import { DOCS_URL } from '@/lib/constants'
+import { onSearchInputEscape } from '@/lib/keyboard'
import { SHORTCUT_IDS } from '@/state/shortcuts/registry'
import { useShortcut } from '@/state/shortcuts/useShortcut'
@@ -225,74 +228,81 @@ export const Destinations = () => {
}, [isDatabasesSuccess, readReplicas])
return (
- <>
- <div className="mb-4">
- <div className="flex items-center justify-between">
- <div className="flex items-center">
- <Input
- ref={searchInputRef}
- placeholder="Filter destinations"
- size="tiny"
- icon={<Search />}
- value={filterString}
- className="w-full lg:w-52"
- onChange={(e) => setFilterString(e.target.value)}
- actions={
- filterString.length > 0 && (
- <Button
- aria-label="Clear filter"
- variant="text"
- icon={<X />}
- className="p-0 h-5 w-5"
- onClick={() => setFilterString('')}
- />
- )
- }
- />
- </div>
- <div className="flex items-center gap-x-2">
- <Shortcut
- id={SHORTCUT_IDS.LIST_PAGE_NEW_ITEM}
- label="Add destination"
- onTrigger={openDestinationPanel}
- options={{ enabled: !!newDestinationDefaultType }}
- side="bottom"
- >
+ <div className="w-full space-y-4">
+ <div className="flex items-center justify-between">
+ <div className="flex items-center">
+ <Input
+ ref={searchInputRef}
+ placeholder="Filter destinations"
+ size="tiny"
+ icon={<Search />}
+ value={filterString}
+ className="w-full lg:w-52"
+ onChange={(e) => setFilterString(e.target.value)}
+ onKeyDown={onSearchInputEscape(filterString, setFilterString)}
+ actions={
+ filterString.length > 0 && (
+ <Button
+ aria-label="Clear filter"
+ variant="text"
+ icon={<X />}
+ className="p-0 h-5 w-5"
+ onClick={() => setFilterString('')}
+ />
+ )
+ }
+ />
+ </div>
+ <div className="flex items-center gap-x-2">
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
<Button
+ aria-label="More actions"
variant="default"
- icon={<Plus />}
- disabled={!newDestinationDefaultType}
- onClick={openDestinationPanel}
- >
- Add destination
- </Button>
- </Shortcut>
- {organization?.slug && (
- <Button asChild variant="default" icon={<ChartArea />}>
- <Link href={`/org/${organization.slug}/usage#pipeline-initial-sync-data`}>
- Usage
+ icon={<MoreVertical />}
+ className="px-1"
+ />
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end" className="w-52">
+ <DropdownMenuItem asChild>
+ <Link href={`/org/${organization?.slug}/usage#pipeline-initial-sync-data`}>
+ View Pipelines usage
</Link>
- </Button>
- )}
- <DocsButton href={`${DOCS_URL}/guides/database/replication`} />
- {canDisablePipelines && (
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- aria-label="More actions"
- variant="default"
- icon={<MoreVertical />}
- className="w-7"
- />
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end" className="w-52">
- <DropdownMenuItem onClick={() => setShowDisablePipelinesDialog(true)}>
- Disable Pipelines
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- )}
- </div>
+ </DropdownMenuItem>
+ <DropdownMenuSeparator />
+ <DropdownMenuItemTooltip
+ disabled={canDisablePipelines}
+ tooltip={{
+ content: {
+ side: 'left',
+ text: 'Remove all existing destinations before disabling Pipelines',
+ },
+ }}
+ onClick={() => setShowDisablePipelinesDialog(true)}
+ >
+ Disable Pipelines
+ </DropdownMenuItemTooltip>
+ </DropdownMenuContent>
+ </DropdownMenu>
+
+ <DocsButton href={`${DOCS_URL}/guides/database/replication`} />
+
+ <Shortcut
+ id={SHORTCUT_IDS.LIST_PAGE_NEW_ITEM}
+ label="Add destination"
+ onTrigger={openDestinationPanel}
+ options={{ enabled: !!newDestinationDefaultType }}
+ side="bottom"
+ >
+ <Button
+ variant="primary"
+ icon={<Plus />}
+ disabled={!newDestinationDefaultType}
+ onClick={openDestinationPanel}
+ >
+ Add destination
+ </Button>
+ </Shortcut>
</div>
</div>
@@ -304,13 +314,6 @@ export const Destinations = () => {
/>
)}
- {isLocalETLNotSetUp && (
- <Admonition
- type="default"
- title="ETL API not set up locally — destinations cannot be managed"
- />
- )}
-
{isLoading ? (
<GenericSkeletonLoader />
) : hasReplicas || hasDestinations ? (
@@ -368,27 +371,20 @@ export const Destinations = () => {
) : (
!isLoading &&
!hasErrorsFetchingData && (
- <div
- className={cn(
- 'w-full',
- 'border border-dashed bg-surface-100 border-overlay',
- 'flex flex-col px-16 rounded-lg justify-center items-center py-8 mt-4'
- )}
+ <EmptyStatePresentational
+ icon={Database}
+ title="Add a replication destination"
+ description="Deploy a read replica for lower latency and workload isolation, or connect a Pipelines destination for analytics workloads."
>
- <h4>Replication keeps your data in sync across systems</h4>
- <p className="text-foreground-light text-sm text-balance text-center mt-1">
- Deploy Read Replicas for lower latency and workload isolation, or add a Pipelines
- destination for analytics workloads.
- </p>
<Button
+ variant="default"
icon={<Plus />}
disabled={!newDestinationDefaultType}
onClick={openDestinationPanel}
- className="mt-4"
>
Add destination
</Button>
- </div>
+ </EmptyStatePresentational>
)
)}
</div>
@@ -399,6 +395,6 @@ export const Destinations = () => {
open={showDisablePipelinesDialog}
setOpen={setShowDisablePipelinesDialog}
/>
- </>
+ </div>
)
}
diff --git a/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/EmptyReplicationDiagram.tsx b/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/EmptyReplicationDiagram.tsx
index f9f861f6025..105e544adf7 100644
--- a/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/EmptyReplicationDiagram.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/EmptyReplicationDiagram.tsx
@@ -30,7 +30,7 @@ const ReplicationDiagramContent = () => {
resolvedTheme === 'dark' ? 'rgba(255, 255, 255, 0.3)' : 'rgba(0, 0, 0, 0.4)'
return (
- <div className="nowheel relative min-h-[350px]">
+ <div className="nowheel relative h-[350px] w-full border border-muted rounded-md overflow-hidden">
<ReactFlow
// FIXME: https://github.com/xyflow/xyflow/issues/4876
colorMode={'' as unknown as ColorMode}
diff --git a/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/index.tsx b/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/index.tsx
index 83a9555cee7..4f1412a4cce 100644
--- a/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/index.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/index.tsx
@@ -121,7 +121,7 @@ const ReplicationDiagramContent = () => {
}, [nodes, isSuccessDestinations, skipRenderingDestinations, isSuccessReplicas])
return (
- <div className="nowheel relative min-h-[350px]">
+ <div className="nowheel relative h-[350px] w-full border border-muted rounded-md overflow-hidden">
<ReactFlow
// FIXME: https://github.com/xyflow/xyflow/issues/4876
colorMode={'' as unknown as ColorMode}
diff --git a/apps/studio/pages/project/[ref]/database/replication/index.tsx b/apps/studio/pages/project/[ref]/database/replication/index.tsx
index 2d48e5b2721..98097e6481a 100644
--- a/apps/studio/pages/project/[ref]/database/replication/index.tsx
+++ b/apps/studio/pages/project/[ref]/database/replication/index.tsx
@@ -1,10 +1,18 @@
+import { PageContainer } from 'ui-patterns/PageContainer'
+import {
+ PageHeader,
+ PageHeaderDescription,
+ PageHeaderMeta,
+ PageHeaderSummary,
+ PageHeaderTitle,
+} from 'ui-patterns/PageHeader'
+import { PageSection, PageSectionContent } from 'ui-patterns/PageSection'
import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
import { Destinations } from '@/components/interfaces/Database/Replication/Destinations'
import { ReplicationDiagram } from '@/components/interfaces/Database/Replication/ReplicationDiagram'
import DatabaseLayout from '@/components/layouts/DatabaseLayout/DatabaseLayout'
import { DefaultLayout } from '@/components/layouts/DefaultLayout'
-import { ScaffoldContainer, ScaffoldSection } from '@/components/layouts/Scaffold'
import { HighAvailabilityDisabledEmptyState } from '@/components/ui/HighAvailability/HighAvailabilityDisabledEmptyState'
import { UnknownInterface } from '@/components/ui/UnknownInterface'
import { useHighAvailability } from '@/hooks/misc/useHighAvailability'
@@ -35,34 +43,27 @@ const DatabaseReplicationPage: NextPageWithLayout = () => {
return (
<PipelineRequestStatusProvider>
- <ScaffoldContainer>
- <ScaffoldSection isFullWidth>
- <div className="w-full mb-6">
- <div className="flex items-center gap-x-2 mb-1">
- <h3 className="text-foreground text-xl prose">Replication</h3>
- </div>
- <p className="prose text-sm max-w-full">
- Deploy Read Replicas across multiple regions, or use Pipelines to replicate database
- changes to analytics destinations.
- </p>
- </div>
- </ScaffoldSection>
- </ScaffoldContainer>
+ <PageHeader size="large">
+ <PageHeaderMeta>
+ <PageHeaderSummary>
+ <PageHeaderTitle>Replication</PageHeaderTitle>
+ <PageHeaderDescription>Read replicas and analytics pipelines</PageHeaderDescription>
+ </PageHeaderSummary>
+ </PageHeaderMeta>
+ </PageHeader>
- {isPending ? (
- <ScaffoldContainer>
+ <PageContainer size="large">
+ {isPending ? (
<GenericSkeletonLoader />
- </ScaffoldContainer>
- ) : (
- <>
- <ReplicationDiagram />
- <ScaffoldContainer>
- <ScaffoldSection isFullWidth className="pt-6!">
+ ) : (
+ <PageSection>
+ <PageSectionContent className="flex flex-col gap-12">
+ <ReplicationDiagram />
<Destinations />
- </ScaffoldSection>
- </ScaffoldContainer>
- </>
- )}
+ </PageSectionContent>
+ </PageSection>
+ )}
+ </PageContainer>
</PipelineRequestStatusProvider>
)
}