The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
chore(studio): empty state improvements (#40807)
Danny White46ac132051d1
diff --git a/apps/design-system/config/docs.ts b/apps/design-system/config/docs.tsindex 834cb30c460..a8989a070bf 100644--- a/apps/design-system/config/docs.ts+++ b/apps/design-system/config/docs.ts@@ -85,6 +85,11 @@ export const docsConfig: DocsConfig = {href: '/docs/fragments/assistant-chat',items: [],},+ {+ title: 'EmptyStatePresentational',+ href: '/docs/fragments/empty-state-presentational',+ items: [],+ },{title: 'Modal',href: '/docs/fragments/modal',diff --git a/apps/design-system/content/docs/fragments/empty-state-presentational.mdx b/apps/design-system/content/docs/fragments/empty-state-presentational.mdxnew file mode 100644index 00000000000..74435dd33b5--- /dev/null+++ b/apps/design-system/content/docs/fragments/empty-state-presentational.mdx@@ -0,0 +1,12 @@+---+title: EmptyStatePresentational+description: An initial state with value propositions and actions.+component: true+fragment: true+---++<ComponentPreview name="empty-state-initial-state-presentational" peekCode />++Supports both Lucide icons and custom icon components from the `icons` package. Expects a title, description, and optional action buttons or other children.++See also [Empty States](../ui-patterns/empty-states).diff --git a/apps/design-system/content/docs/ui-patterns/empty-states.mdx b/apps/design-system/content/docs/ui-patterns/empty-states.mdxindex 53a3a8d96be..a069124ea6a 100644--- a/apps/design-system/content/docs/ui-patterns/empty-states.mdx+++ b/apps/design-system/content/docs/ui-patterns/empty-states.mdx@@ -42,7 +42,7 @@ Perhaps the user has not yet created any data. The presentation of this empty st#### Presentational-The user may be learning about a feature for the first time, and this experience benefits from user education or onboarding. In cases like these, the empty state should put more focus on the feature’s value proposition and an action the user can take.+The user may be learning about a feature for the first time, and could benefit from lightweight feature education or onboarding. Use the dedicated [EmptyStatePresentational](../fragments/empty-state-presentational) component in this case, putting emphasis on an action the user can take.<ComponentPreview name="empty-state-initial-state-presentational" peekCode wide />@@ -56,7 +56,9 @@ Keep in mind that empty states will likely appear after a visual loading state.## Components-There is not yet a shared empty state UI component. The context and needs for each placement differ enough to warrant custom components for each placement.+For presentational empty states (initial states with value propositions and actions), use the [EmptyStatePresentational](../fragments/empty-state-presentational) component from `ui-patterns`. This component provides a consistent structure with support for icons, titles, descriptions, and action buttons.++For other empty state scenarios (zero results, missing routes, etc), custom components may still be appropriate as the context and needs for each placement can differ significantly.## External referencesdiff --git a/apps/design-system/registry/default/example/empty-state-initial-state-presentational.tsx b/apps/design-system/registry/default/example/empty-state-initial-state-presentational.tsxindex 4200a1e3b4f..b4103936eaf 100644--- a/apps/design-system/registry/default/example/empty-state-initial-state-presentational.tsx+++ b/apps/design-system/registry/default/example/empty-state-initial-state-presentational.tsx@@ -1,22 +1,18 @@import { BucketPlus } from 'icons'import { Plus } from 'lucide-react'import { Button } from 'ui'+import { EmptyStatePresentational } from 'ui-patterns'export default function EmptyStateInitialStatePresentational() {return (- <aside className="border border-dashed w-full bg-surface-100 rounded-lg px-4 py-10 flex flex-col gap-y-4 items-center text-center gap-1 text-balance">- <div className="flex flex-col gap-3 items-center text-center">- <BucketPlus size={24} strokeWidth={1.5} className="text-foreground-muted" />- <div className="flex flex-col gap-1">- <h3>Create a vector bucket</h3>- <p className="text-foreground-light text-sm">- Store, index, and query your vector embeddings at scale.- </p>- </div>- </div>- <Button size="tiny" type="primary" className="w-fit" icon={<Plus size={14} />}>+ <EmptyStatePresentational+ icon={BucketPlus}+ title="Create a vector bucket"+ description="Store, index, and query your vector embeddings at scale."+ >+ <Button size="tiny" type="primary" icon={<Plus size={14} />}>Create bucket</Button>- </aside>+ </EmptyStatePresentational>)}diff --git a/apps/design-system/registry/default/example/empty-state-missing-route.tsx b/apps/design-system/registry/default/example/empty-state-missing-route.tsxindex 0c0f9b63ea4..004dd0e1cbc 100644--- a/apps/design-system/registry/default/example/empty-state-missing-route.tsx+++ b/apps/design-system/registry/default/example/empty-state-missing-route.tsx@@ -17,7 +17,7 @@ export default function EmptyStateMissingRoute() {<Linkhref="/"onClick={(e) => {- e.preventDefault()+ e.preventDefault() // Just for demo purposes}}>Head backdiff --git a/apps/design-system/registry/fragments.ts b/apps/design-system/registry/fragments.tsindex 7534016172c..d35061a82ac 100644--- a/apps/design-system/registry/fragments.ts+++ b/apps/design-system/registry/fragments.ts@@ -7,6 +7,12 @@ export const fragments: Registry = [files: ['/Dialogs/ConfirmationModal.tsx'],optionalPath: '/Dialogs',},+ {+ name: 'EmptyStatePresentational',+ type: 'components:fragment',+ files: ['/EmptyStatePresentational/index.tsx'],+ optionalPath: '/EmptyStatePresentational',+ },{name: 'TextConfirmModal',type: 'components:fragment',diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersForm/index.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersForm/index.tsxindex 53b90bae078..dddd421f145 100644--- a/apps/studio/components/interfaces/Auth/AuthProvidersForm/index.tsx+++ b/apps/studio/components/interfaces/Auth/AuthProvidersForm/index.tsx@@ -11,6 +11,7 @@ import AlertError from 'components/ui/AlertError'import { ResourceList } from 'components/ui/Resource/ResourceList'import { HorizontalShimmerWithIcon } from 'components/ui/Shimmers'import { useAuthConfigQuery } from 'data/auth/auth-config-query'+import { DOCS_URL } from 'lib/constants'import {Alert_Shadcn_,AlertDescription_Shadcn_,@@ -61,7 +62,7 @@ export const AuthProvidersForm = () => {hour.</p><Button asChild type="default" className="w-min" icon={<ExternalLink />}>- <Link href="https://supabase.com/docs/guides/platform/going-into-prod#security">+ <Link href={`${DOCS_URL}/guides/platform/going-into-prod#security`}>View security recommendations</Link></Button>diff --git a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsxindex 1d2ef2b2416..93fdbaebf21 100644--- a/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx+++ b/apps/studio/components/interfaces/Auth/AuthProvidersFormValidation.tsx@@ -37,7 +37,7 @@ const PROVIDER_EMAIL = {description:'Rejects the use of known or easy to guess passwords on sign up or password change. Powered by the HaveIBeenPwned.org Pwned Passwords API.',type: 'boolean',- link: 'https://supabase.com/docs/guides/auth/password-security#password-strength-and-leaked-password-protection',+ link: `${DOCS_URL}/guides/auth/password-security#password-strength-and-leaked-password-protection`,isPaid: true,},PASSWORD_MIN_LENGTH: {diff --git a/apps/studio/components/interfaces/Auth/OAuthApps/CreateOrUpdateOAuthAppSheet.tsx b/apps/studio/components/interfaces/Auth/OAuthApps/CreateOrUpdateOAuthAppSheet.tsxindex 65d9d406209..5165083cc7f 100644--- a/apps/studio/components/interfaces/Auth/OAuthApps/CreateOrUpdateOAuthAppSheet.tsx+++ b/apps/studio/components/interfaces/Auth/OAuthApps/CreateOrUpdateOAuthAppSheet.tsx@@ -5,18 +5,19 @@ import type {UpdateOAuthClientParams,} from '@supabase/supabase-js'import { Plus, Trash2, Upload, X } from 'lucide-react'-import Link from 'next/link'import { type ChangeEvent, useEffect, useRef, useState } from 'react'import { useFieldArray, useForm } from 'react-hook-form'import { toast } from 'sonner'import * as z from 'zod'import { useParams } from 'common'+import { InlineLink } from 'components/ui/InlineLink'import Panel from 'components/ui/Panel'import { useProjectEndpointQuery } from 'data/config/project-endpoint-query'import { useOAuthServerAppCreateMutation } from 'data/oauth-server-apps/oauth-server-app-create-mutation'import { useOAuthServerAppRegenerateSecretMutation } from 'data/oauth-server-apps/oauth-server-app-regenerate-secret-mutation'import { useOAuthServerAppUpdateMutation } from 'data/oauth-server-apps/oauth-server-app-update-mutation'+import { DOCS_URL } from 'lib/constants'import {Button,FormControl_Shadcn_,@@ -468,14 +469,9 @@ export const CreateOrUpdateOAuthAppSheet = ({flow can be used, particularly beneficial for applications that cannotsecurely store Client Secrets, such as native and mobile apps. This cannotbe changed after creation.{' '}- <Link- href="https://supabase.com/docs/guides/auth/oauth/public-oauth-apps"- target="_blank"- rel="noreferrer"- className="text-foreground-light underline hover:text-foreground transition"- >+ <InlineLink href={`${DOCS_URL}/guides/auth/oauth/public-oauth-apps`}>Learn more- </Link>+ </InlineLink></>}className={'px-5'}diff --git a/apps/studio/components/interfaces/Auth/OAuthApps/OAuthServerSettingsForm.tsx b/apps/studio/components/interfaces/Auth/OAuthApps/OAuthServerSettingsForm.tsxindex 05f7c0b7aa0..82c554c7a6a 100644--- a/apps/studio/components/interfaces/Auth/OAuthApps/OAuthServerSettingsForm.tsx+++ b/apps/studio/components/interfaces/Auth/OAuthApps/OAuthServerSettingsForm.tsx@@ -12,12 +12,14 @@ import {ScaffoldSectionContent,ScaffoldSectionTitle,} from 'components/layouts/Scaffold'+import { InlineLink } from 'components/ui/InlineLink'import NoPermission from 'components/ui/NoPermission'import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'import { useAuthConfigQuery } from 'data/auth/auth-config-query'import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation'import { useOAuthServerAppsQuery } from 'data/oauth-server-apps/oauth-server-apps-query'import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'+import { DOCS_URL } from 'lib/constants'import {Button,Card,@@ -216,14 +218,9 @@ export const OAuthServerSettingsForm = () => {<>Enable OAuth server functionality for your project to create and manageOAuth applications.{' '}- <Link- href="https://supabase.com/docs/guides/auth/oauth-server"- target="_blank"- rel="noreferrer"- className="text-foreground-light underline hover:text-foreground transition"- >+ <InlineLink href={`${DOCS_URL}/guides/auth/oauth-server`}>Learn more- </Link>+ </InlineLink></>}>@@ -314,14 +311,11 @@ export const OAuthServerSettingsForm = () => {<>Enable dynamic OAuth app registration. Apps can be registeredprogrammatically via APIs.{' '}- <Link- href="https://supabase.com/docs/guides/auth/oauth-server/mcp-authentication#oauth-client-setup"- target="_blank"- rel="noreferrer"- className="text-foreground-light underline hover:text-foreground transition"+ <InlineLink+ href={`${DOCS_URL}/guides/auth/oauth-server/mcp-authentication#oauth-client-setup`}>Learn more- </Link>+ </InlineLink></>}>diff --git a/apps/studio/components/interfaces/Auth/Overview/OverviewLearnMore.tsx b/apps/studio/components/interfaces/Auth/Overview/OverviewLearnMore.tsxindex 0732dbec742..1ba810a08b2 100644--- a/apps/studio/components/interfaces/Auth/Overview/OverviewLearnMore.tsx+++ b/apps/studio/components/interfaces/Auth/Overview/OverviewLearnMore.tsx@@ -1,15 +1,15 @@-import { ScaffoldSection, ScaffoldSectionTitle } from 'components/layouts/Scaffold'-import { Card, CardContent, CardHeader, CardTitle, Button, AiIconAnimation, Image } from 'ui'-import Link from 'next/link'-import { BookOpen } from 'lucide-react'-import { Logs } from 'icons'-import { BASE_PATH } from 'lib/constants'import { useParams } from 'common'-import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'-import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state'+import { ScaffoldSection, ScaffoldSectionTitle } from 'components/layouts/Scaffold'+import { Logs } from 'icons'+import { BASE_PATH, DOCS_URL } from 'lib/constants'+import { BookOpen } from 'lucide-react'import { useTheme } from 'next-themes'+import Link from 'next/link'import { useEffect, useState } from 'react'+import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'+import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state'+import { AiIconAnimation, Button, Card, CardContent, CardHeader, CardTitle, Image } from 'ui'export const OverviewLearnMore = () => {const [isMounted, setIsMounted] = useState(false)@@ -35,7 +35,7 @@ export const OverviewLearnMore = () => {actions: [{label: 'Docs',- href: 'https://supabase.com/docs/guides/auth',+ href: `${DOCS_URL}/guides/auth`,icon: <BookOpen />,},],diff --git a/apps/studio/components/interfaces/Billing/InvoiceStatusBadge.tsx b/apps/studio/components/interfaces/Billing/InvoiceStatusBadge.tsxindex 1360bca87e6..f47d9540ba4 100644--- a/apps/studio/components/interfaces/Billing/InvoiceStatusBadge.tsx+++ b/apps/studio/components/interfaces/Billing/InvoiceStatusBadge.tsx@@ -1,4 +1,5 @@import { InlineLink } from 'components/ui/InlineLink'+import { DOCS_URL } from 'lib/constants'import { Badge, Tooltip, TooltipContent, TooltipTrigger } from 'ui'import { InvoiceStatus } from './Invoices.types'@@ -72,7 +73,7 @@ const InvoiceStatusBadge = ({<p className="text-xs text-foreground">If you run into this, we recommend{' '}- <InlineLink href="https://supabase.com/docs/guides/platform/credits#credit-top-ups">+ <InlineLink href={`${DOCS_URL}/guides/platform/credits#credit-top-ups`}>topping up your credits</InlineLink>{' '}in advance to avoid running into this in the future.diff --git a/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsx b/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsxindex 31b71135184..643b3d907e3 100644--- a/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsx+++ b/apps/studio/components/interfaces/Connect/DatabaseConnectionString.tsx@@ -1,7 +1,6 @@import { BookOpen, ChevronDown, ExternalLink } from 'lucide-react'import { parseAsString, useQueryState } from 'nuqs'import { HTMLAttributes, ReactNode, useEffect, useMemo, useState } from 'react'-import Link from 'next/link'import { useParams } from 'common'import { getAddons } from 'components/interfaces/Billing/Subscription/Subscription.utils'@@ -15,7 +14,7 @@ import { useReadReplicasQuery } from 'data/read-replicas/replicas-query'import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'import { useSendEventMutation } from 'data/telemetry/send-event-mutation'import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'-import { IS_PLATFORM } from 'lib/constants'+import { DOCS_URL, IS_PLATFORM } from 'lib/constants'import { pluckObjectFields } from 'lib/helpers'import { useDatabaseSelectorStateSnapshot } from 'state/database-selector'import {@@ -335,15 +334,13 @@ export const DatabaseConnectionString = () => {<p className="text-xs inline-flex items-center gap-1 text-foreground-lighter"><BookOpen size={12} strokeWidth={1.5} className="-mb-px" /> Learn how to connect to yourPostgres databases.- <Link- href="https://supabase.com/docs/guides/database/connecting-to-postgres"- className="underline transition hover:text-foreground inline-flex items-center gap-1"- target="_blank"- rel="noreferrer"+ <InlineLinktitle="Read docs"+ className="flex items-center gap-x-1"+ href={`${DOCS_URL}/guides/database/connecting-to-postgres`}>Read docs <ExternalLink size={12} strokeWidth={1.5} />- </Link>+ </InlineLink></p></div>diff --git a/apps/studio/components/interfaces/Database/Backups/BackupsEmpty.tsx b/apps/studio/components/interfaces/Database/Backups/BackupsEmpty.tsxindex fd00454dadf..12bbcc53be6 100644--- a/apps/studio/components/interfaces/Database/Backups/BackupsEmpty.tsx+++ b/apps/studio/components/interfaces/Database/Backups/BackupsEmpty.tsx@@ -1,12 +1,13 @@-import { Info } from 'lucide-react'+import { DatabaseBackup } from 'lucide-react'++import { EmptyStatePresentational } from 'ui-patterns'export const BackupsEmpty = () => {return (- <div className="block w-full rounded border border-muted border-opacity-50 bg-gray-300 p-3">- <div className="flex space-x-3">- <Info size={20} strokeWidth={1.5} />- <p className="text-sm">No backups created yet - check again tomorrow.</p>- </div>- </div>+ <EmptyStatePresentational+ icon={DatabaseBackup}+ title="No backups yet"+ description="Check again tomorrow."+ />)}diff --git a/apps/studio/components/interfaces/Database/Migrations/Migrations.tsx b/apps/studio/components/interfaces/Database/Migrations/Migrations.tsxindex dd8cdfaf9ed..407f2e74397 100644--- a/apps/studio/components/interfaces/Database/Migrations/Migrations.tsx+++ b/apps/studio/components/interfaces/Database/Migrations/Migrations.tsx@@ -21,7 +21,7 @@ import {TableRow,} from 'ui'import { Admonition } from 'ui-patterns'-import MigrationsEmptyState from './MigrationsEmptyState'+import { MigrationsEmptyState } from './MigrationsEmptyState'const Migrations = () => {const [search, setSearch] = useState('')@@ -83,15 +83,15 @@ const Migrations = () => {{data.length > 0 && (<>- <div className="w-80 mb-4">- <Input- size="small"- placeholder="Search for a migration"- value={search}- onChange={(e: any) => setSearch(e.target.value)}- icon={<Search size="14" />}- />- </div>+ <Input+ size="tiny"+ placeholder="Search for a migration"+ value={search}+ className="w-full lg:w-52"+ onChange={(e: any) => setSearch(e.target.value)}+ icon={<Search size="14" />}+ />+<Card><Table><TableHeader>diff --git a/apps/studio/components/interfaces/Database/Migrations/MigrationsEmptyState.tsx b/apps/studio/components/interfaces/Database/Migrations/MigrationsEmptyState.tsxindex f827dd88ebe..5c4eda6e488 100644--- a/apps/studio/components/interfaces/Database/Migrations/MigrationsEmptyState.tsx+++ b/apps/studio/components/interfaces/Database/Migrations/MigrationsEmptyState.tsx@@ -1,13 +1,12 @@-import { Maximize2, Minimize2, Terminal } from 'lucide-react'-import { useState } from 'react'+import { Terminal } from 'lucide-react'import { useParams } from 'common'import CommandRender from 'components/interfaces/Functions/CommandRender'-import { cn, Collapsible } from 'ui'+import { Card, CardContent, CardHeader, CardTitle } from 'ui'+import { EmptyStatePresentational } from 'ui-patterns'-const MigrationsEmptyState = () => {+export const MigrationsEmptyState = () => {const { ref } = useParams()- const [showInstructions, setShowInstructions] = useState(false)const commands = [{@@ -33,7 +32,7 @@ const MigrationsEmptyState = () => {},},{- comment: 'Run all migrations against this project',+ comment: 'Run all migrations for this project',command: `supabase db push`,jsx: () => {return (@@ -46,58 +45,20 @@ const MigrationsEmptyState = () => {]return (- <div className="w-full p-4 md:p-12 bg-no-repeat border rounded bg-studio border-default">- <div className="space-y-4 md:space-y-8">- <div className="space-y-2 w-4/5">- <h4 className="text-lg">Database migrations</h4>- <p className="text-sm text-foreground-light">- Database changes are managed through "migrations" and they are a common way of tracking- changes to your database over time. You can run migrations against your project's- database via the Supabase CLI.- </p>- </div>-- <Collapsible open={showInstructions} onOpenChange={setShowInstructions}>- <Collapsible.Trigger asChild>- <button- type="button"- className={cn(- 'flex w-full items-center justify-between rounded py-3 px-6 text-foreground border bg-surface-100',- showInstructions && 'rounded-b-none'- )}- >- <div className="flex items-center justify-between gap-3 w-full">- <div className="flex items-center gap-3">- <div className="flex items-center justify-center w-8 h-8 p-2 border rounded bg-alternative">- <Terminal strokeWidth={2} />- </div>- <h4>Terminal instructions</h4>- </div>- {showInstructions ? (- <Minimize2- className="text-border-stronger transition data-open-parent:rotate-0 data-closed-parent:rotate-180"- strokeWidth={2}- width={14}- />- ) : (- <Maximize2- className="text-border-stronger transition data-open-parent:rotate-0 data-closed-parent:rotate-180"- strokeWidth={2}- width={14}- />- )}- </div>- </button>- </Collapsible.Trigger>- <Collapsible.Content>- <div className="border border-t-0 bg-surface-100 rounded-b py-3 px-6">- <CommandRender commands={commands} />- </div>- </Collapsible.Content>- </Collapsible>- </div>- </div>+ <EmptyStatePresentational+ icon={Terminal}+ title="Run your first migration"+ description="Create and run your first migration using the Supabase CLI."+ className="gap-y-6"+ >+ <Card>+ <CardHeader>+ <CardTitle>Terminal instructions</CardTitle>+ </CardHeader>+ <CardContent>+ <CommandRender commands={commands} />+ </CardContent>+ </Card>+ </EmptyStatePresentational>)}--export default MigrationsEmptyStatediff --git a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx b/apps/studio/components/interfaces/Database/Replication/Destinations.tsxindex b6ac02c09af..9aa73a00f24 100644--- a/apps/studio/components/interfaces/Database/Replication/Destinations.tsx+++ b/apps/studio/components/interfaces/Database/Replication/Destinations.tsx@@ -123,7 +123,7 @@ export const Destinations = () => {Add destination</Button>)}- <DocsButton href="https://supabase.com/docs/guides/database/replication" />+ <DocsButton href={`${DOCS_URL}/guides/database/replication`} /></div></div></div>diff --git a/apps/studio/components/interfaces/Database/RestoreToNewProject/RestoreToNewProject.tsx b/apps/studio/components/interfaces/Database/RestoreToNewProject/RestoreToNewProject.tsxindex eb37247d885..ebffb13fd31 100644--- a/apps/studio/components/interfaces/Database/RestoreToNewProject/RestoreToNewProject.tsx+++ b/apps/studio/components/interfaces/Database/RestoreToNewProject/RestoreToNewProject.tsx@@ -160,19 +160,17 @@ export const RestoreToNewProject = () => {return (<Admonitiontype="default"- title="Restore to new project requires physical backups"+ title="Physical backups are required"description={<>- Physical backups must be enabled to restore your database to a new project.- <br /> Find out more about how backups work at supabase{' '}+ Physical backups must be enabled to restore your database to a new project.{' '}<Linktarget="_blank"className="underline"href={`${DOCS_URL}/guides/platform/backups`}>- in our docs+ Learn more</Link>- .</>}/>diff --git a/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx b/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsxindex 3880fd9c62c..3b2035ce4ec 100644--- a/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx+++ b/apps/studio/components/interfaces/Database/Schemas/SchemaGraph.tsx@@ -1,14 +1,16 @@import type { PostgresSchema } from '@supabase/postgres-meta'import { toPng, toSvg } from 'html-to-image'-import { Check, Copy, Download, Loader2 } from 'lucide-react'+import { Check, Copy, Download, Loader2, Plus } from 'lucide-react'import { useTheme } from 'next-themes'+import Link from 'next/link'import { useEffect, useMemo, useState } from 'react'import ReactFlow, { Background, BackgroundVariant, MiniMap, useReactFlow } from 'reactflow'import 'reactflow/dist/style.css'import { toast } from 'sonner'+import { Button } from 'ui'+import { Admonition } from 'ui-patterns/admonition'import { LOCAL_STORAGE_KEYS, useParams } from 'common'-import ProductEmptyState from 'components/to-be-cleaned/ProductEmptyState'import AlertError from 'components/ui/AlertError'import { ButtonTooltip } from 'components/ui/ButtonTooltip'import SchemaSelector from 'components/ui/SchemaSelector'@@ -281,16 +283,17 @@ export const SchemaGraph = () => {{isSuccessTables && (<>{tables.length === 0 ? (- <div className="h-full flex items-center justify-center">- <ProductEmptyState- title="No tables created yet"- ctaButtonLabel="Create a new table"- ctaUrl={`/project/${ref}/editor?create=table`}+ <div className="flex items-center justify-center w-full h-full">+ <Admonition+ type="default"+ className="max-w-md"+ title="No tables in schema"+ description={`The “${selectedSchema}” schema doesn’t have any tables.`}>- <p className="text-sm text-foreground-light">- There are no tables found in the schema "{selectedSchema}"- </p>- </ProductEmptyState>+ <Button asChild className="mt-2" type="default" icon={<Plus />}>+ <Link href={`/project/${ref}/editor?create=table`}>New table</Link>+ </Button>+ </Admonition></div>) : (<div className="w-full h-full">diff --git a/apps/studio/components/interfaces/Database/Triggers/TriggersList/CreateTriggerButtons.tsx b/apps/studio/components/interfaces/Database/Triggers/TriggersList/CreateTriggerButtons.tsxnew file mode 100644index 00000000000..20ae766f291--- /dev/null+++ b/apps/studio/components/interfaces/Database/Triggers/TriggersList/CreateTriggerButtons.tsx@@ -0,0 +1,94 @@+import { Plus } from 'lucide-react'++import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'+import { ButtonTooltip } from 'components/ui/ButtonTooltip'+import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'+import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state'+import { AiIconAnimation } from 'ui'++interface CreateTriggerButtonsProps {+ hasTables: boolean+ canCreateTriggers: boolean+ selectedSchema: string+ onCreateTrigger: () => void+ showPlusIcon?: boolean+ buttonType?: 'default'+}++export const CreateTriggerButtons = ({+ hasTables,+ canCreateTriggers,+ selectedSchema,+ onCreateTrigger,+ showPlusIcon = true,+ buttonType,+}: CreateTriggerButtonsProps) => {+ const aiSnap = useAiAssistantStateSnapshot()+ const { openSidebar } = useSidebarManagerSnapshot()++ return (+ <div className="flex items-center gap-x-2">+ <ButtonTooltip+ type={buttonType}+ disabled={!hasTables || !canCreateTriggers}+ onClick={onCreateTrigger}+ className="flex-grow"+ icon={showPlusIcon ? <Plus /> : undefined}+ tooltip={{+ content: {+ side: 'bottom',+ text: !hasTables+ ? 'Create a table first before creating triggers'+ : !canCreateTriggers+ ? 'You need additional permissions to create triggers'+ : undefined,+ },+ }}+ >+ New trigger+ </ButtonTooltip>++ {hasTables && (+ <ButtonTooltip+ type="default"+ disabled={!hasTables || !canCreateTriggers}+ className="px-1 pointer-events-auto"+ icon={<AiIconAnimation size={16} />}+ onClick={() => {+ openSidebar(SIDEBAR_KEYS.AI_ASSISTANT)+ aiSnap.newChat({+ name: 'Create new trigger',+ initialInput: `Create a new trigger for the schema ${selectedSchema} that does ...`,+ suggestions: {+ title:+ 'I can help you create a new trigger, here are a few example prompts to get you started:',+ prompts: [+ {+ label: 'Log Changes',+ description: 'Create a trigger that logs changes to the users table',+ },+ {+ label: 'Update Timestamp',+ description: 'Create a trigger that updates updated_at timestamp',+ },+ {+ label: 'Validate Email',+ description: 'Create a trigger that validates email format before insert',+ },+ ],+ },+ })+ }}+ tooltip={{+ content: {+ side: 'bottom',+ text: !canCreateTriggers+ ? 'You need additional permissions to create triggers'+ : 'Create with Supabase Assistant',+ },+ }}+ />+ )}+ </div>+ )+}diff --git a/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx b/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsxindex f7c47373648..f38b19e69ab 100644--- a/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx+++ b/apps/studio/components/interfaces/Database/Triggers/TriggersList/TriggersList.tsx@@ -1,6 +1,6 @@import type { PostgresTrigger } from '@supabase/postgres-meta'import { PermissionAction } from '@supabase/shared-types/out/constants'-import { DatabaseZap, FunctionSquare, Plus, Search, Shield } from 'lucide-react'+import { DatabaseZap, Search } from 'lucide-react'import { parseAsBoolean, parseAsString, useQueryState } from 'nuqs'import { useRef, useState } from 'react'import { toast } from 'sonner'@@ -10,8 +10,8 @@ import { ProtectedSchemaWarning } from 'components/interfaces/Database/Protectedimport { DeleteTrigger } from 'components/interfaces/Database/Triggers/DeleteTrigger'import { TriggerSheet } from 'components/interfaces/Database/Triggers/TriggerSheet'import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'+import AlertError from 'components/ui/AlertError'-import { ButtonTooltip } from 'components/ui/ButtonTooltip'import SchemaSelector from 'components/ui/SchemaSelector'import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader'import { useDatabaseTriggerDeleteMutation } from 'data/database-triggers/database-trigger-delete-mutation'@@ -25,16 +25,9 @@ import { useIsProtectedSchema, useProtectedSchemas } from 'hooks/useProtectedSchimport { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'import { useEditorPanelStateSnapshot } from 'state/editor-panel-state'import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state'-import {- AiIconAnimation,- Card,- Input,- Table,- TableBody,- TableHead,- TableHeader,- TableRow,-} from 'ui'+import { Card, Input, Table, TableBody, TableHead, TableHeader, TableRow } from 'ui'+import { EmptyStatePresentational } from 'ui-patterns'+import { CreateTriggerButtons } from './CreateTriggerButtons'import { TriggerList } from './TriggerList'import { generateTriggerCreateSQL } from './TriggerList.utils'@@ -204,106 +197,33 @@ execute function function_name();`)/></div>{!isSchemaLocked && (- <div className="flex items-center gap-x-2">- <ButtonTooltip- disabled={!hasTables || !canCreateTriggers}- icon={<Plus />}- onClick={() => createTrigger()}- className="flex-grow"- tooltip={{- content: {- side: 'bottom',- text: !hasTables- ? 'Create a table first before creating triggers'- : !canCreateTriggers- ? 'You need additional permissions to create triggers'- : undefined,- },- }}- >- New trigger- </ButtonTooltip>-- {hasTables && (- <ButtonTooltip- type="default"- disabled={!hasTables || !canCreateTriggers}- className="px-1 pointer-events-auto"- icon={<AiIconAnimation size={16} />}- onClick={() => {- openSidebar(SIDEBAR_KEYS.AI_ASSISTANT)- aiSnap.newChat({- name: 'Create new trigger',- initialInput: `Create a new trigger for the schema ${selectedSchema} that does ...`,- suggestions: {- title:- 'I can help you create a new trigger, here are a few example prompts to get you started:',- prompts: [- {- label: 'Log Changes',- description: 'Create a trigger that logs changes to the users table',- },- {- label: 'Update Timestamp',- description: 'Create a trigger that updates updated_at timestamp',- },- {- label: 'Validate Email',- description:- 'Create a trigger that validates email format before insert',- },- ],- },- })- }}- tooltip={{- content: {- side: 'bottom',- text: !canCreateTriggers- ? 'You need additional permissions to create triggers'- : 'Create with Supabase Assistant',- },- }}- />- )}- </div>+ <CreateTriggerButtons+ hasTables={hasTables}+ canCreateTriggers={canCreateTriggers}+ selectedSchema={selectedSchema}+ onCreateTrigger={createTrigger}+ showPlusIcon={true}+ />)}</div>{isSchemaLocked && <ProtectedSchemaWarning schema={selectedSchema} entity="triggers" />}{!isSchemaLocked && (schemaTriggers ?? []).length === 0 ? (- <Card className="grid grid-cols-1 @xl:grid-cols-3 bg divide-x @container">- <div className="flex flex-col h-full p-6">- <div className="flex items-center gap-3 mb-2">- <DatabaseZap strokeWidth={1.5} size={16} className="text-foreground-light" />- <h3 className="heading-default">Create realtime experiences</h3>- </div>- <p className="text-foreground-light text-sm flex-1">- Keep your application in sync by automatically updating when data changes- </p>- </div>-- <div className="flex flex-col h-full p-6">- <div className="flex items-center gap-3 mb-2">- <FunctionSquare strokeWidth={1.5} size={16} className="text-foreground-light" />- <h3 className="heading-default">Trigger an edge function</h3>- </div>- <p className="text-foreground-light text-sm flex-1">- Automatically invoke edge functions when database events occur- </p>- </div>-- <div className="flex flex-col h-full p-6">- <div className="flex items-center gap-3 mb-2">- <Shield strokeWidth={1.5} size={16} className="text-foreground-light" />- <h3 className="heading-default">Validate data</h3>- </div>- <p className="text-foreground-light text-sm flex-1">- Ensure data meets your requirements before it is inserted into the database- </p>- </div>- </Card>+ <EmptyStatePresentational+ icon={DatabaseZap}+ title="Add your first trigger"+ description="Make your database reactive. Send updates in realtime, call edge functions, or validate data as it comes in."+ >+ <CreateTriggerButtons+ hasTables={hasTables}+ canCreateTriggers={canCreateTriggers}+ selectedSchema={selectedSchema}+ onCreateTrigger={createTrigger}+ showPlusIcon={false}+ buttonType="default"+ />+ </EmptyStatePresentational>) : (<div className="w-full overflow-hidden overflow-x-auto"><Card>diff --git a/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx b/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsxindex fd842256727..fec77905062 100644--- a/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx+++ b/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx@@ -4,11 +4,11 @@ import { useRouter } from 'next/router'import { useMemo } from 'react'import { useParams } from 'common'+import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'import { ScaffoldSectionTitle } from 'components/layouts/Scaffold'import { DocsButton } from 'components/ui/DocsButton'import { ResourceItem } from 'components/ui/Resource/ResourceItem'import { ResourceList } from 'components/ui/Resource/ResourceList'-import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'import { useSendEventMutation } from 'data/telemetry/send-event-mutation'import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'@@ -59,7 +59,7 @@ export const FunctionsEmptyState = () => {<><Card><CardHeader>- <CardTitle>Create your first edge function</CardTitle>+ <CardTitle>Deploy your first edge function</CardTitle></CardHeader><CardContent className="p-0 grid grid-cols-[repeat(auto-fit,minmax(240px,1fr))] divide-y md:divide-y-0 md:divide-x divide-default items-stretch">{/* Editor Option */}diff --git a/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.utils.tsx b/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.utils.tsxindex be2fe1fbb65..4bdb2dc8238 100644--- a/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.utils.tsx+++ b/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.utils.tsx@@ -1,16 +1,7 @@-import {- BarChart3,- Code,- Database,- GitBranch,- Shield,- Table,- Upload,- User,- UserPlus,-} from 'lucide-react'+import { BarChart3, Code, Database, GitBranch, Shield, Table, Upload, UserPlus } from 'lucide-react'import { FRAMEWORKS } from 'components/interfaces/Connect/Connect.constants'+import { DOCS_URL } from 'lib/constants'import { AiIconAnimation, CodeBlock } from 'ui'import type { GettingStartedAction, GettingStartedStep } from './GettingStarted.types'import type { GettingStartedStatuses } from './useGettingStartedProgress'@@ -74,7 +65,7 @@ export const getCodeWorkflowSteps = ({actions: [{label: 'Create schema file',- href: 'https://supabase.com/docs/guides/local-development/declarative-database-schemas',+ href: `${DOCS_URL}/guides/local-development/declarative-database-schemas`,variant: 'default',},{@@ -99,7 +90,7 @@ export const getCodeWorkflowSteps = ({actions: [{label: 'Create a seed file',- href: 'https://supabase.com/docs/guides/local-development/seeding-your-database',+ href: `${DOCS_URL}/guides/local-development/seeding-your-database`,variant: 'default',},{@@ -158,7 +149,7 @@ export const getCodeWorkflowSteps = ({actions: [{label: 'Read docs',- href: 'https://supabase.com/docs/guides/auth',+ href: `${DOCS_URL}/guides/auth`,variant: 'default',},],@@ -173,12 +164,12 @@ export const getCodeWorkflowSteps = ({actions: [{label: 'Create a bucket via SQL',- href: 'https://supabase.com/docs/guides/storage/buckets/creating-buckets?queryGroups=language&language=sql',+ href: `${DOCS_URL}/guides/storage/buckets/creating-buckets?queryGroups=language&language=sql`,variant: 'default',},{label: 'Upload a file',- href: 'https://supabase.com/docs/guides/storage/uploads/standard-uploads',+ href: `${DOCS_URL}/guides/storage/uploads/standard-uploads`,variant: 'default',},],@@ -193,7 +184,7 @@ export const getCodeWorkflowSteps = ({actions: [{label: 'Create and deploy via CLI',- href: `https://supabase.com/docs/guides/functions/quickstart`,+ href: `${DOCS_URL}/guides/functions/quickstart`,variant: 'default',},{ label: 'View functions', href: `/project/${ref}/functions`, variant: 'default' },@@ -331,7 +322,7 @@ export const getNoCodeWorkflowSteps = ({actions: [{label: 'Read docs',- href: 'https://supabase.com/docs/guides/auth',+ href: `${DOCS_URL}/guides/auth`,variant: 'default',},],diff --git a/apps/studio/components/interfaces/Integrations/Queues/QueuesSettings.tsx b/apps/studio/components/interfaces/Integrations/Queues/QueuesSettings.tsxindex a7c3643025e..f4ad4bf11bd 100644--- a/apps/studio/components/interfaces/Integrations/Queues/QueuesSettings.tsx+++ b/apps/studio/components/interfaces/Integrations/Queues/QueuesSettings.tsx@@ -12,6 +12,7 @@ import {FormPanelContent,FormPanelFooter,} from 'components/ui/Forms/FormPanel'+import { InlineLink } from 'components/ui/InlineLink'import { useProjectPostgrestConfigQuery } from 'data/config/project-postgrest-config-query'import { useProjectPostgrestConfigUpdateMutation } from 'data/config/project-postgrest-config-update-mutation'import { useQueuesExposePostgrestStatusQuery } from 'data/database-queues/database-queues-expose-postgrest-status-query'@@ -24,7 +25,7 @@ import { useTableUpdateMutation } from 'data/tables/table-update-mutation'import { useTablesQuery } from 'data/tables/tables-query'import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'-import { IS_PLATFORM } from 'lib/constants'+import { DOCS_URL, IS_PLATFORM } from 'lib/constants'import {Button,Form_Shadcn_,@@ -32,7 +33,6 @@ import {FormField_Shadcn_,FormItem_Shadcn_,Switch,- TextLink,} from 'ui'import { Admonition } from 'ui-patterns'import ConfirmationModal from 'ui-patterns/Dialogs/ConfirmationModal'@@ -233,12 +233,11 @@ export const QueuesSettings = () => {the <code className="text-code-inline">{QUEUES_SCHEMA}</code>{' '}schema.<br />- <TextLink- target="_blank"- className="mt-0 inline-block"- label="Learn more"- url="https://supabase.com/docs/guides/queues/expose-self-hosted-queues"- />+ <InlineLink+ href={`${DOCS_URL}/guides/queues/expose-self-hosted-queues`}+ >+ Learn more+ </InlineLink></div>) : null}</>diff --git a/apps/studio/components/interfaces/LogDrains/LogDrainsEmpty.tsx b/apps/studio/components/interfaces/LogDrains/LogDrainsEmpty.tsxindex d6c2e22372d..b3bc7742186 100644--- a/apps/studio/components/interfaces/LogDrains/LogDrainsEmpty.tsx+++ b/apps/studio/components/interfaces/LogDrains/LogDrainsEmpty.tsx@@ -1,9 +1,10 @@-import { Button, Card, cn } from 'ui'+import { IS_PLATFORM } from 'common'+import { UpgradePlanButton } from 'components/ui/UpgradePlanButton'+import { DOCS_URL } from 'lib/constants'import Link from 'next/link'+import { Button, Card, cn } from 'ui'import { AnimatedLogos } from './AnimatedLogos'-import { UpgradePlanButton } from 'components/ui/UpgradePlanButton'import { VoteLink } from './VoteLink'-import { IS_PLATFORM } from 'common'export const LogDrainsEmpty = () => {const items = [@@ -13,7 +14,7 @@ export const LogDrainsEmpty = () => {description:'Log Drains are available as a project Add-On for all Team and Enterprise users. Each Log Drain costs $60 per month.',label: 'See our pricing',- link: 'https://supabase.com/docs/guides/platform/manage-your-usage/log-drains',+ link: `${DOCS_URL}/guides/platform/manage-your-usage/log-drains`,},{step: 2,@@ -21,7 +22,7 @@ export const LogDrainsEmpty = () => {description:'We offer support for multiple destinations including Datadog, Loki, Sentry or a custom endpoint.',label: 'Read our documentation',- link: 'https://supabase.com/docs/guides/telemetry/log-drains',+ link: `${DOCS_URL}/guides/telemetry/log-drains`,},].filter((item) => IS_PLATFORM || item.title !== 'Pricing')diff --git a/apps/studio/components/interfaces/Organization/NewOrg/UpgradeExistingOrganizationCallout.tsx b/apps/studio/components/interfaces/Organization/NewOrg/UpgradeExistingOrganizationCallout.tsxindex d8403ca4279..f8012df79c8 100644--- a/apps/studio/components/interfaces/Organization/NewOrg/UpgradeExistingOrganizationCallout.tsx+++ b/apps/studio/components/interfaces/Organization/NewOrg/UpgradeExistingOrganizationCallout.tsx@@ -1,5 +1,6 @@import { InlineLink } from 'components/ui/InlineLink'import Panel from 'components/ui/Panel'+import { DOCS_URL } from 'lib/constants'import { Admonition } from 'ui-patterns'export const UpgradeExistingOrganizationCallout = () => {@@ -12,7 +13,7 @@ export const UpgradeExistingOrganizationCallout = () => {<div><p className="text-sm text-foreground-light">Supabase{' '}- <InlineLink href="https://supabase.com/docs/guides/platform/billing-on-supabase">+ <InlineLink href={`${DOCS_URL}/guides/platform/billing-on-supabase`}>bills per organization</InlineLink>. If you want to upgrade your existing projects,{' '}diff --git a/apps/studio/components/interfaces/Realtime/Inspector/EmptyRealtime.tsx b/apps/studio/components/interfaces/Realtime/Inspector/EmptyRealtime.tsxindex 9a8019083d3..b705d5ce902 100644--- a/apps/studio/components/interfaces/Realtime/Inspector/EmptyRealtime.tsx+++ b/apps/studio/components/interfaces/Realtime/Inspector/EmptyRealtime.tsx@@ -1,9 +1,10 @@-import { AiIconAnimation, Button, Card, cn } from 'ui'+import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'+import { DOCS_URL } from 'lib/constants'import Link from 'next/link'-import { AnimatedCursors } from './AnimatedCursors'import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'-import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state'+import { AiIconAnimation, Button, Card, cn } from 'ui'+import { AnimatedCursors } from './AnimatedCursors'/*** Acts as a container component for the entire log display@@ -92,7 +93,9 @@ export const EmptyRealtime = ({ projectRef }: { projectRef: string }) => {Receive realtime messages in your application by listening to a channel</p><Button type="default" asChild>- <Link href="https://supabase.com/docs/guides/realtime/subscribing-to-database-changes#listening-on-client-side">+ <Link+ href={`${DOCS_URL}/guides/realtime/subscribing-to-database-changes#listening-on-client-side`}+ >Read the guide</Link></Button>diff --git a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/index.tsx b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/index.tsxindex ba9eeab32bf..ae2196de2bc 100644--- a/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/index.tsx+++ b/apps/studio/components/interfaces/Storage/AnalyticsBuckets/AnalyticsBucketDetails/index.tsx@@ -2,8 +2,8 @@ import { uniq } from 'lodash'import { Loader2, SquarePlus } from 'lucide-react'import Link from 'next/link'import { useRouter } from 'next/router'-import { useEffect, useMemo, useState } from 'react'import { parseAsBoolean, useQueryState } from 'nuqs'+import { useEffect, useMemo, useState } from 'react'import { useParams } from 'common'import { INTEGRATIONS } from 'components/interfaces/Integrations/Landing/Integrations.constants'@@ -30,6 +30,7 @@ import { useIcebergWrapperCreateMutation } from 'data/storage/iceberg-wrapper-crimport { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'import { DOCS_URL } from 'lib/constants'import { Button, Card, CardContent } from 'ui'+import { EmptyStatePresentational } from 'ui-patterns'import { Admonition } from 'ui-patterns/admonition'import { GenericTableLoader } from 'ui-patterns/ShimmeringLoader'import { DeleteAnalyticsBucketModal } from '../DeleteAnalyticsBucketModal'@@ -216,35 +217,30 @@ export const AnalyticBucketDetails = () => {{HIDE_REPLICATION_USER_FLOW ? (<CreateTableInstructions />) : isPollingForData ? (- <aside className="border border-dashed w-full bg-surface-100 rounded-lg px-4 py-10 flex flex-col gap-y-3 items-center text-center gap-1 text-balance">- <Loader2- size={24}- strokeWidth={1.5}- className="animate-spin text-foreground-muted"- />- <div className="flex flex-col items-center text-center">- <h3>Connecting table(s) to bucket</h3>- <p className="text-foreground-light text-sm">- Tables will be shown here once the connection is complete- </p>- </div>- </aside>+ <EmptyStatePresentational+ icon={+ <Loader2+ size={24}+ strokeWidth={1.5}+ className="animate-spin text-foreground-muted"+ />+ }+ title="Connecting table(s) to bucket"+ description="Tables will be shown here once the connection is complete"+ />) : (- <aside className="border border-dashed w-full bg-surface-100 rounded-lg px-4 py-10 flex flex-col gap-y-3 items-center text-center gap-1 text-balance">- <SquarePlus size={24} strokeWidth={1.5} className="text-foreground-muted" />- <div className="flex flex-col items-center text-center">- <h3>Connect database tables</h3>- <p className="text-foreground-light text-sm">- Stream table data for continuous backups and analysis- </p>- </div>+ <EmptyStatePresentational+ icon={SquarePlus}+ title="Connect database tables"+ description="Stream table data for continuous backups and analysis"+ ><ConnectTablesDialogonSuccessConnectTables={() => {setPollIntervalNamespaces(4000)setPollIntervalNamespaceTables(4000)}}/>- </aside>+ </EmptyStatePresentational>)}</>) : (diff --git a/apps/studio/components/interfaces/Storage/BucketsComingSoon.tsx b/apps/studio/components/interfaces/Storage/BucketsComingSoon.tsxindex d7f1e3fe827..9b2f0ef7a42 100644--- a/apps/studio/components/interfaces/Storage/BucketsComingSoon.tsx+++ b/apps/studio/components/interfaces/Storage/BucketsComingSoon.tsx@@ -3,23 +3,23 @@ import Link from 'next/link'import { ScaffoldSection } from 'components/layouts/Scaffold'import { Button } from 'ui'+import { EmptyStatePresentational } from 'ui-patterns'import { BUCKET_TYPES } from './Storage.constants'export const BucketsComingSoon = ({ type }: { type: 'analytics' | 'vector' }) => {return (<ScaffoldSection isFullWidth>- <aside className="border border-dashed w-full bg-surface-100 rounded-lg px-4 py-10 flex flex-col gap-y-3 items-center text-center gap-1 text-balance">- <FolderClock size={24} strokeWidth={1.5} className="text-foreground-muted" />- <div className="flex flex-col items-center text-center">- <h3>Coming soon</h3>- <p className="text-foreground-light text-sm">- {type === 'analytics'- ? BUCKET_TYPES.analytics.valueProp- : type === 'vector'- ? BUCKET_TYPES.vectors.valueProp- : undefined}- </p>- </div>+ <EmptyStatePresentational+ icon={FolderClock}+ title="Coming soon"+ description={+ type === 'analytics'+ ? BUCKET_TYPES.analytics.valueProp+ : type === 'vector'+ ? BUCKET_TYPES.vectors.valueProp+ : undefined+ }+ >{type === 'analytics' && (<Button asChild type="default" icon={<ExternalLink />}><Link@@ -31,7 +31,7 @@ export const BucketsComingSoon = ({ type }: { type: 'analytics' | 'vector' }) =></Link></Button>)}- </aside>+ </EmptyStatePresentational></ScaffoldSection>)}diff --git a/apps/studio/components/interfaces/Storage/BucketsUpgradePlan.tsx b/apps/studio/components/interfaces/Storage/BucketsUpgradePlan.tsxindex ee18861f146..5867a855dc9 100644--- a/apps/studio/components/interfaces/Storage/BucketsUpgradePlan.tsx+++ b/apps/studio/components/interfaces/Storage/BucketsUpgradePlan.tsx@@ -2,6 +2,7 @@ import { ScaffoldSection } from 'components/layouts/Scaffold'import { AlphaNotice } from 'components/ui/AlphaNotice'import { UpgradePlanButton } from 'components/ui/UpgradePlanButton'import { AnalyticsBucket as AnalyticsBucketIcon, VectorBucket as VectorBucketIcon } from 'icons'+import { EmptyStatePresentational } from 'ui-patterns'import { BUCKET_TYPES } from './Storage.constants'export const BucketsUpgradePlan = ({ type }: { type: 'analytics' | 'vector' }) => {@@ -15,28 +16,17 @@ export const BucketsUpgradePlan = ({ type }: { type: 'analytics' | 'vector' }) =: 'https://github.com/orgs/supabase/discussions/40815'}/>- <aside className="border border-dashed w-full bg-surface-100 rounded-lg px-4 py-10 flex flex-col gap-y-4 items-center text-center gap-1 text-balance">- {type === 'analytics' ? (- <AnalyticsBucketIcon size={24} strokeWidth={1.5} className="text-foreground-muted" />- ) : (- <VectorBucketIcon size={24} strokeWidth={1.5} className="text-foreground-muted" />- )}- <div className="flex flex-col gap-y-1 items-center text-center">- <h3>- {type === 'analytics'- ? BUCKET_TYPES.analytics.valueProp- : type === 'vector'- ? BUCKET_TYPES.vectors.valueProp- : undefined}- </h3>- <p className="text-foreground-light text-sm">- Upgrade to Pro to use {type} buckets for your project- </p>- </div>+ <EmptyStatePresentational+ icon={type === 'analytics' ? AnalyticsBucketIcon : VectorBucketIcon}+ title={+ type === 'analytics' ? BUCKET_TYPES.analytics.valueProp : BUCKET_TYPES.vectors.valueProp+ }+ description={`Upgrade to Pro to use ${type} buckets for your project`}+ ><div className="flex items-center gap-x-2"><UpgradePlanButton type="primary" plan="Pro" /></div>- </aside>+ </EmptyStatePresentational></ScaffoldSection>)}diff --git a/apps/studio/components/interfaces/Storage/EmptyBucketState.tsx b/apps/studio/components/interfaces/Storage/EmptyBucketState.tsxindex 2b684e23e84..6301629a741 100644--- a/apps/studio/components/interfaces/Storage/EmptyBucketState.tsx+++ b/apps/studio/components/interfaces/Storage/EmptyBucketState.tsx@@ -1,5 +1,5 @@import { BucketPlus } from 'icons'-import { cn } from 'ui'+import { EmptyStatePresentational } from 'ui-patterns'import { CreateAnalyticsBucketModal } from './AnalyticsBuckets/CreateAnalyticsBucketModal'import { CreateBucketModal } from './CreateBucketModal'import { BUCKET_TYPES } from './Storage.constants'@@ -14,21 +14,12 @@ export const EmptyBucketState = ({ bucketType, className }: EmptyBucketStatePropconst config = BUCKET_TYPES[bucketType]return (- <aside- className={cn(- 'border border-dashed w-full bg-surface-100 rounded-lg px-4 py-10 flex flex-col gap-y-3 items-center text-center text-balance',- className- )}+ <EmptyStatePresentational+ icon={BucketPlus}+ title={`Create ${config.article} ${config.singularName} bucket`}+ description={config.valueProp}+ className={className}>- <BucketPlus size={24} strokeWidth={1.5} className="text-foreground-muted" />-- <div className="flex flex-col items-center text-center">- <h3>- Create {config.article} {config.singularName} bucket- </h3>- <p className="text-foreground-light text-sm">{config.valueProp}</p>- </div>-{bucketType === 'files' && (<CreateBucketModal buttonSize="tiny" buttonType="primary" buttonClassName="w-fit" />)}@@ -40,6 +31,6 @@ export const EmptyBucketState = ({ bucketType, className }: EmptyBucketStateProp/>)}{bucketType === 'vectors' && <CreateVectorBucketDialog />}- </aside>+ </EmptyStatePresentational>)}diff --git a/apps/studio/components/interfaces/Storage/Storage.constants.ts b/apps/studio/components/interfaces/Storage/Storage.constants.tsindex 9b03f757cd5..c8669b8ab27 100644--- a/apps/studio/components/interfaces/Storage/Storage.constants.ts+++ b/apps/studio/components/interfaces/Storage/Storage.constants.ts@@ -66,7 +66,7 @@ export const BUCKET_TYPES = {singularName: 'file',article: 'a',description: 'General file storage for most types of digital content',- valueProp: 'Store images, videos, documents, and any other file type',+ valueProp: 'Store images, videos, documents, and any other file type.',docsUrl: `${DOCS_URL}/guides/storage/buckets/fundamentals`,},analytics: {@@ -74,7 +74,7 @@ export const BUCKET_TYPES = {singularName: 'analytics',article: 'an',description: 'Purpose-built storage for analytical workloads',- valueProp: 'Store large datasets for analytics and reporting',+ valueProp: 'Store large datasets for analytics and reporting.',docsUrl: `${DOCS_URL}/guides/storage/analytics/introduction`,},vectors: {@@ -82,7 +82,7 @@ export const BUCKET_TYPES = {singularName: 'vector',article: 'a',description: 'Purpose-built storage for vector data',- valueProp: 'Store, index, and query your vector embeddings at scale',+ valueProp: 'Store, index, and query your vector embeddings at scale.',docsUrl: `${DOCS_URL}/guides/storage/vector/introduction`,},}diff --git a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/HeaderTitle.tsx b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/HeaderTitle.tsxindex 3099ca5b14a..2c433e3c8b1 100644--- a/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/HeaderTitle.tsx+++ b/apps/studio/components/interfaces/TableGridEditor/SidePanelEditor/TableEditor/HeaderTitle.tsx@@ -8,20 +8,20 @@ const HeaderTitle = ({ schema, table, isDuplicating }: HeaderTitleProps) => {if (!table) {return (<>- Create a new table under <code className="text-sm">{schema}</code>+ Create a new table under <code className="text-code-inline !text-sm">{schema}</code></>)}if (isDuplicating) {return (<>- Duplicate table <code className="text-sm">{table?.name}</code>+ Duplicate table <code className="text-code-inline !text-sm">{table?.name}</code></>)}return (<>- Update table <code className="text-sm">{table?.name}</code>+ Update table <code className="text-code-inline !text-sm">{table?.name}</code></>)}diff --git a/apps/studio/pages/project/[ref]/database/migrations.tsx b/apps/studio/pages/project/[ref]/database/migrations.tsxindex f456e997e91..7bd4c947508 100644--- a/apps/studio/pages/project/[ref]/database/migrations.tsx+++ b/apps/studio/pages/project/[ref]/database/migrations.tsx@@ -22,9 +22,7 @@ const MigrationsPage: NextPageWithLayout = () => {<PageHeaderMeta><PageHeaderSummary><PageHeaderTitle>Database Migrations</PageHeaderTitle>- <PageHeaderDescription>- History of migrations that have been run on your database- </PageHeaderDescription>+ <PageHeaderDescription>Track changes to your database over time</PageHeaderDescription></PageHeaderSummary><PageHeaderAside><DocsButtondiff --git a/apps/studio/pages/project/[ref]/database/triggers.tsx b/apps/studio/pages/project/[ref]/database/triggers.tsxindex 44a4f0be1f1..17c95d421d4 100644--- a/apps/studio/pages/project/[ref]/database/triggers.tsx+++ b/apps/studio/pages/project/[ref]/database/triggers.tsx@@ -36,7 +36,7 @@ const TriggersPage: NextPageWithLayout = () => {<PageHeaderSummary><PageHeaderTitle>Database Triggers</PageHeaderTitle><PageHeaderDescription>- Execute a set of actions automatically on specified table events+ Execute actions automatically when table events occur</PageHeaderDescription></PageHeaderSummary><PageHeaderAside>diff --git a/packages/ui-patterns/index.tsx b/packages/ui-patterns/index.tsxindex 6d6b600d4a3..2b253af7961 100644--- a/packages/ui-patterns/index.tsx+++ b/packages/ui-patterns/index.tsx@@ -8,6 +8,7 @@ export * from './src/AuthenticatedDropdownMenu'export * from './src/Banners'export * from './src/CommandMenu'export * from './src/ComputeBadge'+export * from './src/EmptyStatePresentational'export * from './src/FilterBar'export * from './src/GlassPanel'export * from './src/InnerSideMenu'diff --git a/packages/ui-patterns/src/EmptyStatePresentational/index.tsx b/packages/ui-patterns/src/EmptyStatePresentational/index.tsxnew file mode 100644index 00000000000..cfa533127cf--- /dev/null+++ b/packages/ui-patterns/src/EmptyStatePresentational/index.tsx@@ -0,0 +1,106 @@+import type { LucideIcon } from 'lucide-react'+import { createElement, isValidElement, ReactNode } from 'react'++import { cn } from 'ui'++export interface EmptyStatePresentationalProps {+ icon?: LucideIcon | ReactNode+ title: string+ description?: string | ReactNode+ children?: ReactNode+ className?: string+ iconSize?: number+ iconClassName?: string+ contentClassName?: string+}++/**+ * EmptyStatePresentational component for displaying presentational empty states with icons, titles, descriptions, and optional actions.+ *+ * This component is specifically designed for initial state scenarios where users are learning about a feature for the first time.+ * It emphasizes value propositions and provides clear actions users can take.+ *+ * Supports both Lucide icons (component types) and custom ReactNode icons (like forwardRef components from 'icons' package).+ * Automatically handles rendering icons whether they're passed as component types or pre-rendered elements.+ *+ * @example+ * ```tsx+ * // With Lucide icon component type+ * <EmptyStatePresentational+ * icon={DatabaseBackup}+ * title="No backups yet"+ * description="Check again tomorrow."+ * />+ *+ * // With custom icon element+ * <EmptyStatePresentational+ * icon={<Loader2 className="animate-spin" />}+ * title="Loading..."+ * description="Please wait"+ * />+ *+ * // With action button+ * <EmptyStatePresentational+ * icon={BucketPlus}+ * title="Create a vector bucket"+ * description="Store, index, and query your vector embeddings at scale."+ * >+ * <Button>Create bucket</Button>+ * </EmptyStatePresentational>+ * ```+ */+export const EmptyStatePresentational = ({+ icon: Icon,+ title,+ description,+ children,+ className,+ iconSize = 24,+ iconClassName,+ contentClassName,+}: EmptyStatePresentationalProps) => {+ // Extract content rendering to avoid duplication between icon and no-icon cases+ const textContent = (+ <div className={cn('flex flex-col items-center text-center text-balance', contentClassName)}>+ <h3>{title}</h3>+ {description && <p className="text-foreground-light text-sm max-w-[640px]">{description}</p>}+ </div>+ )++ return (+ <aside+ className={cn(+ 'border border-dashed w-full bg-surface-100 rounded-lg px-4 py-10 flex flex-col items-center gap-y-3',+ className+ )}+ >+ {Icon ? (+ <div className="flex flex-col gap-y-3 items-center">+ {/*+ Handle different icon types:+ 1. If it's already a React element (pre-rendered), render it directly+ 2. If it's a function (LucideIcon component type) or forwardRef component (has $$typeof),+ instantiate it with createElement and apply default props+ 3. Otherwise, render as-is (fallback for other ReactNode types)+ */}+ {isValidElement(Icon)+ ? Icon+ : typeof Icon === 'function' ||+ (typeof Icon === 'object' && Icon !== null && '$$typeof' in Icon)+ ? createElement(Icon as LucideIcon, {+ size: iconSize,+ strokeWidth: 1.5,+ className: cn('text-foreground-muted', iconClassName),+ })+ : Icon}+ {textContent}+ </div>+ ) : (+ textContent+ )}++ {/* Optional children (typically action buttons) */}+ {children}+ </aside>+ )+}