Files
supabase/apps/studio/components/ui/StateDot.tsx
Danny White a4be167491 fix(studio): clarify Warehouse status and navigation (#50554)
## What kind of change does this PR introduce?

Bug fix and UI polish.

## What is the current behavior?

The Warehouse Connect option repeats its own name, and a configured
Warehouse has no direct route back to its management page. Warehouse
table states also use badges instead of the status-dot pattern used by
Replication, and a backfilling table can misleadingly appear as “Caught
up”.

## What is the new behavior?

- Describes Warehouse as an analytical endpoint and adds a low-emphasis
“Manage Warehouse” link from the Connect sheet.
- Shares Replication’s status-dot presentation with Warehouse while
keeping feature-specific state mapping separate.
- Shows replication lag only for live tables, so backfilling and “Caught
up” are never presented together.

| Before | After |
| --- | --- |
| <img width="1244" height="1156" alt="CleanShot 2026-09-18 at 14 03
49@2x"
src="https://github.com/user-attachments/assets/60aa3496-6930-491a-af9e-9ffcfb035a0f"
/> | <img width="1216" height="1214" alt="CleanShot 2026-09-18 at 14 04
33@2x"
src="https://github.com/user-attachments/assets/84a8c80e-d8d1-4ee5-9cce-352d1f6477c2"
/> |
| <img width="1314" height="1414" alt="CleanShot 2026-09-18 at 14 02
50@2x"
src="https://github.com/user-attachments/assets/8871a4a5-0543-4290-91a7-9da949ec4c49"
/> | <img width="1308" height="1498" alt="CleanShot 2026-09-18 at 14 02
43@2x"
src="https://github.com/user-attachments/assets/ac3fc6d1-5b4d-4a3a-8ab7-bb54025e2145"
/> |

## To test

1. Open `/project/<ref>?showConnect=true&connectTab=warehouse` for a
project with Warehouse configured. Confirm the mode subtitle says
“Analytical endpoint”. Confirm the new “Manage Warehouse” button opens
`/project/<ref>/integrations/warehouse/overview`.
2. Open `/project/<ref>/integrations/warehouse/overview` while a table
is backfilling. Confirm it has a pulsing amber status dot and does not
show “Caught up”.
3. Once the table is live, confirm it has a green “Live” status dot and
its lag appears normally.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added clearer Warehouse setup progress messaging with a “View
progress” action while setup is running.
- Connection details are shown once the Warehouse is provisioned or has
live tables.
- Added a Cancel action when editing changed Warehouse table selections.
- Updated table statuses with live, syncing, and warning indicators,
including animated syncing states.
  - Lag details are displayed for live tables when available.
  - Renamed the Warehouse connection option to “Analytical endpoint.”

- **Style**
  - Improved Warehouse management controls and table name readability.
  - Removed the table Size column from the Warehouse overview.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-22 12:21:40 +10:00

49 lines
1.7 KiB
TypeScript

import { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from 'react'
import { cn } from 'ui'
export type StateDotVariant = 'success' | 'warning' | 'destructive' | 'default'
const DOT_CLASS_NAME: Record<StateDotVariant, string> = {
success: 'bg-brand',
warning: 'bg-warning',
destructive: 'bg-destructive',
default: 'bg-foreground-muted',
}
interface StateDotProps extends ComponentPropsWithoutRef<'span'> {
variant: StateDotVariant
children: ReactNode
/** Pulse for states that are in motion, such as starting or restarting. */
isPulsing?: boolean
/** Offsets `animate-ping` so neighbouring pulsing dots don't flash in lockstep. */
pulseDelayMs?: number
labelClassName?: string
}
/** A coloured dot with a label for compact operational states. */
export const StateDot = forwardRef<HTMLSpanElement, StateDotProps>(
(
{ variant, children, isPulsing = false, pulseDelayMs = 0, className, labelClassName, ...props },
ref
) => (
<span ref={ref} className={cn('inline-flex items-center gap-x-2', className)} {...props}>
<span className="relative flex h-2 w-2 shrink-0">
{isPulsing && (
<span
className={cn(
'absolute inline-flex h-full w-full animate-ping motion-reduce:animate-none rounded-full opacity-75',
DOT_CLASS_NAME[variant]
)}
style={pulseDelayMs > 0 ? { animationDelay: `${pulseDelayMs}ms` } : undefined}
/>
)}
<span
className={cn('relative inline-flex h-2 w-2 rounded-full', DOT_CLASS_NAME[variant])}
/>
</span>
<span className={labelClassName}>{children}</span>
</span>
)
)
StateDot.displayName = 'StateDot'