Files
supabase/apps/docs/features/docs/MdxBase.shared.tsx
T
Anthony Lio 4a9b4b0a9e feat(docs): o11y agent setup stepper (#50962)
## Problem

on monitoring agent pages the prompt lives in a "prompt" tab next to
agent ones, while each agent tab ended with "paste the prompt" users
have to work out that the prompt is sitting in that previous tab

## Solution

this pr is a proposal to set agent setup as a two stepper `1` for the
prompt panel `2` holds the agent tabs:

- extracts prompt into a first step
- moves agent tabs within their own step
- polishes agent docs to match recent ui updates
- sets `prompt` as an anchor link within agent tabs 

| state | preview |
| -------|------|
| before | <img width="823" height="452" alt="image"
src="https://github.com/user-attachments/assets/a6a01832-ea73-48c1-b31d-25a0ef970e4e"
/> |
| after | <img width="823" height="716" alt="image"
src="https://github.com/user-attachments/assets/f5014ad0-1555-4578-b4b1-5bf2733b4d37"
/> |

<!--
## 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

Provide a clear numbered procedure that the PR reviewer can walk
through.

1. visit
[/automate-with-agents/health](https://docs-git-docs-agent-setup-stepper-supabase.vercel.app/docs/guides/observability/automate-with-agents/health#set-up-the-agent)

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] 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)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Agent setup instructions are organized into prompt-copying and
scheduling steps, with links to harness documentation.
  * Code tabs support icons and controlled selection.
  * Source code samples support adjustable footer notches.
* **Bug Fixes**
  * Step numbers now display the correct shadow.
* Links to page anchors now scroll to, focus, and highlight their
targets, while respecting reduced-motion preferences.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-28 17:28:11 +03:00

152 lines
5.4 KiB
TypeScript

import { AiPromptsIndex } from '~/app/guides/getting-started/ai-prompts/[slug]/AiPromptsIndex'
import { AiSkillsIndex } from '~/app/guides/getting-started/ai-skills/AiSkillsIndex'
import { AppleSecretGenerator } from '~/components/AppleSecretGenerator'
import AuthProviders from '~/components/AuthProviders'
import { AuthSmsProviderConfig } from '~/components/AuthSmsProviderConfig'
import ButtonCard from '~/components/ButtonCard'
import { ComputeDiskLimitsTable } from '~/components/ComputeDiskLimitsTable'
import { ContentListings } from '~/components/ContentListings'
import { CustomContent } from '~/components/CustomContent'
import { DatabaseAdvisorsIndex } from '~/components/DatabaseAdvisorsIndex'
import { Extensions } from '~/components/Extensions'
import Image, { type ImageProps } from '~/components/Image'
import { McpCiConfigBlock } from '~/components/McpCiConfigBlock'
import { Mermaid } from '~/components/Mermaid'
import { MetricsStackCards } from '~/components/MetricsStackCards'
import { NavData } from '~/components/NavData'
import { Price } from '~/components/Price'
import { ProjectConfigVariables } from '~/components/ProjectConfigVariables'
import { RealtimeLimitsEstimator } from '~/components/RealtimeLimitsEstimator'
import { RegionsList, SmartRegionsList } from '~/components/RegionsList'
import { SharedData } from '~/components/SharedData'
import { StepHikeCompact } from '~/components/StepHikeCompact'
import Table from '~/components/Table'
import { TerraformProviderSchema } from '~/components/TerraformProviderSchema'
import { WrapperDashboardIntegration } from '~/components/WrapperDashboardIntegration'
import { CodeSampleDummy, CodeSampleWrapper } from '~/features/directives/CodeSample.client'
import { CodeTabs, NamedCodeBlock } from '~/features/directives/CodeTabs.components'
import { MdxAnchor } from '~/features/docs/MdxAnchor'
import { Accordion, AccordionItem } from '~/features/ui/Accordion'
import { CodeBlock } from '~/features/ui/CodeBlock/CodeBlock'
import { ShowUntil } from '~/features/ui/ShowUntil'
import { TabPanel, Tabs } from '~/features/ui/Tabs'
import { YouTube } from '~/features/ui/YouTube'
import { ArrowDown, Check, X } from 'lucide-react'
import Link from 'next/link'
import { type ComponentPropsWithoutRef } from 'react'
import { Badge, Button, Heading } from 'ui'
import { Admonition, type AdmonitionProps } from 'ui-patterns/Admonition'
import { GlassPanel } from 'ui-patterns/GlassPanel'
import SqlToRest from 'ui-patterns/SqlToRest'
import { AgentPluginsPanel } from '../ui/AgentPluginsPanel'
import { AgentSetup } from '../ui/AgentSetup'
import { AgentWatchSchedule } from '../ui/AgentWatchSchedule'
import { AiPrompt, type AiPromptProps } from '../ui/AiPrompt'
import { ErrorCodes } from '../ui/ErrorCodes'
import { McpConfigPanel } from '../ui/McpConfigPanel'
// Admonition as it appears in docs pages: sits in MDX prose, so it needs a margin-bottom.
const DocsAdmonition = (props: AdmonitionProps) => {
return <Admonition {...props} className="mb-8" />
}
/**
* Route fenced ```mermaid blocks through the Mermaid component; everything else
* continues through `CodeBlock` for syntax highlighting.
*/
const Pre = (props: any) => {
const child = Array.isArray(props.children) ? props.children[0] : props.children
const className: unknown = child?.props?.className
if (typeof className === 'string' && className.split(' ').includes('language-mermaid')) {
const code = child.props.children
if (typeof code === 'string') {
return <Mermaid chart={code.trim()} />
}
}
return <CodeBlock {...props} />
}
const components = {
Accordion,
AccordionItem,
Admonition: DocsAdmonition,
AgentPluginsPanel,
AgentSetup,
AgentWatchSchedule,
AiPrompt: (props: Omit<AiPromptProps, 'telemetry'>) => (
<AiPrompt {...props} telemetry={{ source: 'guide' }} />
),
AiPromptsIndex,
AiSkillsIndex,
AuthSmsProviderConfig,
AppleSecretGenerator,
AuthProviders,
Badge,
Button,
ButtonCard,
CodeSampleDummy,
CodeSampleWrapper,
CodeTabs,
ComputeDiskLimitsTable,
CustomContent,
ContentListings,
DatabaseAdvisorsIndex,
ErrorCodes,
Extensions,
GlassPanel,
IconArrowDown: ArrowDown,
IconCheck: Check,
IconX: X,
Image: (props: ImageProps) => <Image className="rounded-md w-full" {...props} />,
Link,
McpCiConfigBlock,
McpConfigPanel,
Mermaid,
MetricsStackCards,
NamedCodeBlock,
NavData,
ProjectConfigVariables,
RealtimeLimitsEstimator,
RegionsList,
SmartRegionsList,
SharedData,
ShowUntil,
SqlToRest,
StepHikeCompact,
Table,
Tabs,
TabPanel,
TerraformProviderSchema,
WrapperDashboardIntegration,
YouTube,
a: MdxAnchor,
h2: (props: ComponentPropsWithoutRef<'h2'>) => (
<Heading tag="h2" {...props}>
{props.children}
</Heading>
),
h3: (props: ComponentPropsWithoutRef<'h3'>) => (
<Heading tag="h3" {...props}>
{props.children}
</Heading>
),
h4: (props: ComponentPropsWithoutRef<'h4'>) => (
<Heading tag="h4" {...props}>
{props.children}
</Heading>
),
pre: Pre,
table: Table,
/**
* Force inline code tags to go sync, this prevents Heading anchor resolution fail due to
* our CodeBlock component being async. We need to find a better solution for more future
* proof MDX rendering. Definitely improving the anchors utility in the ui/Heading component
* plus having a more resilient highlighting strategy.
*/
code: (props: any) => <code {...props}>{props.children}</code>,
Price,
}
export { components }