From 2d745edfb429a14f19d83c3a962d609057b98290 Mon Sep 17 00:00:00 2001 From: Saxon Fletcher Date: Tue, 21 Jul 2026 14:30:36 +1000 Subject: [PATCH 1/7] Landing page agent focus (#47989) --- apps/docs/app/page.tsx | 105 +++--- apps/docs/components/DocsCoverLogo.tsx | 6 +- .../components/HomePageCover.constants.ts | 9 + apps/docs/components/HomePageCover.tsx | 305 +++++++++--------- apps/docs/features/docs/MdxBase.shared.tsx | 8 +- apps/docs/features/ui/CodeBlock/CodeBlock.tsx | 4 +- apps/docs/features/ui/PromptPanel.tsx | 304 +++++++++++++++++ .../internals/generate-guides-markdown.ts | 2 + .../markdown-schema/PromptPanel.test.ts | 72 +++++ .../internals/markdown-schema/PromptPanel.ts | 22 ++ apps/docs/layouts/HomeLayout.tsx | 19 +- packages/config/css/animations.css | 9 + packages/config/css/utilities.css | 106 ++++++ 13 files changed, 781 insertions(+), 190 deletions(-) create mode 100644 apps/docs/components/HomePageCover.constants.ts create mode 100644 apps/docs/features/ui/PromptPanel.tsx create mode 100644 apps/docs/internals/markdown-schema/PromptPanel.test.ts create mode 100644 apps/docs/internals/markdown-schema/PromptPanel.ts diff --git a/apps/docs/app/page.tsx b/apps/docs/app/page.tsx index 31eba97aef4e2..031a06a61a47b 100644 --- a/apps/docs/app/page.tsx +++ b/apps/docs/app/page.tsx @@ -5,6 +5,7 @@ import { cn } from 'ui' import { IconPanel } from 'ui-patterns/IconPanel' import { TextLink } from 'ui-patterns/TextLink' +import { FrameworkQuickstarts } from '@/components/HomePageCover' import { MIGRATION_PAGES } from '@/components/Navigation/NavigationMenu/NavigationMenu.constants' import { GlassPanelWithIconPicker } from '@/features/ui/GlassPanelWithIconPicker' import { IconPanelWithIconPicker } from '@/features/ui/IconPanelWithIconPicker' @@ -45,7 +46,7 @@ const products = [ href: '/guides/database/overview', description: 'Supabase provides a full Postgres database for every project with Realtime functionality, database backups, extensions, and more.', - span: 'col-span-12 md:col-span-6', + span: 'col-span-12', }, { title: 'Auth', @@ -226,26 +227,55 @@ const additionalResources = [ const HomePage = () => (
-

Products

-
    - {products.map((product) => { - return ( -
  • - - - {product.description} - - -
  • - ) - })} -
+ {isFeatureEnabled('docs:full_getting_started') && ( +
+
+

+ Connect a framework +

+

+ Start with a framework quickstart and connect your project in minutes. +

+
+ +
+ +
+
+ )} +
+
+

+ Build your backend +

+

+ Build with a complete backend platform, from your database to your application logic. +

+
-
-
-

- Modules +
    + {products.map((product) => { + return ( +
  • + + + {product.description} + + +
  • + ) + })} +
+

+ +
+
+

+ Extend your database

+

+ Extend your database with built-in tools for AI, APIs, scheduled jobs, and queues. +

{postgresIntegrations.map((integration) => ( @@ -261,15 +291,14 @@ const HomePage = () => (
-
+
-
-
-

- Client Libraries -

-
-
+

+ Use a client library +

+

+ Use Supabase from the language and framework your application is built with. +

@@ -291,7 +320,7 @@ const HomePage = () => (
{isFeatureEnabled('docs:full_getting_started') && ( -
+

Migrate to Supabase @@ -322,20 +351,22 @@ const HomePage = () => (

)} -
-
-

- Additional resources +
+
+

+ Explore more

+

+ Explore the tools, integrations, and guides that help you get more from Supabase. +

-
    +
      {additionalResources.map((resource) => { return ( -
    • +
    • @@ -349,12 +380,12 @@ const HomePage = () => (
{isFeatureEnabled('docs:full_getting_started') && ( -
+

- Self-Hosting + Self-host Supabase

diff --git a/apps/docs/components/DocsCoverLogo.tsx b/apps/docs/components/DocsCoverLogo.tsx index 3b56575513fc5..eebc87c0092b9 100644 --- a/apps/docs/components/DocsCoverLogo.tsx +++ b/apps/docs/components/DocsCoverLogo.tsx @@ -1,9 +1,9 @@ 'use client' import { domAnimation, LazyMotion, m } from 'framer-motion' -import React, { type PropsWithChildren } from 'react' +import React, { type ComponentPropsWithoutRef } from 'react' -const DocsCoverLogo = (props: PropsWithChildren) => { +const DocsCoverLogo = ({ className, ...props }: ComponentPropsWithoutRef<'div'>) => { const pathMotionConfig = { initial: { pathLength: 0 }, animate: { pathLength: 1 }, @@ -24,7 +24,7 @@ const DocsCoverLogo = (props: PropsWithChildren) => { } return ( -

+
- - Start with Supabase AI prompts - - + + + }>AI Prompt + {setupPrompt} + + Help me get set up with Supabase. Do the following: 1. Install the Supabase CLI globally + with{' '} + + {setupCommand.installCli} + + . 2. Install the Supabase Plugin with{' '} + + {setupCommand.installPlugin} + + . 3. Review my project and determine whether Supabase is already initialized. If it is not + initialized, run{' '} + + {setupCommand.initialize} + + . 4. Suggest the most relevant next steps. + + + + }>CLI + {setupCommands} + {cliCode} + + ) } -const HomePageCover = (props) => { +const frameworks = [ + { + tooltip: 'ReactJS', + icon: '/docs/img/icons/react-icon', + href: '/guides/getting-started/quickstarts/reactjs', + hasLightIcon: false, + }, + { + tooltip: 'Next.js', + icon: '/docs/img/icons/nextjs-icon', + href: '/guides/getting-started/quickstarts/nextjs', + hasLightIcon: false, + }, + { + tooltip: 'TanStack Start', + icon: '/docs/img/icons/tanstack-icon', + href: '/guides/getting-started/quickstarts/tanstack', + hasLightIcon: true, + }, + { + tooltip: 'Astro.js', + icon: '/docs/img/icons/astro-icon', + href: '/guides/getting-started/quickstarts/astrojs', + hasLightIcon: true, + }, + { + tooltip: 'Vue', + icon: '/docs/img/icons/vuejs-icon', + href: '/guides/getting-started/quickstarts/vue', + hasLightIcon: false, + }, + { + tooltip: 'Nuxt', + icon: '/docs/img/icons/nuxt-icon', + href: '/guides/getting-started/quickstarts/nuxtjs', + hasLightIcon: false, + }, + { + tooltip: 'iOS Swift', + icon: '/docs/img/icons/swift-icon-orange', + href: '/guides/getting-started/quickstarts/ios-swiftui', + enabled: sdkSwiftEnabled, + hasLightIcon: false, + }, + { + tooltip: 'Android Kotlin', + icon: '/docs/img/icons/kotlin-icon', + href: '/guides/getting-started/quickstarts/kotlin', + enabled: sdkKotlinEnabled, + hasLightIcon: false, + }, + { + tooltip: 'Expo React Native', + icon: '/docs/img/icons/expo-icon', + href: '/guides/getting-started/quickstarts/expo-react-native', + hasLightIcon: true, + }, + { + tooltip: 'Flutter', + icon: '/docs/img/icons/flutter-icon', + href: '/guides/getting-started/quickstarts/flutter', + enabled: sdkDartEnabled, + hasLightIcon: false, + }, + { + tooltip: 'Python', + icon: '/docs/img/icons/python-icon', + href: '/guides/getting-started/quickstarts/flask', + hasLightIcon: false, + }, +] + +export function FrameworkQuickstarts() { const isXs = useBreakpoint(639) const iconSize = isXs ? 'sm' : 'lg' - const { homepageHeading } = getCustomContent(['homepage:heading']) const { resolvedTheme } = useTheme() - const isLightMode = !resolvedTheme?.includes('dark') + const [isMounted, setIsMounted] = useState(false) + const isLightMode = isMounted && resolvedTheme === 'light' - const frameworks = [ - { - tooltip: 'ReactJS', - icon: '/docs/img/icons/react-icon', - href: '/guides/getting-started/quickstarts/reactjs', - hasLightIcon: false, - }, - { - tooltip: 'Next.js', - icon: '/docs/img/icons/nextjs-icon', - href: '/guides/getting-started/quickstarts/nextjs', - hasLightIcon: false, - }, - { - tooltip: 'TanStack Start', - icon: '/docs/img/icons/tanstack-icon', - href: '/guides/getting-started/quickstarts/tanstack', - hasLightIcon: true, - }, - { - tooltip: 'Astro.js', - icon: '/docs/img/icons/astro-icon', - href: '/guides/getting-started/quickstarts/astrojs', - hasLightIcon: true, - }, - { - tooltip: 'Vue', - icon: '/docs/img/icons/vuejs-icon', - href: '/guides/getting-started/quickstarts/vue', - hasLightIcon: false, - }, - { - tooltip: 'Nuxt', - icon: '/docs/img/icons/nuxt-icon', - href: '/guides/getting-started/quickstarts/nuxtjs', - hasLightIcon: false, - }, - { - tooltip: 'iOS Swift', - icon: '/docs/img/icons/swift-icon-orange', - href: '/guides/getting-started/quickstarts/ios-swiftui', - enabled: sdkSwiftEnabled, - hasLightIcon: false, - }, - { - tooltip: 'Android Kotlin', - icon: '/docs/img/icons/kotlin-icon', - href: '/guides/getting-started/quickstarts/kotlin', - enabled: sdkKotlinEnabled, - hasLightIcon: false, - }, - { - tooltip: 'Expo React Native', - icon: '/docs/img/icons/expo-icon', - href: '/guides/getting-started/quickstarts/expo-react-native', - hasLightIcon: true, - }, - { - tooltip: 'Flutter', - icon: '/docs/img/icons/flutter-icon', - href: '/guides/getting-started/quickstarts/flutter', - enabled: sdkDartEnabled, - hasLightIcon: false, - }, - { - tooltip: 'Python', - icon: '/docs/img/icons/python-icon', - href: '/guides/getting-started/quickstarts/flask', - hasLightIcon: false, - }, - ] + useEffect(() => setIsMounted(true), []) - const GettingStarted = () => ( -
-
-
-
-

Getting Started

-

- Set up and connect a database in just a few minutes. -

-
-
-
-
- {frameworks - .filter((framework) => framework.enabled !== false) - .map((framework, i) => { - const iconToUse = - framework.hasLightIcon && isLightMode ? `${framework.icon}-light` : framework.icon + return ( +
+ {frameworks + .filter((framework) => framework.enabled !== false) + .map((framework) => { + const iconToUse = + framework.hasLightIcon && isLightMode ? `${framework.icon}-light` : framework.icon - return ( - - - - ) - })} -
- -
-
+ return ( + + + + ) + })}
) +} + +const HomePageCover = ({ title, cliCode }: { title: string; cliCode: ReactNode }) => { + const { homepageHeading } = getCustomContent(['homepage:heading']) return ( -
-
-
-