Skip to content

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

feat(www + studio): promote Select 2026 in www and Dashboard (#49511)

Danny Whiteb5462ee7bbe7
diff --git a/apps/studio/components/layouts/ProjectLayout/index.test.tsx b/apps/studio/components/layouts/ProjectLayout/index.test.tsx
index e02dcd5f7dd..6c7b2601677 100644
--- a/apps/studio/components/layouts/ProjectLayout/index.test.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/index.test.tsx
@@ -176,6 +176,7 @@ vi.mock('@/hooks/misc/useLocalStorage', () => ({
vi.mock('@/components/ui/BannerStack/BannerStackProvider', () => ({
BANNER_ID: {
FREE_MICRO_UPGRADE: 'free-micro-upgrade-banner',
+ SELECT_26: 'select-2026-banner',
},
useBannerStack: () => ({
addBanner: mockAddBanner,
@@ -247,7 +248,11 @@ describe('ProjectLayout title', () => {
integration_source: null,
}
mockBannerDismissedState.current = false
- mockUseLocalStorageQuery.mockImplementation(() => [mockBannerDismissedState.current, vi.fn()])
+ mockUseLocalStorageQuery.mockImplementation(() => [
+ mockBannerDismissedState.current,
+ vi.fn(),
+ { isSuccess: true },
+ ])
})
afterEach(() => {
diff --git a/apps/studio/components/layouts/ProjectLayout/index.tsx b/apps/studio/components/layouts/ProjectLayout/index.tsx
index 3e63092a140..98a01a4a618 100644
--- a/apps/studio/components/layouts/ProjectLayout/index.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/index.tsx
@@ -1,4 +1,4 @@
-import { LOCAL_STORAGE_KEYS, mergeRefs, useParams } from 'common'
+import { IS_PLATFORM, LOCAL_STORAGE_KEYS, mergeRefs, useParams } from 'common'
import { AnimatePresence, motion } from 'framer-motion'
import { XIcon } from 'lucide-react'
import Head from 'next/head'
@@ -23,6 +23,10 @@ import {
useIsMobile,
usePanelRef,
} from 'ui'
+import {
+ SELECT_26_STUDIO_DISMISSAL_KEY,
+ useSelect26PromotionActive,
+} from 'ui-patterns/Banners/Select26Promotion'
import { useEditorType } from '../editors/EditorsLayout.hooks'
import { useMainScrollContainer, useSetMainScrollContainer } from '../MainScrollContainerContext'
@@ -43,6 +47,11 @@ import { UpgradingState } from './UpgradingState'
import { CreateBranchModal } from '@/components/interfaces/BranchManagement/CreateBranchModal'
import { ProjectAPIDocs } from '@/components/interfaces/ProjectAPIDocs/ProjectAPIDocs'
import { BannerFreeMicroUpgrade } from '@/components/ui/BannerStack/Banners/BannerFreeMicroUpgrade'
+import { BannerSelect2026 } from '@/components/ui/BannerStack/Banners/BannerSelect2026'
+import {
+ SELECT_26_BANNER_PRIORITY,
+ shouldShowSelect26Banner,
+} from '@/components/ui/BannerStack/Banners/BannerSelect2026.utils'
import { BANNER_ID, useBannerStack } from '@/components/ui/BannerStack/BannerStackProvider'
import { ButtonTooltip } from '@/components/ui/ButtonTooltip'
import PartnerIcon from '@/components/ui/PartnerIcon'
@@ -156,6 +165,9 @@ export const ProjectLayout = forwardRef<HTMLDivElement, PropsWithChildren<Projec
LOCAL_STORAGE_KEYS.FREE_MICRO_UPGRADE_BANNER_DISMISSED(selectedProject?.ref ?? ''),
false
)
+ const [isSelect26BannerDismissed, , { isSuccess: isSelect26DismissalLoaded }] =
+ useLocalStorageQuery(SELECT_26_STUDIO_DISMISSAL_KEY, false)
+ const isSelect26PromotionActive = useSelect26PromotionActive()
const [isProjectIntegrationBannerDismissed, setIsProjectIntegrationBannerDismissed] =
useLocalStorageQuery(
getProjectIntegrationBannerDismissKey({
@@ -233,6 +245,38 @@ export const ProjectLayout = forwardRef<HTMLDivElement, PropsWithChildren<Projec
dismissBanner,
])
+ useEffect(() => {
+ // Wait until project + dismissal state are known so we do not call
+ // dismissBanner on every early render (it always schedules a setState).
+ if (!selectedProject?.ref || !isSelect26DismissalLoaded) return
+
+ const shouldShow = shouldShowSelect26Banner({
+ isPlatform: IS_PLATFORM,
+ projectRef: selectedProject.ref,
+ dismissalLoaded: isSelect26DismissalLoaded,
+ isActive: isSelect26PromotionActive,
+ isDismissed: isSelect26BannerDismissed,
+ })
+
+ if (shouldShow) {
+ addBanner({
+ id: BANNER_ID.SELECT_26,
+ isDismissed: false,
+ content: <BannerSelect2026 />,
+ priority: SELECT_26_BANNER_PRIORITY,
+ })
+ } else {
+ dismissBanner(BANNER_ID.SELECT_26)
+ }
+ }, [
+ selectedProject?.ref,
+ isSelect26DismissalLoaded,
+ isSelect26PromotionActive,
+ isSelect26BannerDismissed,
+ addBanner,
+ dismissBanner,
+ ])
+
useLayoutEffect(() => {
const unregister = registerOpenMenu(() => {
setMobileSheetContent(
diff --git a/apps/studio/components/ui/BannerStack/BannerCard.tsx b/apps/studio/components/ui/BannerStack/BannerCard.tsx
index 9187afce36e..7e21b9a32df 100644
--- a/apps/studio/components/ui/BannerStack/BannerCard.tsx
+++ b/apps/studio/components/ui/BannerStack/BannerCard.tsx
@@ -7,24 +7,27 @@ interface BannerCardProps {
onDismiss?: () => void
children: React.ReactNode
className?: string
+ background?: React.ReactNode
}
-export const BannerCard = ({ onDismiss, children, className }: BannerCardProps) => {
+export const BannerCard = ({ onDismiss, children, className, background }: BannerCardProps) => {
return (
<Card className={cn('relative overflow-hidden shadow-lg rounded-2xl', className)}>
- <div className="absolute -inset-16 z-0 opacity-100 pointer-events-none">
- <img
- src={`${BASE_PATH}/img/reports/bg-grafana-dark.svg`}
- alt="Background pattern"
- className="w-full h-full object-cover object-right hidden dark:block"
- />
- <img
- src={`${BASE_PATH}/img/reports/bg-grafana-light.svg`}
- alt="Background pattern"
- 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>
+ {background ?? (
+ <div className="absolute -inset-16 z-0 opacity-100 pointer-events-none">
+ <img
+ src={`${BASE_PATH}/img/reports/bg-grafana-dark.svg`}
+ alt="Background pattern"
+ className="w-full h-full object-cover object-right hidden dark:block"
+ />
+ <img
+ src={`${BASE_PATH}/img/reports/bg-grafana-light.svg`}
+ alt="Background pattern"
+ 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>
+ )}
<CardContent className="relative z-10 p-6">
{onDismiss && (
diff --git a/apps/studio/components/ui/BannerStack/BannerStackProvider.tsx b/apps/studio/components/ui/BannerStack/BannerStackProvider.tsx
index dc7fedb900a..4c95ece2585 100644
--- a/apps/studio/components/ui/BannerStack/BannerStackProvider.tsx
+++ b/apps/studio/components/ui/BannerStack/BannerStackProvider.tsx
@@ -8,6 +8,7 @@ export const BANNER_ID = {
FREE_MICRO_UPGRADE: 'free-micro-upgrade-banner',
TOS_UPDATE: 'tos-update-banner',
LOGS_ALL_DEPRECATION: 'logs-all-deprecation-banner',
+ SELECT_26: 'select-2026-banner',
} as const
export type BannerId = (typeof BANNER_ID)[keyof typeof BANNER_ID]
diff --git a/apps/studio/components/ui/BannerStack/Banners/BannerSelect2026.tsx b/apps/studio/components/ui/BannerStack/Banners/BannerSelect2026.tsx
new file mode 100644
index 00000000000..7e67a86157b
--- /dev/null
+++ b/apps/studio/components/ui/BannerStack/Banners/BannerSelect2026.tsx
@@ -0,0 +1,65 @@
+import { ArrowUpRight } from 'lucide-react'
+import Link from 'next/link'
+import { Button } from 'ui'
+import {
+ SELECT_26_CTA,
+ SELECT_26_DESCRIPTION,
+ SELECT_26_STUDIO_DISMISSAL_KEY,
+ SELECT_26_TITLE,
+ SELECT_26_URL,
+ Select26Field,
+} from 'ui-patterns/Banners/Select26Promotion'
+
+import { BannerCard } from '../BannerCard'
+import { BANNER_ID, useBannerStack } from '../BannerStackProvider'
+import { useLocalStorageQuery } from '@/hooks/misc/useLocalStorage'
+
+export const BannerSelect2026 = () => {
+ const { dismissBanner } = useBannerStack()
+ const [, setIsDismissed] = useLocalStorageQuery(SELECT_26_STUDIO_DISMISSAL_KEY, false)
+
+ const dismiss = () => {
+ setIsDismissed(true)
+ dismissBanner(BANNER_ID.SELECT_26)
+ }
+
+ return (
+ <BannerCard
+ onDismiss={dismiss}
+ className="w-72 border-[#00482f]/15 bg-[#f8f3ef] text-[#001a10] dark:border-white/10 dark:bg-[#0b0e0d] dark:text-[#f8f3ef]"
+ background={
+ <>
+ {/* Wider than the card so overflow-hidden clips left/right flush to the edges */}
+ <Select26Field
+ cols={36}
+ rows={8}
+ className="absolute left-1/2 top-0 z-0 -translate-x-1/2 -translate-y-[32%] text-xl opacity-90 dark:opacity-80"
+ />
+ <div className="pointer-events-none absolute inset-0 z-[1] bg-linear-to-b from-transparent from-[6%] via-[#f8f3ef]/85 via-[36%] to-[#f8f3ef] to-[48%] dark:via-[#0b0e0d]/85 dark:to-[#0b0e0d]" />
+ </>
+ }
+ >
+ <div className="flex flex-col gap-y-2">
+ {/* Forehead spacer so the field reads above the copy */}
+ <div className="h-10" aria-hidden />
+ <div className="relative z-[2] flex flex-col gap-y-1 mb-2">
+ <p className="text-sm font-medium text-balance">{SELECT_26_TITLE}</p>
+ <p className="text-xs text-foreground-lighter text-balance dark:text-[#f8f3ef]/65">
+ {SELECT_26_DESCRIPTION}
+ </p>
+ </div>
+ <Button
+ asChild
+ variant="default"
+ size="tiny"
+ className="relative z-[2] w-min"
+ iconRight={<ArrowUpRight size={14} strokeWidth={1.5} />}
+ >
+ <Link href={SELECT_26_URL} target="_blank" rel="noopener noreferrer" onClick={dismiss}>
+ {SELECT_26_CTA}
+ </Link>
+ </Button>
+ </div>
+ </BannerCard>
+ )
+}
diff --git a/apps/studio/components/ui/BannerStack/Banners/BannerSelect2026.utils.test.ts b/apps/studio/components/ui/BannerStack/Banners/BannerSelect2026.utils.test.ts
new file mode 100644
index 00000000000..5aa5507834c
--- /dev/null
+++ b/apps/studio/components/ui/BannerStack/Banners/BannerSelect2026.utils.test.ts
@@ -0,0 +1,31 @@
+import { describe, expect, it } from 'vitest'
+
+import { SELECT_26_BANNER_PRIORITY, shouldShowSelect26Banner } from './BannerSelect2026.utils'
+
+const visibleState = {
+ isPlatform: true,
+ projectRef: 'project-ref',
+ dismissalLoaded: true,
+ isActive: true,
+ isDismissed: false,
+}
+
+describe('shouldShowSelect26Banner', () => {
+ it('shows the promotion on hosted project pages', () => {
+ expect(shouldShowSelect26Banner(visibleState)).toBe(true)
+ })
+
+ it.each([
+ ['self-hosted Studio', { isPlatform: false }],
+ ['outside a project', { projectRef: undefined }],
+ ['before dismissal state loads', { dismissalLoaded: false }],
+ ['after campaign expiry', { isActive: false }],
+ ['after dismissal', { isDismissed: true }],
+ ])('hides the promotion %s', (_, state) => {
+ expect(shouldShowSelect26Banner({ ...visibleState, ...state })).toBe(false)
+ })
+
+ it('sits behind every existing non-negative banner priority', () => {
+ expect(SELECT_26_BANNER_PRIORITY).toBe(-1)
+ })
+})
diff --git a/apps/studio/components/ui/BannerStack/Banners/BannerSelect2026.utils.ts b/apps/studio/components/ui/BannerStack/Banners/BannerSelect2026.utils.ts
new file mode 100644
index 00000000000..339d533ce04
--- /dev/null
+++ b/apps/studio/components/ui/BannerStack/Banners/BannerSelect2026.utils.ts
@@ -0,0 +1,15 @@
+export const SELECT_26_BANNER_PRIORITY = -1
+
+export const shouldShowSelect26Banner = ({
+ isPlatform,
+ projectRef,
+ dismissalLoaded,
+ isActive,
+ isDismissed,
+}: {
+ isPlatform: boolean
+ projectRef?: string
+ dismissalLoaded: boolean
+ isActive: boolean
+ isDismissed: boolean
+}) => isPlatform && !!projectRef && dismissalLoaded && isActive && !isDismissed
diff --git a/apps/www/components/Nav/index.tsx b/apps/www/components/Nav/index.tsx
index 565e481b9a3..5c20e1fa310 100644
--- a/apps/www/components/Nav/index.tsx
+++ b/apps/www/components/Nav/index.tsx
@@ -11,6 +11,7 @@ import React, { useState } from 'react'
import { useWindowSize } from 'react-use'
import { Button, buttonVariants, cn } from 'ui'
import { AuthenticatedDropdownMenu } from 'ui-patterns/AuthenticatedDropdownMenu'
+import { AnnouncementBanner } from 'ui-patterns/Banners/AnnouncementBanner'
import {
NavigationMenu,
NavigationMenuContent,
@@ -78,6 +79,7 @@ const Nav = ({ hideNavbar, stickyNavbar = true }: Props) => {
return (
<>
+ <AnnouncementBanner />
<div
className={cn(
'sticky top-0 z-40 transform',
diff --git a/apps/www/components/Products/ProductCard.tsx b/apps/www/components/Products/ProductCard.tsx
index 6187050f45f..a7481f73b13 100644
--- a/apps/www/components/Products/ProductCard.tsx
+++ b/apps/www/components/Products/ProductCard.tsx
@@ -1,7 +1,9 @@
+'use client'
+
import Panel from '~/components/Panel'
-import { detectBrowser, isBrowser } from 'common'
+import { detectBrowser } from 'common'
import Link from 'next/link'
-import React from 'react'
+import React, { useEffect, useState } from 'react'
import { cn } from 'ui'
const ProductCard = ({
@@ -26,73 +28,82 @@ const ProductCard = ({
onClick?: any
alignLeft?: boolean
isDatabase?: boolean
-}) => (
- <Link
- href={url}
- className={cn(
- 'group relative w-full sm:h-[400px] flex flex-col gap-5 lg:flex-row focus-ring rounded-xl',
- className
- )}
- onClick={onClick}
- >
- <Panel
- hasShimmer={isBrowser && detectBrowser() !== 'Safari'}
- hasActiveOnHover
- hasMotion={title.includes('Edge Functions')}
- outerClassName="relative w-full h-full"
- innerClassName={cn(
- 'relative overflow-hidden flex-1 flex flex-row sm:flex-col gap-4 items-start sm:items-center lg:items-start justify-between',
- 'bg-surface-75 w-full h-full text-foreground-lighter [&_strong]:font-normal! [&_strong]:text-foreground!',
- 'p-4 sm:py-6'
+}) => {
+ // Enable cursor shimmer after mount so SSR HTML matches the first client paint.
+ // (isBrowser during render caused a className hydration mismatch on Panel.)
+ const [hasShimmer, setHasShimmer] = useState(false)
+ useEffect(() => {
+ setHasShimmer(detectBrowser() !== 'Safari')
+ }, [])
+
+ return (
+ <Link
+ href={url}
+ className={cn(
+ 'group relative w-full sm:h-[400px] flex flex-col gap-5 lg:flex-row focus-ring rounded-xl',
+ className
)}
+ onClick={onClick}
>
- <div
- className={cn(
- 'relative z-10',
- 'h-full w-full',
- 'mx-auto gap-2 sm:gap-4',
- 'flex flex-col items-start sm:items-center',
- 'text-left sm:text-center',
- alignLeft && !isDatabase && 'lg:mx-0 lg:pl-2 lg:items-start lg:text-left',
- alignLeft &&
- isDatabase &&
- 'md:ml-2 md:mt-2 lg:pl-0 md:justify-start md:max-w-[250px] md:text-left md:items-start'
+ <Panel
+ hasShimmer={hasShimmer}
+ hasActiveOnHover
+ hasMotion={title.includes('Edge Functions')}
+ outerClassName="relative w-full h-full"
+ innerClassName={cn(
+ 'relative overflow-hidden flex-1 flex flex-row sm:flex-col gap-4 items-start sm:items-center lg:items-start justify-between',
+ 'bg-surface-75 w-full h-full text-foreground-lighter [&_strong]:font-normal! [&_strong]:text-foreground!',
+ 'p-4 sm:py-6'
)}
>
- <div className="flex items-center gap-2 text-foreground">
- {icon && (
- <svg
- aria-hidden="true"
- width="18"
- height="18"
- viewBox="0 0 25 25"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- >
- <path
- d={icon}
- stroke="currentColor"
- strokeMiterlimit="10"
- strokeLinejoin="round"
- strokeLinecap="round"
- strokeWidth="1.5"
- />
- </svg>
- )}
- <h2 className="">{title}</h2>
- </div>
- <div className="flex-1 flex flex-col justify-between gap-2">
- <p className="text-sm [&_strong]:text-foreground!">{subtitle}</p>
- {highlights && (
- <span className={cn('hidden lg:block text-foreground', isDatabase && 'md:block')}>
- {highlights}
- </span>
+ <div
+ className={cn(
+ 'relative z-10',
+ 'h-full w-full',
+ 'mx-auto gap-2 sm:gap-4',
+ 'flex flex-col items-start sm:items-center',
+ 'text-left sm:text-center',
+ alignLeft && !isDatabase && 'lg:mx-0 lg:pl-2 lg:items-start lg:text-left',
+ alignLeft &&
+ isDatabase &&
+ 'md:ml-2 md:mt-2 lg:pl-0 md:justify-start md:max-w-[250px] md:text-left md:items-start'
)}
+ >
+ <div className="flex items-center gap-2 text-foreground">
+ {icon && (
+ <svg
+ aria-hidden="true"
+ width="18"
+ height="18"
+ viewBox="0 0 25 25"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d={icon}
+ stroke="currentColor"
+ strokeMiterlimit="10"
+ strokeLinejoin="round"
+ strokeLinecap="round"
+ strokeWidth="1.5"
+ />
+ </svg>
+ )}
+ <h2 className="">{title}</h2>
+ </div>
+ <div className="flex-1 flex flex-col justify-between gap-2">
+ <p className="text-sm [&_strong]:text-foreground!">{subtitle}</p>
+ {highlights && (
+ <span className={cn('hidden lg:block text-foreground', isDatabase && 'md:block')}>
+ {highlights}
+ </span>
+ )}
+ </div>
</div>
- </div>
- {image && <span aria-hidden="true">{image}</span>}
- </Panel>
- </Link>
-)
+ {image && <span aria-hidden="true">{image}</span>}
+ </Panel>
+ </Link>
+ )
+}
export default ProductCard
diff --git a/packages/ui-patterns/package.json b/packages/ui-patterns/package.json
index acae169ac44..8ecf537b45c 100644
--- a/packages/ui-patterns/package.json
+++ b/packages/ui-patterns/package.json
@@ -66,6 +66,18 @@
"import": "./src/Banners/LW15Banner.tsx",
"types": "./src/Banners/LW15Banner.tsx"
},
+ "./Banners/Select26Banner": {
+ "import": "./src/Banners/Select26Banner.tsx",
+ "types": "./src/Banners/Select26Banner.tsx"
+ },
+ "./Banners/Select26Promotion.module.css": {
+ "import": "./src/Banners/Select26Promotion.module.css",
+ "types": "./src/Banners/Select26Promotion.module.css"
+ },
+ "./Banners/Select26Promotion": {
+ "import": "./src/Banners/Select26Promotion.tsx",
+ "types": "./src/Banners/Select26Promotion.tsx"
+ },
"./Banners": {
"import": "./src/Banners/index.ts",
"types": "./src/Banners/index.ts"
diff --git a/packages/ui-patterns/src/Banners/Announcement.tsx b/packages/ui-patterns/src/Banners/Announcement.tsx
index 95142b4f5cb..eda7a0ec823 100644
--- a/packages/ui-patterns/src/Banners/Announcement.tsx
+++ b/packages/ui-patterns/src/Banners/Announcement.tsx
@@ -1,9 +1,8 @@
'use client'
import { X } from 'lucide-react'
-import { usePathname } from 'next/navigation'
import { PropsWithChildren, useEffect, useState } from 'react'
-import { cn } from 'ui'
+import { Button, cn } from 'ui'
export interface AnnouncementProps {
show: boolean
@@ -29,9 +28,6 @@ export const Announcement = ({
}: PropsWithChildren<AnnouncementComponentProps>) => {
const [hidden, setHidden] = useState(true)
- const pathname = usePathname()
- const isLaunchWeekSection = pathname?.includes('launch-week') ?? false
-
// override to hide announcement
if (!show) return null
@@ -57,21 +53,26 @@ export const Announcement = ({
return setHidden(true)
}
- if (!isLaunchWeekSection && hidden) {
+ if (hidden) {
return null
- } else {
- return (
- <div className={cn('relative z-40 w-full', className)}>
- {dismissable && !isLaunchWeekSection && (
- <div
- className="absolute z-50 right-4 flex h-full items-center opacity-100 text-foreground-contrast dark:text-foreground transition-opacity hover:opacity-80 hover:cursor-pointer"
- onClick={handleClose}
- >
- <X size={16} />
- </div>
- )}
- {children}
- </div>
- )
}
+
+ return (
+ <div className={cn('relative z-40 w-full', className)}>
+ {dismissable && (
+ <div className="absolute right-3 top-1/2 z-50 -translate-y-1/2 sm:right-4">
+ <Button
+ type="button"
+ variant="text"
+ size="tiny"
+ icon={<X size={16} strokeWidth={1.5} />}
+ aria-label="Dismiss announcement"
+ onClick={handleClose}
+ className="rounded-md bg-[#f8f3ef]/85 px-1 text-foreground-muted backdrop-blur-[2px] hover:bg-[#f8f3ef] hover:text-foreground dark:bg-[#0b0e0d]/85 dark:hover:bg-[#0b0e0d]"
+ />
+ </div>
+ )}
+ {children}
+ </div>
+ )
}
diff --git a/packages/ui-patterns/src/Banners/AnnouncementBanner.test.tsx b/packages/ui-patterns/src/Banners/AnnouncementBanner.test.tsx
new file mode 100644
index 00000000000..45c70b6f74e
--- /dev/null
+++ b/packages/ui-patterns/src/Banners/AnnouncementBanner.test.tsx
@@ -0,0 +1,81 @@
+import { fireEvent, render, screen, waitFor } from '@testing-library/react'
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+
+import { AnnouncementBanner } from './AnnouncementBanner'
+import {
+ SELECT_26_CTA,
+ SELECT_26_MESSAGE,
+ SELECT_26_TITLE,
+ SELECT_26_URL,
+ SELECT_26_WWW_DISMISSAL_KEY,
+} from './Select26Promotion'
+
+const mockUsePathname = vi.fn(() => '/database')
+
+vi.mock('next/navigation', () => ({ usePathname: () => mockUsePathname() }))
+
+describe('AnnouncementBanner', () => {
+ const storage = new Map<string, string>()
+
+ beforeEach(() => {
+ storage.clear()
+ mockUsePathname.mockReturnValue('/database')
+ Object.defineProperty(window, 'localStorage', {
+ configurable: true,
+ value: {
+ clear: () => storage.clear(),
+ getItem: (key: string) => storage.get(key) ?? null,
+ setItem: (key: string, value: string) => storage.set(key, value),
+ },
+ })
+ vi.useFakeTimers({ shouldAdvanceTime: true })
+ vi.setSystemTime(new Date('2026-08-25T00:00:00-07:00'))
+ })
+
+ afterEach(() => vi.useRealTimers())
+
+ it('shows the complete Select promotion and external CTA', async () => {
+ render(<AnnouncementBanner />)
+
+ const message = await screen.findByText((_, element) => {
+ return element?.tagName === 'P' && element.textContent === SELECT_26_MESSAGE
+ })
+ expect(message).toBeVisible()
+ expect(screen.getByText(SELECT_26_TITLE)).toBeVisible()
+ expect(screen.getByRole('link', { name: new RegExp(SELECT_26_CTA) })).toHaveAttribute(
+ 'href',
+ SELECT_26_URL
+ )
+ expect(screen.getByRole('link', { name: new RegExp(SELECT_26_CTA) })).toHaveAttribute(
+ 'target',
+ '_blank'
+ )
+ })
+
+ it('persists dismissal using the Select 2026 campaign key', async () => {
+ render(<AnnouncementBanner />)
+
+ fireEvent.click(await screen.findByRole('button', { name: 'Dismiss announcement' }))
+
+ expect(window.localStorage.getItem(SELECT_26_WWW_DISMISSAL_KEY)).toBe('hidden')
+ await waitFor(() => expect(screen.queryByText(SELECT_26_TITLE)).not.toBeInTheDocument())
+ })
+
+ it('honours a previously persisted dismissal', () => {
+ window.localStorage.setItem(SELECT_26_WWW_DISMISSAL_KEY, 'hidden')
+
+ render(<AnnouncementBanner />)
+
+ expect(screen.queryByText(SELECT_26_TITLE)).not.toBeInTheDocument()
+ })
+
+ it('remains dismissible on launch-week routes', async () => {
+ mockUsePathname.mockReturnValue('/launch-week')
+ render(<AnnouncementBanner />)
+
+ fireEvent.click(await screen.findByRole('button', { name: 'Dismiss announcement' }))
+
+ expect(window.localStorage.getItem(SELECT_26_WWW_DISMISSAL_KEY)).toBe('hidden')
+ await waitFor(() => expect(screen.queryByText(SELECT_26_TITLE)).not.toBeInTheDocument())
+ })
+})
diff --git a/packages/ui-patterns/src/Banners/AnnouncementBanner.tsx b/packages/ui-patterns/src/Banners/AnnouncementBanner.tsx
index e2386daad1a..3ebf3a7615a 100644
--- a/packages/ui-patterns/src/Banners/AnnouncementBanner.tsx
+++ b/packages/ui-patterns/src/Banners/AnnouncementBanner.tsx
@@ -1,13 +1,20 @@
+'use client'
+
import { Announcement } from './Announcement'
import announcementJSON from './data.json'
-import LW15Banner from './LW15Banner'
+import { Select26Banner } from './Select26Banner'
+import { SELECT_26_WWW_DISMISSAL_KEY, useSelect26PromotionActive } from './Select26Promotion'
export const announcement = announcementJSON
export const AnnouncementBanner = () => {
+ const isActive = useSelect26PromotionActive()
+
+ if (!isActive) return null
+
return (
- <Announcement show={true} announcementKey="announcement_lw15_d2">
- <LW15Banner />
+ <Announcement show announcementKey={SELECT_26_WWW_DISMISSAL_KEY}>
+ <Select26Banner />
</Announcement>
)
}
diff --git a/packages/ui-patterns/src/Banners/Select26Banner.tsx b/packages/ui-patterns/src/Banners/Select26Banner.tsx
new file mode 100644
index 00000000000..4095031ef65
--- /dev/null
+++ b/packages/ui-patterns/src/Banners/Select26Banner.tsx
@@ -0,0 +1,39 @@
+'use client'
+
+import { ArrowUpRight } from 'lucide-react'
+import Link from 'next/link'
+
+import { SELECT_26_CTA, SELECT_26_TITLE, SELECT_26_URL, Select26Field } from './Select26Promotion'
+
+export const Select26Banner = () => (
+ <div className="relative isolate flex min-h-14 w-full items-center overflow-hidden border-b border-[#00482f]/15 bg-[#f8f3ef] px-4 py-2.5 pr-12 text-base font-medium text-[#001a10] dark:border-white/10 dark:bg-[#0b0e0d] dark:text-[#f8f3ef] sm:px-6 sm:pr-14">
+ <Select26Field
+ cols={24}
+ rows={7}
+ className="absolute left-0 top-1/2 -z-10 hidden -translate-y-1/2 text-sm opacity-80 dark:opacity-70 sm:grid md:text-base xl:text-[0.95rem]"
+ />
+ <Select26Field
+ cols={24}
+ rows={7}
+ className="absolute right-0 top-1/2 -z-10 grid -translate-y-1/2 -scale-x-100 text-sm opacity-80 dark:opacity-70 md:text-base xl:text-[0.95rem]"
+ />
+ <div className="relative z-10 ml-0 mr-auto flex w-fit max-w-full flex-wrap items-center justify-start gap-x-2 gap-y-1.5 rounded-md bg-[#f8f3ef] px-2.5 py-1 sm:mx-auto sm:flex-nowrap sm:justify-center sm:gap-x-2.5 sm:px-3.5 dark:bg-[#0b0e0d]">
+ <p className="text-left leading-5 sm:text-center">
+ {SELECT_26_TITLE}
+ <span className="hidden sm:inline"> is coming October 2</span>
+ </p>
+ <span aria-hidden className="text-[#00482f]/20 dark:text-white/15">
+ ▪
+ </span>
+ <Link
+ href={SELECT_26_URL}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="group inline-flex shrink-0 items-center gap-1 text-[#00482f] underline decoration-[#00482f]/35 underline-offset-4 transition-colors hover:decoration-[#00482f] dark:text-[#94e6b7] dark:decoration-[#94e6b7]/40 dark:hover:decoration-[#94e6b7]"
+ >
+ {SELECT_26_CTA}
+ <ArrowUpRight className="size-4 transition-transform group-hover:-translate-y-0.5 group-hover:translate-x-0.5 motion-reduce:transform-none" />
+ </Link>
+ </div>
+ </div>
+)
diff --git a/packages/ui-patterns/src/Banners/Select26Promotion.module.css b/packages/ui-patterns/src/Banners/Select26Promotion.module.css
new file mode 100644
index 00000000000..044c810bf98
--- /dev/null
+++ b/packages/ui-patterns/src/Banners/Select26Promotion.module.css
@@ -0,0 +1,65 @@
+@font-face {
+ font-family: 'Departure Mono Superbase';
+ src: url('./fonts/DepartureMonoSuperbase-Regular.woff2') format('woff2');
+ font-weight: 400;
+ font-style: normal;
+ font-display: swap;
+}
+
+.field {
+ font-family: 'Departure Mono Superbase', ui-monospace, monospace;
+ font-weight: 400;
+ letter-spacing: 0;
+ line-height: 1;
+ pointer-events: none;
+ user-select: none;
+ /* Select green ramp — matches socials / glyph-engine exports */
+ --select26-b0: #00482f;
+ --select26-b1: #00a85a;
+ --select26-b2: #3ecf8e;
+ --select26-b3: #6dd9a8;
+ --select26-b4: #95e6b8;
+}
+
+:global(.dark) .field,
+:global([data-theme='dark']) .field {
+ --select26-b0: #00bd58;
+ --select26-b1: #3ecf8e;
+ --select26-b2: #95e6b8;
+ --select26-b3: #e1fcd7;
+ --select26-b4: #ffffff;
+}
+
+.cell {
+ display: grid;
+ place-items: center;
+ /* Select logo-grid cell: 22×40 at 34px → width/height in em of the field font-size */
+ width: calc(22 / 34 * 1em);
+ height: calc(40 / 34 * 1em);
+}
+
+.cell[data-band='0'] {
+ color: var(--select26-b0);
+}
+
+.cell[data-band='1'] {
+ color: var(--select26-b1);
+}
+
+.cell[data-band='2'] {
+ color: var(--select26-b2);
+}
+
+.cell[data-band='3'] {
+ color: var(--select26-b3);
+}
+
+.cell[data-band='4'] {
+ color: var(--select26-b4);
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .cell {
+ transition: none;
+ }
+}
diff --git a/packages/ui-patterns/src/Banners/Select26Promotion.test.ts b/packages/ui-patterns/src/Banners/Select26Promotion.test.ts
new file mode 100644
index 00000000000..d43d9ad7152
--- /dev/null
+++ b/packages/ui-patterns/src/Banners/Select26Promotion.test.ts
@@ -0,0 +1,36 @@
+import { act, renderHook } from '@testing-library/react'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+
+import { isSelect26PromotionActive, useSelect26PromotionActive } from './Select26Promotion'
+
+afterEach(() => vi.useRealTimers())
+
+describe('isSelect26PromotionActive', () => {
+ it('is active immediately before the campaign expiry', () => {
+ expect(isSelect26PromotionActive(new Date('2026-10-02T23:59:59.999-07:00').getTime())).toBe(
+ true
+ )
+ })
+
+ it('is inactive at the campaign expiry', () => {
+ expect(isSelect26PromotionActive(new Date('2026-10-03T00:00:00-07:00').getTime())).toBe(false)
+ })
+
+ it('is inactive after the campaign expiry', () => {
+ expect(isSelect26PromotionActive(new Date('2026-10-03T00:00:00.001-07:00').getTime())).toBe(
+ false
+ )
+ })
+
+ it('becomes inactive when an open page reaches the expiry', () => {
+ vi.useFakeTimers()
+ vi.setSystemTime(new Date('2026-10-02T23:59:59.999-07:00'))
+ const { result } = renderHook(() => useSelect26PromotionActive())
+
+ expect(result.current).toBe(true)
+
+ act(() => vi.advanceTimersByTime(1))
+
+ expect(result.current).toBe(false)
+ })
+})
diff --git a/packages/ui-patterns/src/Banners/Select26Promotion.tsx b/packages/ui-patterns/src/Banners/Select26Promotion.tsx
new file mode 100644
index 00000000000..d398b2c35c0
--- /dev/null
+++ b/packages/ui-patterns/src/Banners/Select26Promotion.tsx
@@ -0,0 +1,175 @@
+'use client'
+
+import { useEffect, useMemo, useRef, useState, type HTMLAttributes } from 'react'
+import { cn } from 'ui'
+
+import styles from './Select26Promotion.module.css'
+
+export const SELECT_26_URL = 'https://select.supabase.com/'
+/** Studio Banner Stack card title. */
+export const SELECT_26_TITLE = 'Supabase Select 2026'
+/** www announcement banner copy. */
+export const SELECT_26_MESSAGE = 'Supabase Select 2026 is coming October 2'
+export const SELECT_26_DESCRIPTION =
+ 'A curated day of talks by the industry’s best builders. Join us on October 2nd in San Francisco.'
+export const SELECT_26_CTA = 'Apply to attend'
+export const SELECT_26_EXPIRY = '2026-10-03T00:00:00-07:00'
+export const SELECT_26_WWW_DISMISSAL_KEY = 'announcement_select_26_08'
+export const SELECT_26_STUDIO_DISMISSAL_KEY = 'select-2026-promotion-dismissed'
+
+const SELECT_26_EXPIRY_MS = new Date(SELECT_26_EXPIRY).getTime()
+const MAX_TIMEOUT_MS = 2_147_483_647
+
+/** Mirrored bracket vocabulary from Select 2026 glyph-engine `brackets` / socials exports. */
+const OPEN_BRACKETS = ['‹', '{', '[', '('] as const
+const CLOSE_BRACKETS = ['›', '}', ']', ')'] as const
+
+/**
+ * Radial sweep angular speed (rad / ms). Glyph-engine radar uses 0.004;
+ * banners run slower so the beam reads without feeling frantic.
+ */
+const SWEEP_SPEED = 0.00055
+/** Bracket face step period (ms), matching glyph-engine `bracketFace`. */
+const BRACKET_STEP_MS = 170
+/** Stepped paint rate — closer to glyph-engine `step` tween than 60fps React. */
+const FRAME_INTERVAL_MS = 70
+
+const positiveModulo = (value: number, modulo: number) => ((value % modulo) + modulo) % modulo
+
+export const isSelect26PromotionActive = (now = Date.now()) => now < SELECT_26_EXPIRY_MS
+
+export const useSelect26PromotionActive = () => {
+ const [isActive, setIsActive] = useState(() => isSelect26PromotionActive())
+
+ useEffect(() => {
+ if (!isActive) return
+ let timeoutId: ReturnType<typeof setTimeout> | undefined
+ const armExpiryTimer = () => {
+ const remainingMs = SELECT_26_EXPIRY_MS - Date.now()
+ if (remainingMs <= 0) {
+ setIsActive(false)
+ return
+ }
+ timeoutId = setTimeout(armExpiryTimer, Math.min(remainingMs, MAX_TIMEOUT_MS))
+ }
+ armExpiryTimer()
+ return () => clearTimeout(timeoutId)
+ }, [isActive])
+
+ return isActive
+}
+
+type FieldCell = {
+ ch: string
+ /** Palette band 0–4 around the sweep. */
+ band: number
+ /** Beam proximity 0–1 (radar falloff). */
+ weight: number
+}
+
+const cellAt = (x: number, y: number, cols: number, rows: number, timeMs: number): FieldCell => {
+ const cx = (cols - 1) / 2
+ const cy = (rows - 1) / 2
+ const nx = x - cx
+ const ny = y - cy
+ const angle = Math.atan2(ny, nx)
+ const sweep = positiveModulo(timeMs * SWEEP_SPEED, Math.PI * 2)
+
+ const step = Math.floor(timeMs / BRACKET_STEP_MS + y * 1.7 + Math.abs(nx) * 0.8)
+ const idx = positiveModulo(step, OPEN_BRACKETS.length)
+ const ch = x <= cx ? OPEN_BRACKETS[idx] : CLOSE_BRACKETS[idx]
+
+ const hue = positiveModulo(angle - sweep, Math.PI * 2) / (Math.PI * 2)
+ const band = Math.min(4, Math.floor(hue * 5))
+
+ const distance = Math.min(
+ positiveModulo(angle - sweep, Math.PI * 2),
+ positiveModulo(sweep - angle, Math.PI * 2)
+ )
+ // Same thresholds as glyph-engine `radarFace`, with a readable off-beam field.
+ const weight = distance < 0.16 ? 1 : distance < 0.42 ? 0.85 : distance < 0.78 ? 0.55 : 0.28
+
+ return { ch, band, weight }
+}
+
+type Select26FieldProps = HTMLAttributes<HTMLDivElement> & {
+ cols?: number
+ rows?: number
+}
+
+/**
+ * Animated Radial sweep: mirrored brackets with rotating colour bands and
+ * radar beam falloff. Stepped updates mirror the Select glyph-engine without
+ * shipping its canvas runtime.
+ */
+export const Select26Field = ({ cols = 10, rows = 6, className, ...props }: Select26FieldProps) => {
+ const rootRef = useRef<HTMLDivElement>(null)
+ const [timeMs, setTimeMs] = useState(0)
+ const [isVisible, setIsVisible] = useState(true)
+
+ useEffect(() => {
+ const node = rootRef.current
+ if (!node || typeof IntersectionObserver === 'undefined') return
+ const observer = new IntersectionObserver(
+ ([entry]) => setIsVisible(entry?.isIntersecting ?? false),
+ { rootMargin: '80px' }
+ )
+ observer.observe(node)
+ return () => observer.disconnect()
+ }, [])
+
+ useEffect(() => {
+ if (!isVisible) return
+ if (
+ typeof window !== 'undefined' &&
+ window.matchMedia('(prefers-reduced-motion: reduce)').matches
+ ) {
+ return
+ }
+
+ let raf = 0
+ let lastPaint = 0
+ const started = performance.now()
+
+ const tick = (now: number) => {
+ if (now - lastPaint >= FRAME_INTERVAL_MS) {
+ lastPaint = now
+ setTimeMs(now - started)
+ }
+ raf = requestAnimationFrame(tick)
+ }
+ raf = requestAnimationFrame(tick)
+ return () => cancelAnimationFrame(raf)
+ }, [isVisible])
+
+ const cells = useMemo(() => {
+ const next: FieldCell[] = []
+ for (let y = 0; y < rows; y++) {
+ for (let x = 0; x < cols; x++) {
+ next.push(cellAt(x, y, cols, rows, timeMs))
+ }
+ }
+ return next
+ }, [cols, rows, timeMs])
+
+ return (
+ <div
+ ref={rootRef}
+ aria-hidden
+ className={cn(styles.field, 'grid', className)}
+ style={{ gridTemplateColumns: `repeat(${cols}, calc(22 / 34 * 1em))` }}
+ {...props}
+ >
+ {cells.map((cell, index) => (
+ <span
+ key={index}
+ className={styles.cell}
+ data-band={cell.band}
+ style={{ opacity: cell.weight }}
+ >
+ {cell.ch}
+ </span>
+ ))}
+ </div>
+ )
+}
diff --git a/packages/ui-patterns/src/Banners/fonts/DepartureMonoSuperbase-Regular.woff2 b/packages/ui-patterns/src/Banners/fonts/DepartureMonoSuperbase-Regular.woff2
new file mode 100644
index 00000000000..40b0eb13378
Binary files /dev/null and b/packages/ui-patterns/src/Banners/fonts/DepartureMonoSuperbase-Regular.woff2 differ
diff --git a/packages/ui-patterns/src/Banners/fonts/OFL.txt b/packages/ui-patterns/src/Banners/fonts/OFL.txt
new file mode 100644
index 00000000000..de524761838
--- /dev/null
+++ b/packages/ui-patterns/src/Banners/fonts/OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2022–2024 Helena Zhang (helenazhang.com).
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/packages/ui-patterns/src/Banners/fonts/README.md b/packages/ui-patterns/src/Banners/fonts/README.md
new file mode 100644
index 00000000000..7ef88559004
--- /dev/null
+++ b/packages/ui-patterns/src/Banners/fonts/README.md
@@ -0,0 +1,9 @@
+# Departure Mono Superbase (banner subset)
+
+Web font used by Select 2026 promotional banners (`Select26Field`).
+
+Source: Supabase’s Departure Mono Superbase derivative of Helena Zhang’s
+[Departure Mono](https://departuremono.com), SIL OFL 1.1 (see `OFL.txt`).
+
+Full font repo (OTF, sources, bolt glyph): select app
+`apps/2026/src/fonts/departure-mono-superbase`.