Files
supabase/apps/docs/components/Navigation/NavigationMenu/SidebarGroupLabel.tsx
T
Anthony Lio 51c07ef6b2 feat(docs): ai layout sidebar tree (#52972)
## Problem

- current sidebar shows only the page's product, so a reader opens the
top bar menus to reach another product
- redesign moves the global nav into the sidebar, so the sidebar needs
levels and a way back up

## Solution

- adds a sidebar that opens one level at a time: the docs sections, then
a section's products, then a product's pages
- adds a header row with a back link to the level above, and a home link
at the top level
- changes a product row to open the product overview and show its pages
at once
- adds icons to the top level sections in the current nav and in the
option-1 nav
- changes the new page tree to show a background on hover only, and text
color on the current page
- adds an overview row to the start section, which only the new layout
shows

#52971 must merge first, because the sidebar uses the `layout-v2:` css
variant

<!--
## 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. run `pnpm --filter docs exec vitest run
components/Navigation/NavigationMenu`, and make sure that all tests pass
2. read `DocsSidebarNav.test.tsx`, and make sure that the tests cover
the back link, the home link and the product link to its overview
3. the layout mounts the sidebar in the stack top, so check the sidebar
on the preview of that pr

## 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)
2026-11-11 16:31:32 +02:00

19 lines
467 B
TypeScript

import type { PropsWithChildren } from 'react'
import { cn } from 'ui'
interface SidebarGroupLabelProps extends PropsWithChildren {
className?: string
}
export const SidebarGroupLabel = ({ className, children }: SidebarGroupLabelProps) => (
<span
className={cn(
'flex items-center gap-3 pt-3 text-xs font-medium text-foreground-lighter',
className
)}
>
{children}
<span aria-hidden className="h-px flex-1 bg-border" />
</span>
)