Closes DOCS-1470
## Problem
- reference pages have no breadcrumbs, so a reader on
`/reference/cli/supabase-init` sees no path back to the cli reference
- a guide breadcrumb can repeat its parent, for example "Connecting to
your database" twice under Database > Fundamentals
- redesign needs page actions in the top bar to copy a page as markdown
and to set up an agent
## Solution
- adds reference breadcrumbs, so a reference page shows the reference
home and its library
- adds the current version to the library breadcrumb when the library
has more than one version
- removes a breadcrumb that repeats its parent with the same url and
name
- adds a copy page split button and a set up agent menu, with telemetry
events for each action
- changes `ui-patterns` to export `CrossfadeIcon`, so the copy button
reuses its copied state animation
#52972 must merge first, because the breadcrumbs skip the overview row
that it adds
<!--
## 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 lib/breadcrumbs.test.ts`, and
make sure that all tests pass
2. read the new telemetry events in
`packages/common/telemetry-constants.ts`, and make sure that each event
names what the user did
3. the top bar shows the page actions in the next pr, so check them 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)
Coding agents guess docs URLs that don't exist: markdown variants of
pages that have no markdown (`/docs/reference/<sdk>/<fn>.md`,
`/docs/guides/<slug>.md`) and `/docs/llms.txt`. Reference guesses get an
empty-body 404 from the crawler renderer for bot user agents and the
full HTML reference for browsers, and the rest get the HTML 404 page, so
the agent never learns where the content lives. Reference `.md` guesses
are about half of coding-agent docs 4xx, and guide `.md` guesses about a
tenth.
**Changed:**
- **Reference `.md` guesses**: the docs proxy answers every
`/docs/reference/**.md` request itself, for any user agent and before
the crawler rewrite, with a markdown 404 (`no-store`) linking the HTML
page and the SDK's full markdown reference (`/llms/js.txt`,
`/llms/dart.txt`, and so on), or `/llms.txt` for references without one.
- **Unknown guide `.md` guesses**: guide `.md` requests whose slug has
no markdown variant get the same markdown 404 instead of the HTML 404.
The body says there is no markdown version of the page, because a few
real guide pages (CLI config, self-hosting config, troubleshooting
indexes) are TSX-only. Known guides and Accept-negotiated requests
without `.md` are unchanged.
- **`/docs/llms.txt`**: I added a permanent www redirect to `/llms.txt`,
next to the existing `/docs/reference/llms.md` redirect.
**Note:** the `.md` check in `proxy.ts` catches every reference `.md`
URL, so it has to be narrowed when per-function reference markdown
ships, or it will 404 those files.
## To test
Tested on the PR previews (docs deployment for the 404s, www deployment
for the redirect):
- [x] `curl -sD - -A 'curl/8.7.1'
<docs-preview>/docs/reference/javascript/select.md`: expect 404,
`content-type: text/markdown`, `cache-control: no-store`, and a body
linking `https://supabase.com/docs/reference/javascript/select` and
`https://supabase.com/llms/js.txt`
- [x] Repeat for `dart/select.md`, `python/select.md`,
`cli/supabase-init.md` and `api/v1-list-all-projects.md`: expect the
matching `/llms/<sdk>.txt`
- [x] Repeat `javascript/select.md` with a browser user agent: expect
the same markdown 404
- [x] `curl -sD - <docs-preview>/docs/guides/doesnotexist.md`: expect
404 markdown with `no-store`, linking `https://supabase.com/llms.txt`
- [x] `curl -s
<docs-preview>/docs/guides/local-development/cli/config.md`: expect 404
markdown linking
`https://supabase.com/docs/guides/local-development/cli/config`
- [x] `curl -sD - <docs-preview>/docs/guides/database/overview.md`:
expect 200 markdown, unchanged
- [x] Open `<docs-preview>/docs/guides/doesnotexist` in a browser:
expect the branded HTML 404, unchanged
- [x] `curl -sIL -o /dev/null -w '%{num_redirects} %{http_code}\n'
<www-preview>/docs/llms.txt`, once with a browser user agent and once
with `Googlebot/2.1`: expect `1 200`
## Linear
- fixes GROWTH-1325