mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
## Problem - docs layout redesign needs a flag, so the team can check the new layout on production first - ai tools agent cards open a setup page with no agent selected, so the reader picks the agent again ## Solution - adds the `docs-layout-v2` posthog flag, and `?docs-layout-v2=true|false` overrides it for the rest of the browser session - adds a `layout-v2:` css variant, so server components can style the new layout and the current layout from the same markup - changes the agent cards to set `?client=` on their link, so the setup page opens with that agent selected - replaces the footer with link cells for status, product updates and issue reports, and keeps the old footer for the flag merge the stack together, because the new footer shows for every reader until #PR5 adds the flag switch <!-- ## Preview links If relevant, include links to changed pages for easy review access. Copy the preview base URL from the Vercel bot comment on this PR. Use the following table as an example template. | Site | Live | Preview | Search for | | -------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------- | | WWW | [/blog/your-post](https://supabase.com/blog/your-post) | [/blog/your-post](https://zone-www-dot-com-git-branch-name-supabase.vercel.app/blog/your-post) | unique phrase from the change | | Docs | [/docs/guides/your-page](https://supabase.com/docs/guides/your-page) | [/docs/guides/your-page](https://docs-git-branch-name-supabase.vercel.app/docs/guides/your-page) | unique phrase from the change | | Studio | [/dashboard](https://supabase.com/dashboard) | [/dashboard](https://studio-git-branch-name-supabase.vercel.app/dashboard) | unique phrase from the change | | Design system | [/design-system](https://supabase.com/design-system) | [/design-system](https://design-system-git-branch-name-supabase.vercel.app/design-system) | unique phrase from the change | | UI library | [/library](https://supabase.com/library) | [/library](https://ui-library-git-branch-name-supabase.vercel.app/library) | unique phrase from the change | | Knowledge base | [/kb/guides/your-page](https://supabase.com/kb/guides/your-page) | [/kb/guides/your-page](https://kb-git-branch-name-supabase.vercel.app/kb/guides/your-page) | unique phrase from the change | --> <!-- ## Additional context Optionally add any other context or screenshots. --> ## Review instructions 1. open [/docs/guides/getting-started?docs-layout-v2=true](https://docs-git-antlio-docs-v2-1-groundwork-supabase.vercel.app/docs/guides/getting-started?docs-layout-v2=true), and make sure that the `<html>` element has `data-docs-layout="v2"` 2. open the same page with `?docs-layout-v2=false`, and make sure that `data-docs-layout` is gone ## Checklist Check all before review: - [x] I have read [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] If I wrote a new docs topic or edited an existing topic, I used the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs [style guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)
148 lines
6.2 KiB
TypeScript
148 lines
6.2 KiB
TypeScript
import { AGENT_CLIENT_PARAM, PLUGIN_CLIENTS } from '~/features/ui/AgentPluginsPanel.data'
|
|
import type { ContentListingGroup } from '~/lib/content-listings.schema'
|
|
import { MCP_CLIENT_DATA } from 'ui-patterns/McpUrlBuilder/clients.data'
|
|
|
|
// MCP_CLIENT_DATA and PLUGIN_CLIENTS key GitHub Copilot differently — normalize before merging.
|
|
const KEY_ALIASES: Record<string, string> = {
|
|
'copilot-cli': 'github-copilot',
|
|
}
|
|
|
|
// ContentListings defaults hasLightIcon to true for string icon paths (see
|
|
// ContentListings.client.tsx: `item.hasLightIcon ?? typeof item.icon === 'string'`), so
|
|
// single-variant icons must set `hasLightIcon: false` explicitly or they'll request a
|
|
// nonexistent "-light" file.
|
|
const ICON_ASSETS: Record<string, { icon: string; hasLightIcon?: boolean }> = {
|
|
'claude-code': { icon: '/docs/img/icons/agent-claude-icon', hasLightIcon: false },
|
|
codex: { icon: '/docs/img/icons/agent-openai-icon', hasLightIcon: true },
|
|
cursor: { icon: '/docs/img/icons/agent-cursor-icon', hasLightIcon: true },
|
|
grok: { icon: '/docs/img/icons/agent-grok-icon', hasLightIcon: true },
|
|
'gemini-cli': { icon: '/docs/img/icons/agent-gemini-cli-icon', hasLightIcon: false },
|
|
'github-copilot': { icon: '/docs/img/icons/agent-copilot-icon', hasLightIcon: true },
|
|
kimi: { icon: '/docs/img/icons/agent-kimi-icon', hasLightIcon: true },
|
|
omp: { icon: '/docs/img/icons/agent-omp-icon', hasLightIcon: false },
|
|
vscode: { icon: '/docs/img/icons/agent-vscode-icon', hasLightIcon: false },
|
|
antigravity: { icon: '/docs/img/icons/agent-antigravity-icon', hasLightIcon: false },
|
|
windsurf: { icon: '/docs/img/icons/agent-devin-icon', hasLightIcon: true },
|
|
warp: { icon: '/docs/img/icons/agent-warp-icon', hasLightIcon: true },
|
|
goose: { icon: '/docs/img/icons/agent-goose-icon', hasLightIcon: true },
|
|
factory: { icon: '/docs/img/icons/agent-factory-icon', hasLightIcon: true },
|
|
opencode: { icon: '/docs/img/icons/agent-opencode-icon', hasLightIcon: true },
|
|
kiro: { icon: '/docs/img/icons/agent-kiro-icon', hasLightIcon: false },
|
|
}
|
|
|
|
// Claude.ai and ChatGPT are MCP connectors for a chat web app, not a coding agent or IDE.
|
|
const EXCLUDED_KEYS = new Set(['claude-ai', 'chatgpt'])
|
|
|
|
// Each product's own tagline, sourced from its marketing site (or, where noted, an official
|
|
// GitHub repo description or last-known pre-acquisition tagline). Not Supabase-specific copy —
|
|
// see the "Open questions" note in the PR for the Windsurf/Devin caveat.
|
|
const TAGLINES: Record<string, string> = {
|
|
antigravity: 'Experience liftoff with the next-gen agent platform.',
|
|
'claude-code': 'Work with Claude directly in your codebase, from your terminal, IDE, and more.',
|
|
codex: 'A lightweight coding agent that runs in your terminal.',
|
|
cursor: 'Your coding agent for building ambitious software.',
|
|
factory: 'A self-improving system for your SDLC.',
|
|
'gemini-cli': 'Build, debug & deploy with AI.',
|
|
'github-copilot': 'Your AI accelerator for every workflow, from the editor to the enterprise.',
|
|
goose: 'Your native open source AI agent — desktop app, CLI, and API.',
|
|
kimi: 'Engineered to drop into any dev workflow and get programming tasks done fast.',
|
|
kiro: 'Move beyond AI coding to agentic engineering.',
|
|
omp: 'A coding agent with the IDE wired in.',
|
|
opencode: 'The open source AI coding agent.',
|
|
vscode: 'The open source AI code editor — your home for multi-agent development.',
|
|
// Pre-acquisition tagline (Cognition/Devin acquired Windsurf in 2025) — see "Open questions".
|
|
windsurf: "The first agentic IDE. Tomorrow's editor, today.",
|
|
}
|
|
|
|
interface AgentEntry {
|
|
key: string
|
|
label: string
|
|
plugin: boolean
|
|
mcp: boolean
|
|
}
|
|
|
|
const PLUGIN_KEYS = new Set(PLUGIN_CLIENTS.map((client) => client.key))
|
|
const MCP_KEYS = new Set(MCP_CLIENT_DATA.map((client) => KEY_ALIASES[client.key] ?? client.key))
|
|
|
|
function buildAgents(): AgentEntry[] {
|
|
const byKey = new Map<string, AgentEntry>()
|
|
|
|
for (const client of MCP_CLIENT_DATA) {
|
|
const key = KEY_ALIASES[client.key] ?? client.key
|
|
if (EXCLUDED_KEYS.has(key)) continue
|
|
byKey.set(key, {
|
|
key,
|
|
label: client.label,
|
|
plugin: PLUGIN_KEYS.has(key),
|
|
mcp: true,
|
|
})
|
|
}
|
|
|
|
for (const client of PLUGIN_CLIENTS) {
|
|
if (EXCLUDED_KEYS.has(client.key)) continue
|
|
if (byKey.has(client.key)) continue
|
|
byKey.set(client.key, {
|
|
key: client.key,
|
|
label: client.label,
|
|
plugin: true,
|
|
mcp: MCP_KEYS.has(client.key),
|
|
})
|
|
}
|
|
|
|
return Array.from(byKey.values()).sort((a, b) => a.label.localeCompare(b.label))
|
|
}
|
|
|
|
function badgeFor(plugin: boolean, mcp: boolean): string {
|
|
if (plugin && mcp) return 'Plugin + MCP'
|
|
if (plugin) return 'Plugin'
|
|
return 'MCP'
|
|
}
|
|
|
|
// route to our own setup pages with the agent preselected, not vendor docs
|
|
function hrefFor(agent: AgentEntry): string {
|
|
return `/guides/ai-tools/${agent.plugin ? 'plugins' : 'mcp'}?${AGENT_CLIENT_PARAM}=${agent.key}`
|
|
}
|
|
|
|
export const aiToolsSupportedAgents: ContentListingGroup = {
|
|
id: 'ai-tools-supported-agents',
|
|
type: 'grid',
|
|
columns: 3,
|
|
items: buildAgents().map((agent) => ({
|
|
title: agent.label,
|
|
href: hrefFor(agent),
|
|
description: TAGLINES[agent.key] ?? 'Connect using the Supabase MCP server or plugin.',
|
|
icon: ICON_ASSETS[agent.key]?.icon,
|
|
hasLightIcon: ICON_ASSETS[agent.key]?.hasLightIcon,
|
|
badge: badgeFor(agent.plugin, agent.mcp),
|
|
badgePosition: 'below',
|
|
})),
|
|
}
|
|
|
|
export const aiToolsBuildingIntoApp: ContentListingGroup = {
|
|
id: 'ai-tools-building-into-app',
|
|
heading: 'Building AI into your app?',
|
|
headingLevel: 'h2',
|
|
description:
|
|
"The tools above are for your development workflow. If you're building AI capabilities into your own product:",
|
|
type: 'grid',
|
|
columns: 2,
|
|
items: [
|
|
{
|
|
title: 'Deploy MCP servers',
|
|
href: '/guides/ai-tools/byo-mcp',
|
|
description:
|
|
'Host your own MCP server on Supabase Edge Functions so your users can connect their AI agents to your product',
|
|
icon: '/docs/img/icons/product-edge-functions-icon',
|
|
hasLightIcon: true,
|
|
},
|
|
{
|
|
title: 'Vectors / Embeddings',
|
|
href: '/guides/ai',
|
|
description:
|
|
'Build semantic search, RAG pipelines, and other AI-powered features using pgvector',
|
|
icon: '/docs/img/icons/product-vector-icon',
|
|
hasLightIcon: true,
|
|
},
|
|
],
|
|
}
|