Skip to content

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

feat(studio): polish Connect sheet mode selector and steps (#48266)

Danny White6cff72874234
diff --git a/apps/studio/components/interfaces/ConnectSheet/Connect.constants.ts b/apps/studio/components/interfaces/ConnectSheet/Connect.constants.ts
index 2d7673555a0..86071ccaef9 100644
--- a/apps/studio/components/interfaces/ConnectSheet/Connect.constants.ts
+++ b/apps/studio/components/interfaces/ConnectSheet/Connect.constants.ts
@@ -396,7 +396,7 @@ export const connectionStringMethodOptions: Record<
value: 'direct',
label: 'Direct connection',
description:
- 'Ideal for applications with persistent and long-lived connections, such as those running on virtual machines or long-standing containers.',
+ 'Ideal for applications with persistent and long-lived connections such as those running on virtual machines or long-standing containers.',
},
transaction: {
value: 'transaction',
@@ -408,6 +408,6 @@ export const connectionStringMethodOptions: Record<
value: 'session',
label: 'Session pooler',
description:
- 'Only recommended as an alternative to Direct Connection, when connecting via an IPv4 network.',
+ 'Only recommended as an alternative to direct connection when connecting via an IPv4 network.',
},
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/Connect.types.ts b/apps/studio/components/interfaces/ConnectSheet/Connect.types.ts
index 675d6d7c473..2c863fdabb8 100644
--- a/apps/studio/components/interfaces/ConnectSheet/Connect.types.ts
+++ b/apps/studio/components/interfaces/ConnectSheet/Connect.types.ts
@@ -103,6 +103,8 @@ export interface StepDefinition {
id: string
title: string
description: string
+ /** When true, renders a muted "(optional)" label next to the title. */
+ optional?: boolean
// Component identifier or content file path, can be conditional
content: ConditionalValue<string | null>
}
@@ -142,6 +144,7 @@ export interface ResolvedStep {
id: string
title: string
description: string
+ optional?: boolean
content: string // Resolved component identifier
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/ConnectConfigSection.tsx b/apps/studio/components/interfaces/ConnectSheet/ConnectConfigSection.tsx
index ac4ef2009a1..bb21ae25718 100644
--- a/apps/studio/components/interfaces/ConnectSheet/ConnectConfigSection.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/ConnectConfigSection.tsx
@@ -1,4 +1,3 @@
-import { Box, Cable, Database, Server, Sparkles } from 'lucide-react'
import {
cn,
RadioGroupStacked,
@@ -21,14 +20,11 @@ import {
import type { ConnectMode, FieldOption, ResolvedField } from './Connect.types'
import { ConnectionIcon } from './ConnectionIcon'
-
-const MODE_ICONS: Record<string, React.ReactNode> = {
- framework: <Box size={16} strokeWidth={1.5} />,
- direct: <Database size={16} strokeWidth={1.5} />,
- orm: <Cable size={16} strokeWidth={1.5} />,
- mcp: <Sparkles size={16} strokeWidth={1.5} />,
- server: <Server size={16} strokeWidth={1.5} />,
-}
+import {
+ ConnectModeButton,
+ getConnectModeButtonCornerVariants,
+ getConnectModeEmptySlotClasses,
+} from './ConnectModeButton'
interface ConnectConfigSectionProps {
activeFields: ResolvedField[]
@@ -101,27 +97,22 @@ export function ConnectConfigSection({
<RadioGroupStacked
value={String(value ?? '')}
onValueChange={(v) => onFieldChange(field.id, v)}
+ className="min-w-0 w-full"
>
{options.map((option) => (
<RadioGroupStackedItem
key={option.value}
id={`connect-${field.id}-${option.value}`}
value={option.value}
- label=""
- className="w-full text-left"
- >
- <div className="flex flex-col gap-0.5">
- <div className="flex items-center gap-2">
+ className="min-w-0 w-full text-left"
+ label={
+ <span className="flex min-w-0 items-center gap-2">
{option.icon && <ConnectionIcon icon={option.icon} />}
- <span className="text-sm">{option.label}</span>
- </div>
- {option.description && (
- <span className="text-sm text-foreground-lighter">
- {option.description}
- </span>
- )}
- </div>
- </RadioGroupStackedItem>
+ <span className="truncate">{option.label}</span>
+ </span>
+ }
+ description={option.description}
+ />
))}
</RadioGroupStacked>
</FormItemLayout>
@@ -201,7 +192,7 @@ export function ConnectConfigSection({
>
<MultiSelectorTrigger
className="w-full"
- label="All features except Storage enabled by default"
+ label="Select features"
badgeLimit="wrap"
showIcon={true}
/>
@@ -244,31 +235,43 @@ interface ModeSelectorProps {
}
export function ModeSelector({ modes, selected, onChange }: ModeSelectorProps) {
+ const count = modes.length
+ // 2-col layout leaves an empty cell when count is odd; hide it once we switch to a single row
+ const emptySlots = count % 2 === 1 ? 1 : 0
+
return (
- <div
- className="grid rounded-lg border overflow-hidden"
- style={{ gridTemplateColumns: `repeat(${modes.length}, minmax(0, 1fr))` }}
- >
- {modes.map((mode) => (
- <button
- key={mode.id}
- type="button"
- tabIndex={0}
- onClick={() => onChange(mode.id)}
- className={cn(
- 'flex flex-col items-center gap-2 p-4 transition-colors border-r last:border-r-0',
- selected === mode.id
- ? 'bg-surface-200'
- : 'border-default hover:border-strong hover:bg-surface-100 '
- )}
- >
- <span className="text-foreground-light">{MODE_ICONS[mode.id]}</span>
- <div>
- <p className="heading-default text-center">{mode.label}</p>
- <p className="text-sm text-foreground-lighter text-center">{mode.description}</p>
- </div>
- </button>
- ))}
+ // Container query: 2-col when the sheet is narrow; one equal row when there's room
+ <div className="@container">
+ <div
+ className={cn(
+ 'grid',
+ 'grid-cols-2',
+ count === 3 && '@[28rem]:grid-cols-3',
+ count === 4 && '@[30rem]:grid-cols-4',
+ count === 5 && '@[32rem]:grid-cols-5',
+ count >= 6 && '@[36rem]:grid-cols-6'
+ )}
+ >
+ {modes.map((mode, index) => (
+ <ConnectModeButton
+ key={mode.id}
+ modeId={mode.id}
+ label={mode.label}
+ description={mode.description}
+ selected={selected === mode.id}
+ onClick={() => onChange(mode.id)}
+ {...getConnectModeButtonCornerVariants({ index, count, emptySlots })}
+ />
+ ))}
+
+ {Array.from({ length: emptySlots }, (_, index) => (
+ <div
+ key={`empty-${index}`}
+ aria-hidden
+ className={getConnectModeEmptySlotClasses(count)}
+ />
+ ))}
+ </div>
</div>
)
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/ConnectModeButton.tsx b/apps/studio/components/interfaces/ConnectSheet/ConnectModeButton.tsx
new file mode 100644
index 00000000000..3c6fd80b98e
--- /dev/null
+++ b/apps/studio/components/interfaces/ConnectSheet/ConnectModeButton.tsx
@@ -0,0 +1,302 @@
+import { cva, type VariantProps } from 'class-variance-authority'
+import { Box, Cable, Database, Server, Sparkles } from 'lucide-react'
+import type { ComponentPropsWithoutRef, ReactNode } from 'react'
+import { cn } from 'ui'
+
+import type { ConnectMode } from './Connect.types'
+
+const MODE_ICONS: Record<string, ReactNode> = {
+ framework: <Box size={16} strokeWidth={1.5} />,
+ direct: <Database size={16} strokeWidth={1.5} />,
+ orm: <Cable size={16} strokeWidth={1.5} />,
+ mcp: <Sparkles size={16} strokeWidth={1.5} />,
+ server: <Server size={16} strokeWidth={1.5} />,
+}
+
+/** Maps mode count → container-query breakpoint used when collapsing to a single row. */
+type ModeCountBreakpoint = 3 | 4 | 5 | 6
+
+function toModeCountBreakpoint(count: number): ModeCountBreakpoint {
+ if (count === 3 || count === 4 || count === 5) return count
+ return 6
+}
+
+const connectModeButtonVariants = cva(
+ [
+ // Each cell owns a border; adjacent edges overlap (RadioGroupStacked-style)
+ 'relative -mb-px -mr-px flex cursor-pointer flex-col items-center gap-2 border bg-overlay/50 p-4 shadow-xs transition-colors',
+ 'focus-visible:z-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background',
+ ],
+ {
+ variants: {
+ selected: {
+ true: 'z-1 border-foreground-muted bg-surface-300 ring-1 ring-border',
+ false:
+ 'hover:z-1 hover:border-foreground-muted hover:bg-background dark:hover:bg-surface-200',
+ },
+ // Narrow 2-col outer corners
+ topLeft: {
+ true: 'rounded-tl-lg',
+ false: '',
+ },
+ topRight: {
+ true: 'rounded-tr-lg',
+ false: '',
+ },
+ bottomLeft: {
+ true: 'rounded-bl-lg',
+ false: '',
+ },
+ bottomRight: {
+ true: 'rounded-br-lg',
+ false: '',
+ },
+ // Wide single-row reshaping (compounded with modeCount for the breakpoint)
+ singleRowStart: {
+ true: '',
+ false: '',
+ },
+ singleRowEnd: {
+ true: '',
+ false: '',
+ },
+ clearTopRight: {
+ true: '',
+ false: '',
+ },
+ clearBottomLeft: {
+ true: '',
+ false: '',
+ },
+ clearBottomRight: {
+ true: '',
+ false: '',
+ },
+ modeCount: {
+ 3: '',
+ 4: '',
+ 5: '',
+ 6: '',
+ },
+ },
+ compoundVariants: [
+ // Full class strings so Tailwind can see them (no dynamic fragment concatenation)
+ {
+ singleRowStart: true,
+ modeCount: 3,
+ class: '@[28rem]:rounded-tl-lg @[28rem]:rounded-bl-lg',
+ },
+ {
+ singleRowStart: true,
+ modeCount: 4,
+ class: '@[30rem]:rounded-tl-lg @[30rem]:rounded-bl-lg',
+ },
+ {
+ singleRowStart: true,
+ modeCount: 5,
+ class: '@[32rem]:rounded-tl-lg @[32rem]:rounded-bl-lg',
+ },
+ {
+ singleRowStart: true,
+ modeCount: 6,
+ class: '@[36rem]:rounded-tl-lg @[36rem]:rounded-bl-lg',
+ },
+
+ { singleRowEnd: true, modeCount: 3, class: '@[28rem]:rounded-tr-lg @[28rem]:rounded-br-lg' },
+ { singleRowEnd: true, modeCount: 4, class: '@[30rem]:rounded-tr-lg @[30rem]:rounded-br-lg' },
+ { singleRowEnd: true, modeCount: 5, class: '@[32rem]:rounded-tr-lg @[32rem]:rounded-br-lg' },
+ { singleRowEnd: true, modeCount: 6, class: '@[36rem]:rounded-tr-lg @[36rem]:rounded-br-lg' },
+
+ { clearTopRight: true, modeCount: 3, class: '@[28rem]:rounded-tr-none' },
+ { clearTopRight: true, modeCount: 4, class: '@[30rem]:rounded-tr-none' },
+ { clearTopRight: true, modeCount: 5, class: '@[32rem]:rounded-tr-none' },
+ { clearTopRight: true, modeCount: 6, class: '@[36rem]:rounded-tr-none' },
+
+ { clearBottomLeft: true, modeCount: 3, class: '@[28rem]:rounded-bl-none' },
+ { clearBottomLeft: true, modeCount: 4, class: '@[30rem]:rounded-bl-none' },
+ { clearBottomLeft: true, modeCount: 5, class: '@[32rem]:rounded-bl-none' },
+ { clearBottomLeft: true, modeCount: 6, class: '@[36rem]:rounded-bl-none' },
+
+ { clearBottomRight: true, modeCount: 3, class: '@[28rem]:rounded-br-none' },
+ { clearBottomRight: true, modeCount: 4, class: '@[30rem]:rounded-br-none' },
+ { clearBottomRight: true, modeCount: 5, class: '@[32rem]:rounded-br-none' },
+ { clearBottomRight: true, modeCount: 6, class: '@[36rem]:rounded-br-none' },
+ ],
+ defaultVariants: {
+ selected: false,
+ topLeft: false,
+ topRight: false,
+ bottomLeft: false,
+ bottomRight: false,
+ singleRowStart: false,
+ singleRowEnd: false,
+ clearTopRight: false,
+ clearBottomLeft: false,
+ clearBottomRight: false,
+ modeCount: 6,
+ },
+ }
+)
+
+const connectModeButtonIconVariants = cva('', {
+ variants: {
+ selected: {
+ true: 'text-foreground',
+ false: 'text-foreground-light',
+ },
+ },
+ defaultVariants: {
+ selected: false,
+ },
+})
+
+const connectModeButtonLabelVariants = cva('heading-default text-center', {
+ variants: {
+ selected: {
+ true: 'text-foreground',
+ false: 'text-foreground-light',
+ },
+ },
+ defaultVariants: {
+ selected: false,
+ },
+})
+
+const connectModeButtonDescriptionVariants = cva('text-sm leading-tight text-center', {
+ variants: {
+ selected: {
+ true: 'text-foreground-light',
+ false: 'text-foreground-lighter',
+ },
+ },
+ defaultVariants: {
+ selected: false,
+ },
+})
+
+const connectModeEmptySlotVariants = cva(
+ // Sunk vs mode tiles (bg-overlay/50); surface-200 reads clearly recessed on light
+ 'relative -mb-px -mr-px rounded-br-lg border bg-surface-200 dark:bg-surface-100',
+ {
+ variants: {
+ modeCount: {
+ 3: '@[28rem]:hidden',
+ 4: '@[30rem]:hidden',
+ 5: '@[32rem]:hidden',
+ 6: '@[36rem]:hidden',
+ },
+ },
+ defaultVariants: {
+ modeCount: 6,
+ },
+ }
+)
+
+type ConnectModeButtonCornerVariants = Pick<
+ VariantProps<typeof connectModeButtonVariants>,
+ | 'topLeft'
+ | 'topRight'
+ | 'bottomLeft'
+ | 'bottomRight'
+ | 'singleRowStart'
+ | 'singleRowEnd'
+ | 'clearTopRight'
+ | 'clearBottomLeft'
+ | 'clearBottomRight'
+ | 'modeCount'
+>
+
+export interface ConnectModeButtonProps
+ extends Omit<ComponentPropsWithoutRef<'button'>, 'children'>, ConnectModeButtonCornerVariants {
+ modeId: ConnectMode
+ label: string
+ description: string
+ selected?: boolean
+}
+
+export function ConnectModeButton({
+ modeId,
+ label,
+ description,
+ selected = false,
+ topLeft,
+ topRight,
+ bottomLeft,
+ bottomRight,
+ singleRowStart,
+ singleRowEnd,
+ clearTopRight,
+ clearBottomLeft,
+ clearBottomRight,
+ modeCount,
+ className,
+ type = 'button',
+ ...props
+}: ConnectModeButtonProps) {
+ return (
+ <button
+ type={type}
+ tabIndex={0}
+ aria-pressed={selected}
+ className={cn(
+ connectModeButtonVariants({
+ selected,
+ topLeft,
+ topRight,
+ bottomLeft,
+ bottomRight,
+ singleRowStart,
+ singleRowEnd,
+ clearTopRight,
+ clearBottomLeft,
+ clearBottomRight,
+ modeCount,
+ }),
+ className
+ )}
+ {...props}
+ >
+ <span className={connectModeButtonIconVariants({ selected })}>{MODE_ICONS[modeId]}</span>
+ <div>
+ <p className={connectModeButtonLabelVariants({ selected })}>{label}</p>
+ <p className={connectModeButtonDescriptionVariants({ selected })}>{description}</p>
+ </div>
+ </button>
+ )
+}
+
+/** Derive CVA corner variants from a cell's position in the mode grid. */
+export function getConnectModeButtonCornerVariants({
+ index,
+ count,
+ emptySlots,
+}: {
+ index: number
+ count: number
+ emptySlots: number
+}): ConnectModeButtonCornerVariants {
+ const isLast = index === count - 1
+ const narrowLastRowStart = (Math.ceil(count / 2) - 1) * 2
+ const topLeft = index === 0
+ const topRight = index === 1
+ const bottomLeft = index === narrowLastRowStart
+ const bottomRight = emptySlots === 0 && isLast
+
+ return {
+ modeCount: toModeCountBreakpoint(count),
+ topLeft,
+ topRight,
+ bottomLeft,
+ bottomRight,
+ // Once wide enough for a single row, reshape corners to left/right caps
+ singleRowStart: index === 0,
+ singleRowEnd: isLast,
+ clearTopRight: topRight && !isLast,
+ clearBottomLeft: bottomLeft && index !== 0,
+ clearBottomRight: bottomRight && !isLast,
+ }
+}
+
+export function getConnectModeEmptySlotClasses(count: number) {
+ return connectModeEmptySlotVariants({ modeCount: toModeCountBreakpoint(count) })
+}
diff --git a/apps/studio/components/interfaces/ConnectSheet/ConnectSheet.tsx b/apps/studio/components/interfaces/ConnectSheet/ConnectSheet.tsx
index 1d16e6fde89..6ea2ce855cd 100644
--- a/apps/studio/components/interfaces/ConnectSheet/ConnectSheet.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/ConnectSheet.tsx
@@ -159,13 +159,17 @@ export const ConnectSheet = () => {
return (
<Sheet open={showConnect} onOpenChange={handleOpenChange}>
- <SheetContent size="lg" className="flex flex-col gap-0 p-0 space-y-0" tabIndex={undefined}>
+ <SheetContent
+ size="lg"
+ className="flex w-full min-w-0 flex-col gap-0 space-y-0 p-0 max-w-4xl"
+ tabIndex={undefined}
+ >
<SheetHeader className={cn('text-left border-b shrink-0 py-6 px-8')}>
<SheetTitle>Connect to your project</SheetTitle>
<SheetDescription>Choose how you want to use Supabase</SheetDescription>
</SheetHeader>
- <div className="flex flex-1 flex-col overflow-y-auto divide-y">
+ <div className="flex min-w-0 flex-1 flex-col overflow-y-auto overflow-x-hidden divide-y">
<div className="p-8">
<ModeSelector
modes={availableModes}
@@ -175,7 +179,7 @@ export const ConnectSheet = () => {
</div>
{activeFields.length > 0 && (
- <div className="border-b p-8">
+ <div className="p-8">
<ConnectConfigSection
state={state}
activeFields={activeFields}
diff --git a/apps/studio/components/interfaces/ConnectSheet/ConnectSheetStep.tsx b/apps/studio/components/interfaces/ConnectSheet/ConnectSheetStep.tsx
index ecbddac8c80..6b632ae83e4 100644
--- a/apps/studio/components/interfaces/ConnectSheet/ConnectSheetStep.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/ConnectSheetStep.tsx
@@ -5,6 +5,7 @@ interface ConnectSheetStepProps {
number: number
title: string
description: string
+ optional?: boolean
className?: string
}
@@ -12,17 +13,20 @@ export const ConnectSheetStep = ({
number,
title,
description,
+ optional = false,
className,
children,
}: PropsWithChildren<ConnectSheetStepProps>) => {
+ const displayTitle = optional ? `${title} (optional)` : title
+
return (
<div
className={cn('group', className)}
data-connect-step
- data-step-title={title}
+ data-step-title={displayTitle}
data-step-description={description}
>
- <div className="flex items-start gap-6 self-stretch">
+ <div className="flex items-start gap-5 self-stretch">
<div className="relative self-stretch shrink-0 w-6">
<div className="absolute inset-0 flex items-start justify-center">
<div
@@ -38,13 +42,23 @@ export const ConnectSheetStep = ({
</div>
</div>
- <div className="grid grid-cols-1 2xl:grid-cols-5 gap-x-6 gap-y-4 pb-12 w-full">
- <div className="flex flex-col 2xl:col-span-2">
- <p className="text-sm font-medium text-foreground">{title}</p>
- <p className="text-sm text-foreground-light">{description}</p>
- </div>
- <div className="2xl:col-span-3 [&_pre.code-block]:bg-surface-75!" data-step-content>
- {children}
+ {/* Container query: side-by-side title | content when the step row is wide enough.
+ Viewport 2xl never applied inside max-w-4xl sheets. */}
+ <div className="@container w-full min-w-0">
+ <div className="grid grid-cols-1 @[36rem]:grid-cols-5 gap-x-6 gap-y-3 pb-8 w-full">
+ <div className="flex flex-col @[36rem]:col-span-2 gap-y-0.5">
+ <p className="text-sm font-medium text-foreground">
+ {title}
+ {optional && <span className="font-normal text-foreground-muted"> (optional)</span>}
+ </p>
+ <p className="text-sm text-foreground-light">{description}</p>
+ </div>
+ <div
+ className="@[36rem]:col-span-3 [&_pre.code-block]:bg-surface-75!"
+ data-step-content
+ >
+ {children}
+ </div>
</div>
</div>
</div>
diff --git a/apps/studio/components/interfaces/ConnectSheet/ConnectStepsSection.tsx b/apps/studio/components/interfaces/ConnectSheet/ConnectStepsSection.tsx
index 947e24b4c75..dd9d6c301fd 100644
--- a/apps/studio/components/interfaces/ConnectSheet/ConnectStepsSection.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/ConnectStepsSection.tsx
@@ -23,10 +23,11 @@ import {
shouldShowSelfHostedMcpNotice,
shouldShowSessionPoolerNotice,
} from './ConnectStepsSection.utils'
-import { CopyPromptAdmonition } from './CopyPromptAdmonition'
+import { CopyPromptButton } from './CopyPromptAdmonition'
import { buildConnectionStringPooler, getConnectionStrings } from './DatabaseSettings.utils'
import { getAddons } from '@/components/interfaces/Billing/Subscription/Subscription.utils'
import { DocsButton } from '@/components/ui/DocsButton'
+import { InlineLink } from '@/components/ui/InlineLink'
import { useProjectSettingsV2Query } from '@/data/config/project-settings-v2-query'
import { usePgbouncerConfigQuery } from '@/data/database/pgbouncer-config-query'
import { useSupavisorConfigurationQuery } from '@/data/database/supavisor-configuration-query'
@@ -119,7 +120,7 @@ function useConnectionStringPooler(deploymentMode: DeploymentMode): ConnectionSt
// Vite needs `import.meta.glob` to statically discover the step content
// modules because the `${filePath}` template can span multiple directory
-// segments (`flask/supabasepy`, `steps/shadcn/explore`, ...) which Vite's
+// segments (`flask/supabasepy`, `steps/shadcn/command`, ...) which Vite's
// dynamic-import-vars plugin can't analyze. Skip the glob on the SSR bundle
// — Vite replaces `import.meta.env.SSR` at build time and tree-shakes the
// call so the 37 content modules stay out of the server graph (pulling them
@@ -242,7 +243,10 @@ export function ConnectStepsSection({ steps, state, projectKeys }: ConnectStepsS
return (
<div className="bg-muted/50 flex-1">
<div className="p-8 flex flex-col gap-y-6">
- <h3>Connect your app</h3>
+ <div className="flex items-center justify-between gap-4">
+ <h3>Follow these steps</h3>
+ <CopyPromptButton stepsContainerRef={stepsContainerRef} />
+ </div>
{showDataApiDisabledWarning && (
<Admonition
@@ -261,22 +265,29 @@ export function ConnectStepsSection({ steps, state, projectKeys }: ConnectStepsS
{showIpv4AddonNotice && (
<Admonition
type="default"
+ layout="responsive"
title={`${state.connectionMethod === 'direct' ? 'Direct connections use' : 'Transaction pooler uses'} IPv6 by default`}
- description="Enable the dedicated IPv4 address add-on to connect from IPv4-only networks"
- actions={[
- <Button asChild key="addon" variant="default">
+ description={
+ <>
+ Enable the dedicated IPv4 address add-on to connect from IPv4-only networks.{' '}
+ <InlineLink href={`${DOCS_URL}/guides/platform/ipv4-address`}>
+ Learn more
+ </InlineLink>
+ </>
+ }
+ actions={
+ <Button asChild variant="default">
<Link href={`/project/${ref}/settings/addons?panel=ipv4`}>Enable IPv4 add-on</Link>
- </Button>,
- <DocsButton key="docs" href={`${DOCS_URL}/guides/platform/ipv4-address`} />,
- ]}
+ </Button>
+ }
/>
)}
{showSessionPoolerNotice && (
<Admonition
type="default"
- title="Only use Session Pooler on an IPv4 network"
- description="Session pooler connections are IPv4 proxied for free. Use Direct Connection if connecting via an IPv6 network."
+ title="Only use session pooler on an IPv4 network"
+ description="Session pooler connections are IPv4 proxied for free. Use direct connection if connecting via an IPv6 network."
/>
)}
@@ -291,15 +302,14 @@ export function ConnectStepsSection({ steps, state, projectKeys }: ConnectStepsS
/>
)}
- <CopyPromptAdmonition stepsContainerRef={stepsContainerRef} />
-
- <div className="mt-6" ref={stepsContainerRef}>
+ <div ref={stepsContainerRef}>
{steps.map((step, index) => (
<ConnectSheetStep
key={step.id}
number={index + 1}
title={step.title}
description={step.description}
+ optional={step.optional}
>
<StepContent
contentId={step.content}
diff --git a/apps/studio/components/interfaces/ConnectSheet/ConnectionParameters.tsx b/apps/studio/components/interfaces/ConnectSheet/ConnectionParameters.tsx
index db4ba4464fd..dabfa7c86bb 100644
--- a/apps/studio/components/interfaces/ConnectSheet/ConnectionParameters.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/ConnectionParameters.tsx
@@ -1,6 +1,4 @@
-import { Check, Copy } from 'lucide-react'
-import { useState } from 'react'
-import { cn, copyToClipboard } from 'ui'
+import CopyButton from '@/components/ui/CopyButton'
interface Parameter {
key: string
@@ -13,45 +11,42 @@ interface ConnectionParametersProps {
}
export const ConnectionParameters = ({ parameters, onCopy }: ConnectionParametersProps) => {
- const [copiedMap, setCopiedMap] = useState<Record<string, boolean>>({})
+ const copyAllText = parameters.map((param) => `${param.key}=${param.value}`).join('\n')
return (
- <div className="bg-surface-75 rounded-lg border font-mono text-sm p-4">
- {parameters.map((param) => (
- <div key={param.key} className="py-0.5 group/param">
- <div className="text-xs flex items-center">
- <span className="text-foreground-lighter">{param.key}:</span>
- <span className="ml-1 text-foreground">{param.value}</span>
- <button
- type="button"
- tabIndex={0}
+ <div className="overflow-hidden rounded-lg border bg-surface-75">
+ <div className="flex items-center justify-between border-b bg-surface-100 py-2 pl-4 pr-2">
+ <span className="text-xs text-foreground-light">Connection parameters</span>
+ <CopyButton
+ variant="default"
+ size="tiny"
+ copyLabel="Copy all"
+ text={copyAllText}
+ aria-label="Copy all connection parameters"
+ onClick={() => onCopy?.('all')}
+ />
+ </div>
+ <div className="divide-y">
+ {parameters.map((param) => (
+ <div
+ key={param.key}
+ className="flex items-center gap-x-2 py-2.5 pl-4 pr-2 font-mono text-sm"
+ >
+ <span className="shrink-0 text-foreground-lighter">{param.key}:</span>
+ <span className="flex-1 truncate text-foreground" title={param.value}>
+ {param.value}
+ </span>
+ <CopyButton
+ variant="default"
+ size="tiny"
+ iconOnly
+ text={param.value}
aria-label={`Copy ${param.key}`}
- onClick={() => {
- copyToClipboard(param.value, () => {
- setCopiedMap((prev) => ({ ...prev, [param.key]: true }))
- onCopy?.(param.key)
- setTimeout(() => {
- setCopiedMap((prev) => ({ ...prev, [param.key]: false }))
- }, 1000)
- })
- }}
- className={cn(
- 'text-foreground-lighter',
- 'ml-2 opacity-0 group-hover/param:opacity-100 focus-visible:opacity-100',
- 'hover:text-foreground rounded-xs p-1',
- copiedMap[param.key] && 'opacity-100',
- 'transition-all'
- )}
- >
- {copiedMap[param.key] ? (
- <Check size={12} strokeWidth={1.5} />
- ) : (
- <Copy size={12} strokeWidth={1.5} />
- )}
- </button>
+ onClick={() => onCopy?.(param.key)}
+ />
</div>
- </div>
- ))}
+ ))}
+ </div>
</div>
)
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/CopyPromptAdmonition.tsx b/apps/studio/components/interfaces/ConnectSheet/CopyPromptAdmonition.tsx
index 6b60b9065f3..4a522e3b6f1 100644
--- a/apps/studio/components/interfaces/ConnectSheet/CopyPromptAdmonition.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/CopyPromptAdmonition.tsx
@@ -1,10 +1,10 @@
-import { type RefObject } from 'react'
-import { Admonition } from 'ui-patterns/admonition'
+import { Check, Copy } from 'lucide-react'
+import { useEffect, useState, type RefObject } from 'react'
+import { copyToClipboard } from 'ui'
-import CopyButton from '@/components/ui/CopyButton'
-import { BASE_PATH } from '@/lib/constants'
+import { ButtonTooltip } from '@/components/ui/ButtonTooltip'
-interface CopyPromptAdmonitionProps {
+interface CopyPromptButtonProps {
stepsContainerRef: RefObject<HTMLDivElement | null>
/** When set, the Copy prompt button uses this verbatim instead of scraping the steps. */
customPrompt?: string
@@ -125,42 +125,32 @@ export const buildConnectPrompt = (stepsContainer: HTMLElement | null) => {
return promptContent
}
-export function CopyPromptAdmonition({
- stepsContainerRef,
- customPrompt,
-}: CopyPromptAdmonitionProps) {
- const handleCopyPrompt = () => {
- return customPrompt ?? buildConnectPrompt(stepsContainerRef.current)
- }
+export function CopyPromptButton({ stepsContainerRef, customPrompt }: CopyPromptButtonProps) {
+ const [showCopied, setShowCopied] = useState(false)
+
+ useEffect(() => {
+ if (!showCopied) return
+ const timer = setTimeout(() => setShowCopied(false), 2000)
+ return () => clearTimeout(timer)
+ }, [showCopied])
return (
- <Admonition
- type="tip"
- showIcon={false}
- layout="horizontal"
- actions={
- <CopyButton variant="default" copyLabel="Copy prompt" asyncText={handleCopyPrompt} />
- }
+ <ButtonTooltip
+ variant="default"
+ icon={showCopied ? <Check strokeWidth={2} className="text-brand" /> : <Copy />}
+ onClick={() => {
+ const textToCopy = customPrompt ?? buildConnectPrompt(stepsContainerRef.current)
+ setShowCopied(true)
+ copyToClipboard(textToCopy)
+ }}
+ tooltip={{
+ content: {
+ side: 'left',
+ text: 'Copy these steps for your coding agent',
+ },
+ }}
>
- <div className="absolute -inset-16 z-0 opacity-50">
- <img
- src={`${BASE_PATH}/img/reports/bg-grafana-dark.svg`}
- alt="Supabase Grafana"
- className="w-full h-full object-cover object-right hidden dark:block"
- />
- <img
- src={`${BASE_PATH}/img/reports/bg-grafana-light.svg`}
- alt="Supabase Grafana"
- className="w-full h-full object-cover object-right dark:hidden"
- />
- <div className="absolute inset-0 bg-linear-to-r from-background-alternative to-transparent" />
- </div>
-
- <div className="relative flex flex-col md:flex-row md:items-center gap-y-2 md:gap-x-8 justify-between">
- <div className="flex flex-col gap-y-0.5">
- <p className="heading-default">Give your agent everything it needs</p>
- </div>
- </div>
- </Admonition>
+ {showCopied ? 'Copied' : 'Copy prompt'}
+ </ButtonTooltip>
)
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/DirectConnectionExamples.tsx b/apps/studio/components/interfaces/ConnectSheet/DirectConnectionExamples.tsx
index 80084d1337d..4f8ceb8b69e 100644
--- a/apps/studio/components/interfaces/ConnectSheet/DirectConnectionExamples.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/DirectConnectionExamples.tsx
@@ -1,6 +1,5 @@
export type Example = {
installCommands?: string[]
- postInstallCommands?: string[]
files?: {
name: string
content: string
@@ -58,9 +57,6 @@ func main() {
installCommands: [
'dotnet add package Microsoft.Extensions.Configuration.Json --version YOUR_DOTNET_VERSION',
],
- postInstallCommands: [
- 'dotnet add package Microsoft.Extensions.Configuration.Json --version YOUR_DOTNET_VERSION',
- ],
},
python: {
installCommands: ['pip install python-dotenv psycopg2'],
diff --git a/apps/studio/components/interfaces/ConnectSheet/PasswordEncodingNote.tsx b/apps/studio/components/interfaces/ConnectSheet/PasswordEncodingNote.tsx
index 7c8ea817b03..bef1c734a9d 100644
--- a/apps/studio/components/interfaces/ConnectSheet/PasswordEncodingNote.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/PasswordEncodingNote.tsx
@@ -1,19 +1,12 @@
-import { Admonition } from 'ui-patterns/admonition'
-
import { InlineLink } from '@/components/ui/InlineLink'
import { SPECIAL_SYMBOLS_IN_PASSWORDS_DOCS_URL } from '@/lib/constants'
export const PasswordEncodingNote = () => {
return (
- <Admonition
- type="default"
- description={
- <>
- If your database password contains special characters, you will need to{' '}
- <InlineLink href={SPECIAL_SYMBOLS_IN_PASSWORDS_DOCS_URL}>percent-encode</InlineLink> them
- in the connection string.
- </>
- }
- />
+ <p className="text-sm text-foreground-lighter mb-1">
+ If your database password contains special characters,{' '}
+ <InlineLink href={SPECIAL_SYMBOLS_IN_PASSWORDS_DOCS_URL}>percent-encode</InlineLink> them in
+ the connection string.
+ </p>
)
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/__tests__/connect.schema.test.ts b/apps/studio/components/interfaces/ConnectSheet/__tests__/connect.schema.test.ts
index 5c6f8224acf..f3b08063f56 100644
--- a/apps/studio/components/interfaces/ConnectSheet/__tests__/connect.schema.test.ts
+++ b/apps/studio/components/interfaces/ConnectSheet/__tests__/connect.schema.test.ts
@@ -123,6 +123,15 @@ describe('connect.schema:fields', () => {
const field = connectSchema.fields.mcpFeatures
expect(field.type).toBe('multi-select')
expect(field.options).toEqual({ source: 'mcpFeatures' })
+ expect(field.defaultValue).toEqual([
+ 'docs',
+ 'account',
+ 'database',
+ 'debugging',
+ 'development',
+ 'functions',
+ 'branching',
+ ])
})
})
@@ -229,7 +238,7 @@ describe('connect.schema:steps resolution', () => {
expect(steps.find((s) => s.id === 'shadcn-add')).toBeDefined()
expect(steps.find((s) => s.id === 'shadcn-env')).toBeDefined()
- expect(steps.find((s) => s.id === 'shadcn-explore')).toBeDefined()
+ expect(steps.find((s) => s.id === 'shadcn-explore')).toBeUndefined()
})
test('should resolve steps for react without shadcn', () => {
@@ -388,14 +397,6 @@ describe('connect.schema:step content paths', () => {
expect(shadcnStep?.content).toBe('steps/shadcn/command')
})
- test('shadcn explore step should have valid content path', () => {
- const state: ConnectState = { mode: 'framework', framework: 'nextjs', frameworkUi: true }
- const steps = resolveSteps(connectSchema, state)
- const exploreStep = steps.find((s) => s.id === 'shadcn-explore')
-
- expect(exploreStep?.content).toBe('steps/shadcn/explore')
- })
-
test('shadcn env step should have valid content path', () => {
const state: ConnectState = { mode: 'framework', framework: 'nextjs', frameworkUi: true }
const steps = resolveSteps(connectSchema, state)
diff --git a/apps/studio/components/interfaces/ConnectSheet/__tests__/useConnectState.test.ts b/apps/studio/components/interfaces/ConnectSheet/__tests__/useConnectState.test.ts
index 558fcf0fd60..5e9ac4a6b3d 100644
--- a/apps/studio/components/interfaces/ConnectSheet/__tests__/useConnectState.test.ts
+++ b/apps/studio/components/interfaces/ConnectSheet/__tests__/useConnectState.test.ts
@@ -694,5 +694,46 @@ describe('useConnectState', () => {
expect(result.current.state.connectionMethod).toBe('session')
})
})
+
+ describe('mcp features for deployment mode', () => {
+ test('self-hosted defaults and options stay within the non-platform subset', () => {
+ Object.assign(deploymentModeMock, {
+ isPlatform: false,
+ isCli: false,
+ isSelfHosted: true,
+ })
+ const { result } = renderHook(() => useConnectState({ mode: 'framework' }))
+ act(() => {
+ result.current.setMode('mcp')
+ })
+
+ const features = result.current.state.mcpFeatures
+ expect(Array.isArray(features)).toBe(true)
+ expect(features).toEqual(
+ expect.arrayContaining(['docs', 'database', 'development', 'debugging'])
+ )
+ expect(features).not.toContain('storage')
+ expect(features).not.toContain('account')
+ expect(features).not.toContain('auth')
+
+ const options = result.current.getFieldOptions('mcpFeatures').map((o) => o.value)
+ expect(options).toEqual(['docs', 'database', 'debugging', 'development'])
+ })
+
+ test('self-hosted strips unsupported features when re-entering mcp mode', () => {
+ Object.assign(deploymentModeMock, {
+ isPlatform: false,
+ isCli: false,
+ isSelfHosted: true,
+ })
+ const { result } = renderHook(() =>
+ useConnectState({ mode: 'mcp', mcpFeatures: ['docs', 'account', 'database'] })
+ )
+ act(() => {
+ result.current.setMode('mcp')
+ })
+ expect(result.current.state.mcpFeatures).toEqual(['docs', 'database'])
+ })
+ })
})
})
diff --git a/apps/studio/components/interfaces/ConnectSheet/connect.resolver.ts b/apps/studio/components/interfaces/ConnectSheet/connect.resolver.ts
index 7874640a1f2..a1eb1d03e4a 100644
--- a/apps/studio/components/interfaces/ConnectSheet/connect.resolver.ts
+++ b/apps/studio/components/interfaces/ConnectSheet/connect.resolver.ts
@@ -95,6 +95,7 @@ export function resolveSteps(schema: ConnectSchema, state: ConnectState): Resolv
id: step.id,
title: step.title,
description: step.description,
+ optional: step.optional,
content: content ?? '',
}
})
diff --git a/apps/studio/components/interfaces/ConnectSheet/connect.schema.ts b/apps/studio/components/interfaces/ConnectSheet/connect.schema.ts
index 15204084a0f..dccc9ad38cb 100644
--- a/apps/studio/components/interfaces/ConnectSheet/connect.schema.ts
+++ b/apps/studio/components/interfaces/ConnectSheet/connect.schema.ts
@@ -1,5 +1,32 @@
+import { FEATURE_GROUPS_NON_PLATFORM, FEATURE_GROUPS_PLATFORM } from 'ui-patterns/McpUrlBuilder'
+
import type { ConnectSchema, StepDefinition } from './Connect.types'
+/**
+ * MCP feature groups enabled by default on platform (Storage is excluded to keep
+ * tool counts manageable).
+ */
+export const DEFAULT_MCP_FEATURES = FEATURE_GROUPS_PLATFORM.filter(
+ (group) => group.id !== 'storage'
+).map((group) => group.id)
+
+const NON_PLATFORM_MCP_FEATURE_IDS = new Set(FEATURE_GROUPS_NON_PLATFORM.map((group) => group.id))
+
+/** Defaults (and supported IDs) for the current deployment mode. */
+export function getDefaultMcpFeatures(isPlatform: boolean): string[] {
+ if (isPlatform) return DEFAULT_MCP_FEATURES
+ return DEFAULT_MCP_FEATURES.filter((id) => NON_PLATFORM_MCP_FEATURE_IDS.has(id))
+}
+
+export function getSupportedMcpFeatureGroups(isPlatform: boolean) {
+ return isPlatform ? FEATURE_GROUPS_PLATFORM : FEATURE_GROUPS_NON_PLATFORM
+}
+
+export function normalizeMcpFeatures(features: string[], isPlatform: boolean): string[] {
+ if (isPlatform) return features
+ return features.filter((id) => NON_PLATFORM_MCP_FEATURE_IDS.has(id))
+}
+
/**
* Base install commands for each library.
*/
@@ -69,7 +96,7 @@ const frameworkReactFilesStep: StepDefinition = {
const frameworkShadcnStep: StepDefinition = {
id: 'shadcn-add',
title: 'Add Supabase UI components',
- description: 'Run this command to install the Supabase shadcn components.',
+ description: 'Install Supabase UI components via the shadcn registry.',
content: 'steps/shadcn/command',
}
@@ -80,13 +107,6 @@ const frameworkShadcnEnvStep: StepDefinition = {
content: 'steps/shadcn/env',
}
-const frameworkShadcnExploreStep: StepDefinition = {
- id: 'shadcn-explore',
- title: 'Check out more UI components',
- description: 'Add auth, realtime and storage functionality to your project',
- content: 'steps/shadcn/explore',
-}
-
const directConnectionStep: StepDefinition = {
id: 'connection',
title: 'Connection string',
@@ -97,7 +117,7 @@ const directConnectionStep: StepDefinition = {
const directInstallStep: StepDefinition = {
id: 'direct-install',
title: 'Install dependencies',
- description: 'Run this command to install the required dependencies.',
+ description: 'Install the required dependencies.',
content: 'steps/direct-install',
}
@@ -133,7 +153,7 @@ const codexAuthenticateStep: StepDefinition = {
const codexVerifyStep: StepDefinition = {
id: 'codex-verify',
title: 'Verify authentication',
- description: 'Run /mcp inside Codex to verify.',
+ description: 'Confirm the MCP server is authenticated.',
content: 'steps/mcp/codex/verify',
}
@@ -148,7 +168,7 @@ const claudeAuthenticateStep: StepDefinition = {
id: 'claude-authenticate',
title: 'Authenticate',
description:
- 'After configuring the MCP server, you need to authenticate. In a regular terminal (not the IDE extension) run:',
+ 'After configuring the MCP server, you need to authenticate. Run this in a regular terminal, not an IDE extension.',
content: 'steps/mcp/claude-code/authenticate',
}
@@ -169,8 +189,7 @@ const ormConfigureStep: StepDefinition = {
const serverInstallStep: StepDefinition = {
id: 'server-install',
title: 'Install package',
- description:
- 'Add @supabase/server to your backend or API framework of choice. On Supabase Edge Functions you can import it directly, no install needed.',
+ description: 'Add @supabase/server to your backend.',
content: 'server/install',
}
@@ -178,13 +197,14 @@ const serverEnvStep: StepDefinition = {
id: 'server-env',
title: 'Set environment variables',
description:
- 'Copy these into your environment so you can verify users and use the client/admin supabase-js library from the context of your handler. On Supabase Edge Functions they are injected automatically.',
+ 'Copy these into your environment so your handler can verify users and use supabase-js.',
content: 'server/env',
}
const skillsInstallStep: StepDefinition = {
id: 'install-skills',
- title: 'Install Agent Skills (Optional)',
+ title: 'Install Agent Skills',
+ optional: true,
description:
'Agent Skills give AI coding tools ready-made instructions, scripts, and resources for working with Supabase more accurately and efficiently.',
content: 'steps/skills-install',
@@ -192,9 +212,9 @@ const skillsInstallStep: StepDefinition = {
const serverSkillsInstallStep: StepDefinition = {
id: 'install-skills',
- title: 'Install the Supabase Server skill (Optional)',
- description:
- 'Gives AI coding tools ready-made instructions for building APIs with @supabase/server.',
+ title: 'Install the Supabase Server skill',
+ optional: true,
+ description: 'Give AI coding tools instructions for building APIs with @supabase/server.',
content: 'steps/skills-install',
}
@@ -302,7 +322,7 @@ export const connectSchema: ConnectSchema = {
id: 'frameworkUi',
type: 'switch',
label: 'Shadcn',
- description: 'Install components via the Supabase shadcn registry.',
+ description: 'Install Supabase UI components with shadcn.',
defaultValue: false,
dependsOn: { framework: ['nextjs', 'react'] },
},
@@ -326,8 +346,8 @@ export const connectSchema: ConnectSchema = {
useSharedPooler: {
id: 'useSharedPooler',
type: 'switch',
- label: 'Use IPv4 connection (Shared Pooler)',
- description: 'Recommended when your network does not support IPv6',
+ label: 'Use IPv4 connection',
+ description: 'Uses the shared pooler. Recommended on networks that do not support IPv6.',
defaultValue: false,
dependsOn: { connectionMethod: ['transaction'] },
},
@@ -353,7 +373,7 @@ export const connectSchema: ConnectSchema = {
id: 'mcpClient',
type: 'select',
label: 'Client',
- description: 'Choose the MCP client you are using.',
+ description: 'The MCP client you are using.',
options: { source: 'mcpClients' },
defaultValue: 'claude-code',
},
@@ -361,7 +381,7 @@ export const connectSchema: ConnectSchema = {
id: 'mcpReadonly',
type: 'switch',
label: 'Read-only',
- description: 'Only allow read operations on your database',
+ description: 'Only allow read operations on your database.',
defaultValue: false,
},
mcpFeatures: {
@@ -369,8 +389,9 @@ export const connectSchema: ConnectSchema = {
type: 'multi-select',
label: 'Feature groups',
description:
- 'Only enable a subset of features. Helps keep the number of tools within MCP client limits.',
+ 'Which MCP tools to include. Storage is off by default to keep tool counts manageable.',
options: { source: 'mcpFeatures' },
+ defaultValue: DEFAULT_MCP_FEATURES,
},
},
@@ -390,7 +411,6 @@ export const connectSchema: ConnectSchema = {
frameworkInstallPackagesStep,
frameworkShadcnStep,
frameworkShadcnEnvStep,
- frameworkShadcnExploreStep,
skillsInstallStep,
],
DEFAULT: [
@@ -406,7 +426,6 @@ export const connectSchema: ConnectSchema = {
frameworkInstallStep,
frameworkShadcnStep,
frameworkShadcnEnvStep,
- frameworkShadcnExploreStep,
skillsInstallStep,
],
DEFAULT: [frameworkInstallStep, frameworkNextJsFilesStep, skillsInstallStep],
@@ -420,7 +439,6 @@ export const connectSchema: ConnectSchema = {
frameworkInstallStep,
frameworkShadcnStep,
frameworkShadcnEnvStep,
- frameworkShadcnExploreStep,
skillsInstallStep,
],
DEFAULT: [frameworkInstallStep, frameworkReactFilesStep, skillsInstallStep],
diff --git a/apps/studio/components/interfaces/ConnectSheet/content/server/common/EnvRow.tsx b/apps/studio/components/interfaces/ConnectSheet/content/server/common/EnvRow.tsx
index 47a26028642..daa065fd28d 100644
--- a/apps/studio/components/interfaces/ConnectSheet/content/server/common/EnvRow.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/content/server/common/EnvRow.tsx
@@ -8,7 +8,7 @@ export function EnvRow({
children: React.ReactNode
}) {
return (
- <div className="flex items-center gap-x-2 px-4 py-2.5 font-mono text-sm">
+ <div className="flex items-center gap-x-2 py-2.5 pl-4 pr-2 font-mono text-sm">
<span className="shrink-0 text-foreground-lighter">{name}=</span>
<span className="flex-1 truncate text-foreground" title={value}>
{value}
diff --git a/apps/studio/components/interfaces/ConnectSheet/content/server/env/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/server/env/content.tsx
index 43a12e20516..79391d22cd0 100644
--- a/apps/studio/components/interfaces/ConnectSheet/content/server/env/content.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/content/server/env/content.tsx
@@ -1,7 +1,4 @@
import { useParams } from 'common'
-import Link from 'next/link'
-import { Button } from 'ui'
-import { Admonition } from 'ui-patterns/admonition'
import { EnvRow } from '../common/EnvRow'
import { SecretEnvRow } from '../common/SecretRow'
@@ -10,6 +7,7 @@ import {
useConnectServerEnv,
} from '@/components/interfaces/ConnectSheet/useConnectServerEnv'
import CopyButton from '@/components/ui/CopyButton'
+import { InlineLink } from '@/components/ui/InlineLink'
function ServerEnvContent() {
const { ref } = useParams()
@@ -17,13 +15,14 @@ function ServerEnvContent() {
useConnectServerEnv()
return (
- <div className="flex flex-col gap-y-4">
- <div className="overflow-hidden rounded-lg border bg-surface-100">
- <div className="flex items-center justify-between border-b bg-surface-200 px-4 py-2">
+ <div className="flex flex-col gap-y-2">
+ <div className="overflow-hidden rounded-lg border bg-surface-75">
+ <div className="flex items-center justify-between border-b bg-surface-100 py-2 pl-4 pr-2">
<span className="font-mono text-xs text-foreground-light">.env</span>
<CopyButton
variant="default"
size="tiny"
+ copyLabel="Copy all"
asyncText={buildEnv}
aria-label="Copy all variables"
disabled={!canReadAPIKeys}
@@ -62,20 +61,18 @@ function ServerEnvContent() {
</div>
</div>
- <Admonition
- variant="default"
- title="On Supabase Edge Functions these are injected automatically"
- description="No setup is needed for Edge Functions. For other runtimes, copy the values above into your environment. Need a secret key? Create or manage them in API Keys settings."
- actions={
- ref
- ? [
- <Button asChild key="api-keys" variant="default">
- <Link href={`/project/${ref}/settings/api-keys`}>View API keys</Link>
- </Button>,
- ]
- : undefined
- }
- />
+ <p className="text-sm text-foreground-lighter">
+ On Edge Functions these are injected automatically. For other runtimes, copy the values
+ above
+ {ref ? (
+ <>
+ . Manage keys in{' '}
+ <InlineLink href={`/project/${ref}/settings/api-keys`}>API Keys settings</InlineLink>.
+ </>
+ ) : (
+ '.'
+ )}
+ </p>
</div>
)
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/content/server/install/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/server/install/content.tsx
index 5758dbd183a..8130f474837 100644
--- a/apps/studio/components/interfaces/ConnectSheet/content/server/install/content.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/content/server/install/content.tsx
@@ -11,39 +11,44 @@ const INSTALL_OPTIONS = [
function ServerInstallContent() {
return (
- <Tabs defaultValue="npm" className="overflow-hidden rounded-lg border">
- <TabsList className="gap-5 border-0 border-b bg-surface-75 px-4">
+ <div className="flex flex-col gap-y-2">
+ <Tabs defaultValue="npm" className="overflow-hidden rounded-lg border">
+ <TabsList className="gap-5 border-0 border-b bg-surface-75 px-4">
+ {INSTALL_OPTIONS.map((option) => (
+ <TabsTrigger
+ key={option.name}
+ value={option.name}
+ className="px-0 py-2.5 text-xs data-[state=active]:bg-transparent"
+ >
+ {option.name}
+ </TabsTrigger>
+ ))}
+ </TabsList>
{INSTALL_OPTIONS.map((option) => (
- <TabsTrigger
+ <TabsContent
key={option.name}
value={option.name}
- className="px-0 py-2.5 text-xs data-[state=active]:bg-transparent"
+ className="m-0 data-[state=inactive]:hidden"
>
- {option.name}
- </TabsTrigger>
+ <div className="flex items-center gap-x-2 bg-surface-75 py-3 pl-4 pr-2">
+ <code className="flex-1 overflow-x-auto whitespace-nowrap font-mono text-sm text-foreground">
+ {option.command}
+ </code>
+ <CopyButton
+ variant="default"
+ size="tiny"
+ iconOnly
+ text={option.command}
+ aria-label={`Copy ${option.name} command`}
+ />
+ </div>
+ </TabsContent>
))}
- </TabsList>
- {INSTALL_OPTIONS.map((option) => (
- <TabsContent
- key={option.name}
- value={option.name}
- className="m-0 data-[state=inactive]:hidden"
- >
- <div className="flex items-center gap-x-2 bg-surface-75 px-4 py-3">
- <code className="flex-1 overflow-x-auto whitespace-nowrap font-mono text-sm text-foreground-light">
- {option.command}
- </code>
- <CopyButton
- variant="default"
- size="tiny"
- iconOnly
- text={option.command}
- aria-label={`Copy ${option.name} command`}
- />
- </div>
- </TabsContent>
- ))}
- </Tabs>
+ </Tabs>
+ <p className="text-sm text-foreground-lighter">
+ On Edge Functions you can import it directly, no install needed.
+ </p>
+ </div>
)
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx
index 6c1be4ba4b9..c5b79d422d9 100644
--- a/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-connection/content.tsx
@@ -1,7 +1,6 @@
import { useParams } from 'common'
import { Check, KeyRound } from 'lucide-react'
import { useMemo, useState } from 'react'
-import { Badge } from 'ui'
import { CodeBlock } from 'ui-patterns/CodeBlock'
import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
@@ -225,23 +224,38 @@ function DirectConnectionContent({ state, deploymentMode }: StepContentProps) {
const poolerBadge =
connectionMethod === 'transaction'
? useSharedPooler || !hasDedicatedPooler
- ? 'Shared Pooler'
- : 'Dedicated Pooler'
+ ? 'Shared pooler'
+ : 'Dedicated pooler'
: connectionMethod === 'session'
- ? 'Shared Pooler'
+ ? 'Shared pooler'
: null
+ const showPasswordPlaceholder = connectionString.includes(PASSWORD_PLACEHOLDER)
const showSelfHostedDirectNotice = deploymentMode.isSelfHosted && connectionMethod === 'direct'
+ const showPoolerTitle = deploymentMode.isPlatform && !!poolerBadge && !isHighAvailability
+ const showResetInTitle =
+ deploymentMode.isPlatform && showPasswordPlaceholder && !temporaryDatabasePassword
+ const showStringTitleRow = showPoolerTitle || showResetInTitle
return (
- <div className="flex flex-col gap-2">
- {deploymentMode.isPlatform && poolerBadge && !isHighAvailability && (
- <div className="flex items-center gap-x-2">
- <Badge>{poolerBadge}</Badge>
- </div>
- )}
- {connectionString.includes(PASSWORD_PLACEHOLDER) && <PasswordEncodingNote />}
+ <div className="flex flex-col gap-3">
<div className="overflow-hidden rounded-lg border bg-surface-75">
+ {showStringTitleRow && (
+ <div className="flex items-center justify-between gap-2 border-b bg-surface-100 py-2 pl-4 pr-2">
+ {showPoolerTitle ? (
+ <span className="text-xs text-foreground-light">{poolerBadge}</span>
+ ) : (
+ <span />
+ )}
+ {showResetInTitle && (
+ <ResetDbPasswordDialog
+ triggerLabel="Reset database password"
+ triggerIcon={<KeyRound />}
+ onPasswordReset={setTemporaryDatabasePassword}
+ />
+ )}
+ </div>
+ )}
<div data-connect-copy-value={redactedConnectionString}>
<CodeBlock
className="rounded-none border-0 [&_code]:text-foreground"
@@ -254,28 +268,16 @@ function DirectConnectionContent({ state, deploymentMode }: StepContentProps) {
{connectionString}
</CodeBlock>
</div>
- {deploymentMode.isPlatform && (
- <div className="flex flex-col gap-2 border-t px-6 py-3 sm:flex-row sm:items-center sm:justify-between">
- <div className="text-sm text-foreground-light">
- {temporaryDatabasePassword ? (
- <span className="flex items-center gap-2">
- <Check size={16} className="text-brand shrink-0" />
- <span>New password shown until refresh.</span>
- </span>
- ) : (
- 'Forgot your database password?'
- )}
- </div>
- <ResetDbPasswordDialog
- triggerLabel="Reset password"
- triggerIcon={<KeyRound />}
- onPasswordReset={setTemporaryDatabasePassword}
- />
+ {deploymentMode.isPlatform && temporaryDatabasePassword && (
+ <div className="flex items-center gap-2 border-t px-4 py-3 text-sm text-foreground-light">
+ <Check size={16} className="text-brand shrink-0" />
+ <span>New password shown until refresh.</span>
</div>
)}
</div>
+ {showPasswordPlaceholder && <PasswordEncodingNote />}
{showSelfHostedDirectNotice && (
- <p className="text-sm text-foreground-light">
+ <p className="text-sm text-foreground-lighter">
Manually{' '}
<InlineLink
href={`${DOCS_URL}/guides/self-hosting/docker#exposing-your-postgres-database`}
diff --git a/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-files/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-files/content.tsx
index 210e33eb96e..eaf3d943483 100644
--- a/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-files/content.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/content/steps/direct-files/content.tsx
@@ -1,5 +1,4 @@
import { useEffect, useMemo, useState } from 'react'
-import { CodeBlock } from 'ui-patterns/CodeBlock'
import { MultipleCodeBlock } from 'ui-patterns/MultipleCodeBlock'
import { GenericSkeletonLoader } from 'ui-patterns/ShimmeringLoader'
@@ -18,9 +17,6 @@ import {
} from '@/components/interfaces/ConnectSheet/ConnectionString.utils'
import { PasswordEncodingNote } from '@/components/interfaces/ConnectSheet/PasswordEncodingNote'
-const DOTNET_CONFIG_COMMAND =
- 'dotnet add package Microsoft.Extensions.Configuration.Json --version YOUR_DOTNET_VERSION'
-
type DirectFilesConfig = {
files: {
name: string
@@ -30,7 +26,6 @@ type DirectFilesConfig = {
connectionStringFile?: string
/** The password ends up inside a connection URL, so special characters must be percent-encoded */
passwordInUrl?: boolean
- postCommands?: { label: string; command: string }[]
}
function DirectFilesContent({ state, connectionStringPooler }: StepContentProps) {
@@ -136,12 +131,6 @@ func main() {
},
],
connectionStringFile: 'appsettings.json',
- postCommands: [
- {
- label: 'Add the configuration package to read the settings.',
- command: DOTNET_CONFIG_COMMAND,
- },
- ],
}
case 'python':
@@ -251,20 +240,6 @@ except Exception as e:
<MultipleCodeBlock files={config.files} value={activeFile} onValueChange={setActiveFile} />
{config.passwordInUrl && <PasswordEncodingNote />}
<ConnectionParameters parameters={buildConnectionParameters(connectionParams)} />
- {(config.postCommands ?? []).map((command) => (
- <div key={command.command} className="flex flex-col gap-2">
- <p className="text-sm text-foreground-light">{command.label}</p>
- <CodeBlock
- className="[&_code]:text-foreground"
- wrapperClassName="lg:col-span-2"
- value={command.command}
- hideLineNumbers
- language="bash"
- >
- {command.command}
- </CodeBlock>
- </div>
- ))}
</div>
)
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/content/steps/install/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/steps/install/content.tsx
index 26863205598..0786e93ac70 100644
--- a/apps/studio/components/interfaces/ConnectSheet/content/steps/install/content.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/content/steps/install/content.tsx
@@ -1,6 +1,5 @@
-import { Copy } from 'lucide-react'
-import { useMemo, useState } from 'react'
-import { Button, copyToClipboard } from 'ui'
+import { useMemo } from 'react'
+import { CodeBlock } from 'ui-patterns/CodeBlock'
import {
EXTRA_PACKAGES,
@@ -36,36 +35,21 @@ function getInstallCommand(state: StepContentProps['state']): string | null {
function InstallContent({ state }: StepContentProps) {
const installCommand = useMemo(() => getInstallCommand(state), [state])
- const [copyLabel, setCopyLabel] = useState('Copy')
if (!installCommand) {
return null
}
- const handleCopy = () => {
- copyToClipboard(installCommand, () => {
- setCopyLabel('Copied')
- setTimeout(() => setCopyLabel('Copy'), 2000)
- })
- }
-
return (
- <div className="relative group">
- <div className="bg-surface-75 border rounded-lg p-3 pr-20 font-mono text-sm text-foreground-light overflow-x-auto">
- <code>{installCommand}</code>
- </div>
- <div className="absolute right-2 top-1/2 -translate-y-1/2">
- <Button
- variant="default"
- size="tiny"
- icon={<Copy size={14} />}
- onClick={handleCopy}
- className="opacity-0 group-hover:opacity-100 transition-opacity"
- >
- {copyLabel}
- </Button>
- </div>
- </div>
+ <CodeBlock
+ className="[&_code]:text-foreground"
+ wrapperClassName="lg:col-span-2"
+ value={installCommand}
+ hideLineNumbers
+ language="bash"
+ >
+ {installCommand}
+ </CodeBlock>
)
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/content/steps/mcp/claude-code/authenticate/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/steps/mcp/claude-code/authenticate/content.tsx
index 27106ed4c35..b5bc06d90ec 100644
--- a/apps/studio/components/interfaces/ConnectSheet/content/steps/mcp/claude-code/authenticate/content.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/content/steps/mcp/claude-code/authenticate/content.tsx
@@ -11,9 +11,9 @@ function ClaudeAuthenticateContent(_props: StepContentProps) {
hideLineNumbers
language="bash"
/>
- <p className="text-sm text-foreground-light">
- Select the <code className="text-xs bg-surface-300 px-1 py-0.5 rounded-sm">supabase</code>{' '}
- server, then <span className="font-medium">Authenticate</span> to begin the flow.
+ <p className="text-sm text-foreground-lighter">
+ Select the <code className="text-code-inline">supabase</code> server, then{' '}
+ <code className="text-code-inline">Authenticate</code> to begin the flow.
</p>
</div>
)
diff --git a/apps/studio/components/interfaces/ConnectSheet/content/steps/mcp/codex/verify/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/steps/mcp/codex/verify/content.tsx
index a866f26f6eb..58398267403 100644
--- a/apps/studio/components/interfaces/ConnectSheet/content/steps/mcp/codex/verify/content.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/content/steps/mcp/codex/verify/content.tsx
@@ -1,11 +1,18 @@
+import { CodeBlock } from 'ui-patterns/CodeBlock'
+
import type { StepContentProps } from '@/components/interfaces/ConnectSheet/Connect.types'
function CodexVerifyContent(_props: StepContentProps) {
return (
<div className="space-y-2">
- <p className="text-sm text-foreground-light">
- Run <code className="text-xs bg-surface-300 px-1 py-0.5 rounded-sm">/mcp</code> inside Codex
- to verify authentication.
+ <CodeBlock
+ className="[&_code]:text-foreground"
+ value="/mcp"
+ hideLineNumbers
+ language="bash"
+ />
+ <p className="text-sm text-foreground-lighter">
+ Run this inside Codex to verify authentication.
</p>
</div>
)
diff --git a/apps/studio/components/interfaces/ConnectSheet/content/steps/shadcn/command/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/steps/shadcn/command/content.tsx
index ff53feb4617..349cfa824da 100644
--- a/apps/studio/components/interfaces/ConnectSheet/content/steps/shadcn/command/content.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/content/steps/shadcn/command/content.tsx
@@ -1,8 +1,8 @@
-import { Copy } from 'lucide-react'
-import { useMemo, useState } from 'react'
-import { Button, copyToClipboard } from 'ui'
+import { useMemo } from 'react'
+import { CodeBlock } from 'ui-patterns/CodeBlock'
import type { StepContentProps } from '@/components/interfaces/ConnectSheet/Connect.types'
+import { InlineLink } from '@/components/ui/InlineLink'
function getShadcnCommand(state: StepContentProps['state']): string | null {
if (state.framework === 'nextjs') {
@@ -18,33 +18,24 @@ function getShadcnCommand(state: StepContentProps['state']): string | null {
function ShadcnCommandContent({ state }: StepContentProps) {
const command = useMemo(() => getShadcnCommand(state), [state])
- const [copyLabel, setCopyLabel] = useState('Copy')
if (!command) return null
- const handleCopy = () => {
- copyToClipboard(command, () => {
- setCopyLabel('Copied')
- setTimeout(() => setCopyLabel('Copy'), 2000)
- })
- }
-
return (
- <div className="relative group">
- <div className="bg-surface-75 border rounded-lg p-3 pr-20 font-mono text-sm text-foreground-light overflow-x-auto">
- <code>{command}</code>
- </div>
- <div className="absolute right-2 top-1/2 -translate-y-1/2">
- <Button
- variant="default"
- size="tiny"
- icon={<Copy size={14} />}
- onClick={handleCopy}
- className="opacity-0 group-hover:opacity-100 transition-opacity"
- >
- {copyLabel}
- </Button>
- </div>
+ <div className="flex flex-col gap-2">
+ <CodeBlock
+ className="[&_code]:text-foreground"
+ wrapperClassName="lg:col-span-2"
+ value={command}
+ hideLineNumbers
+ language="bash"
+ >
+ {command}
+ </CodeBlock>
+ <p className="text-sm text-foreground-lighter">
+ Add UI components for auth, realtime, storage, and more at{' '}
+ <InlineLink href="https://supabase.com/ui">supabase.com/ui</InlineLink>.
+ </p>
</div>
)
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/content/steps/shadcn/explore/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/steps/shadcn/explore/content.tsx
deleted file mode 100644
index ddf1361fe53..00000000000
--- a/apps/studio/components/interfaces/ConnectSheet/content/steps/shadcn/explore/content.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { ExternalLink } from 'lucide-react'
-import { Button } from 'ui'
-
-import type { StepContentProps } from '@/components/interfaces/ConnectSheet/Connect.types'
-
-function ShadcnExploreContent(_props: StepContentProps) {
- return (
- <Button asChild variant="default" icon={<ExternalLink size={14} />}>
- <a href="https://supabase.com/ui" target="_blank" rel="noreferrer">
- Explore supabase.com/ui
- </a>
- </Button>
- )
-}
-
-export default ShadcnExploreContent
diff --git a/apps/studio/components/interfaces/ConnectSheet/content/steps/skills-install/content.tsx b/apps/studio/components/interfaces/ConnectSheet/content/steps/skills-install/content.tsx
index 0943a9da403..f727860651e 100644
--- a/apps/studio/components/interfaces/ConnectSheet/content/steps/skills-install/content.tsx
+++ b/apps/studio/components/interfaces/ConnectSheet/content/steps/skills-install/content.tsx
@@ -1,6 +1,4 @@
-import { Copy } from 'lucide-react'
-import { useState } from 'react'
-import { Button, copyToClipboard } from 'ui'
+import { CodeBlock } from 'ui-patterns/CodeBlock'
import type { StepContentProps } from '@/components/interfaces/ConnectSheet/Connect.types'
@@ -8,34 +6,18 @@ const DEFAULT_SKILLS_COMMAND = 'npx skills add supabase/agent-skills'
const SERVER_SKILLS_COMMAND = 'npx skills add supabase/server'
function SkillsInstallContent({ state }: StepContentProps) {
- const [copyLabel, setCopyLabel] = useState('Copy')
-
const skillsCommand = state.mode === 'server' ? SERVER_SKILLS_COMMAND : DEFAULT_SKILLS_COMMAND
- const handleCopy = () => {
- copyToClipboard(skillsCommand, () => {
- setCopyLabel('Copied')
- setTimeout(() => setCopyLabel('Copy'), 2000)
- })
- }
-
return (
- <div className="relative group">
- <div className="bg-surface-75 border rounded-lg p-3 pr-20 font-mono text-sm text-foreground-light overflow-x-auto">
- <code>{skillsCommand}</code>
- </div>
- <div className="absolute right-2 top-1/2 -translate-y-1/2">
- <Button
- variant="default"
- size="tiny"
- icon={<Copy size={14} />}
- onClick={handleCopy}
- className="opacity-0 group-hover:opacity-100 transition-opacity"
- >
- {copyLabel}
- </Button>
- </div>
- </div>
+ <CodeBlock
+ className="[&_code]:text-foreground"
+ wrapperClassName="lg:col-span-2"
+ value={skillsCommand}
+ hideLineNumbers
+ language="bash"
+ >
+ {skillsCommand}
+ </CodeBlock>
)
}
diff --git a/apps/studio/components/interfaces/ConnectSheet/useConnectState.ts b/apps/studio/components/interfaces/ConnectSheet/useConnectState.ts
index 4182fc684d4..85325cb8eff 100644
--- a/apps/studio/components/interfaces/ConnectSheet/useConnectState.ts
+++ b/apps/studio/components/interfaces/ConnectSheet/useConnectState.ts
@@ -1,6 +1,6 @@
import { useParams } from 'common'
import { useCallback, useMemo, useState } from 'react'
-import { FEATURE_GROUPS_PLATFORM, MCP_CLIENTS } from 'ui-patterns/McpUrlBuilder'
+import { MCP_CLIENTS } from 'ui-patterns/McpUrlBuilder'
import {
connectionStringMethodOptions,
@@ -15,7 +15,12 @@ import {
resetDependentFields,
resolveSteps,
} from './connect.resolver'
-import { connectSchema } from './connect.schema'
+import {
+ connectSchema,
+ getDefaultMcpFeatures,
+ getSupportedMcpFeatureGroups,
+ normalizeMcpFeatures,
+} from './connect.schema'
import type {
ConnectMode,
ConnectSchema,
@@ -161,7 +166,7 @@ function getFieldOptionsFromSource({
}))
case 'mcpFeatures':
- return FEATURE_GROUPS_PLATFORM.map((f) => ({
+ return getSupportedMcpFeatureGroups(deploymentMode.isPlatform).map((f) => ({
value: f.id,
label: f.name,
description: f.description,
@@ -337,14 +342,21 @@ export function useConnectState(initialState?: Partial<ConnectState>): UseConnec
next.orm = ORMS[0]?.key ?? ''
}
- if (mode === 'mcp' && !next.mcpClient) {
- next.mcpClient = MCP_CLIENTS[0]?.key ?? ''
+ if (mode === 'mcp') {
+ if (!next.mcpClient) {
+ next.mcpClient = MCP_CLIENTS[0]?.key ?? ''
+ }
+ if (next.mcpFeatures === undefined) {
+ next.mcpFeatures = getDefaultMcpFeatures(deploymentMode.isPlatform)
+ } else if (Array.isArray(next.mcpFeatures)) {
+ next.mcpFeatures = normalizeMcpFeatures(next.mcpFeatures, deploymentMode.isPlatform)
+ }
}
return next
})
},
- [projectRef, deploymentMode.isSelfHosted]
+ [projectRef, deploymentMode.isSelfHosted, deploymentMode.isPlatform]
)
const activeFields = useMemo(() => {
diff --git a/apps/studio/components/ui/CopyButton.tsx b/apps/studio/components/ui/CopyButton.tsx
index fbf10834285..29f276be2e8 100644
--- a/apps/studio/components/ui/CopyButton.tsx
+++ b/apps/studio/components/ui/CopyButton.tsx
@@ -57,7 +57,7 @@ const CopyButton = forwardRef<HTMLButtonElement, CopyButtonProps>(
}}
{...props}
variant={variant}
- className={cn({ 'px-1': iconOnly }, className)}
+ className={cn({ 'px-1.5': iconOnly }, className)}
icon={
showCopied ? (
<Check
diff --git a/apps/studio/package.json b/apps/studio/package.json
index 082bcecfc09..3a409431595 100644
--- a/apps/studio/package.json
+++ b/apps/studio/package.json
@@ -91,6 +91,7 @@
"ai": "^6.0.174",
"ai-commands": "workspace:*",
"awesome-debounce-promise": "^2.1.0",
+ "class-variance-authority": "^0.7.1",
"common": "workspace:*",
"common-tags": "^1.8.2",
"config": "workspace:*",
diff --git a/packages/ui-patterns/src/McpUrlBuilder/McpConfigPanel.tsx b/packages/ui-patterns/src/McpUrlBuilder/McpConfigPanel.tsx
index 31893e1ee57..c39e40588b9 100644
--- a/packages/ui-patterns/src/McpUrlBuilder/McpConfigPanel.tsx
+++ b/packages/ui-patterns/src/McpUrlBuilder/McpConfigPanel.tsx
@@ -54,10 +54,12 @@ export function McpConfigPanel({
nonPlatformUrl,
}: McpConfigPanelProps) {
const [readonly, setReadonly] = useState(false)
- const [selectedFeatures, setSelectedFeatures] = useState<string[]>([])
+ const supportedFeatures = isPlatform ? FEATURE_GROUPS_PLATFORM : FEATURE_GROUPS_NON_PLATFORM
+ const [selectedFeatures, setSelectedFeatures] = useState<string[]>(() =>
+ supportedFeatures.filter((group) => group.id !== 'storage').map((group) => group.id)
+ )
const [selectedClient, setSelectedClient] = useState(initialSelectedClient ?? MCP_CLIENTS[0])
- const supportedFeatures = isPlatform ? FEATURE_GROUPS_PLATFORM : FEATURE_GROUPS_NON_PLATFORM
const selectedFeaturesSupported = useMemo(() => {
return selectedFeatures.filter((feature) =>
supportedFeatures.some((group) => group.id === feature)
diff --git a/packages/ui-patterns/src/McpUrlBuilder/components/McpConfigurationOptions.tsx b/packages/ui-patterns/src/McpUrlBuilder/components/McpConfigurationOptions.tsx
index a068fa02ec3..695cea5834b 100644
--- a/packages/ui-patterns/src/McpUrlBuilder/components/McpConfigurationOptions.tsx
+++ b/packages/ui-patterns/src/McpUrlBuilder/components/McpConfigurationOptions.tsx
@@ -50,15 +50,15 @@ export function McpConfigurationOptions({
<div className="flex items-center gap-2">
<Label className="text-sm">Feature Groups</Label>
<InfoTooltip>
- Only enable a subset of features. Helps keep the number of tools within MCP client
- limits
+ Choose which MCP tools to include. Storage is off by default to keep tool counts
+ manageable.
</InfoTooltip>
</div>
<MultiSelector values={selectedFeatures} onValuesChange={onFeaturesChange}>
<MultiSelectorTrigger
className="w-full"
- label="All features except Storage enabled by default"
+ label="Select features"
badgeLimit="wrap"
showIcon={true}
/>
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 95702943339..774c859a789 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1044,6 +1044,9 @@ importers:
awesome-debounce-promise:
specifier: ^2.1.0
version: 2.1.0
+ class-variance-authority:
+ specifier: ^0.7.1
+ version: 0.7.1
common:
specifier: workspace:*
version: link:../../packages/common