Commit Graph
6 Commits
Author SHA1 Message Date
Miranda Limonczenko f59c795eb5 feat(docs): render Option 1 on the server when the variant is forced (#52735)
Closes DOCS-1520

## Problem

The original PR was only client-side. This is adding server-side
integration.

The docs-nav evals fetch each page's HTML with no JavaScript and add
`?docs-ia-mvp-v1=option-1` to every request. The option-1 arm gets the
control navigation anyway.

Guide pages are statically generated, so the server can't read the query
parameter. `useIaNavVariant` reads the override from the URL after the
page loads, so the fetched HTML always has today's nav, hidden with an
`invisible` class.

The top nav dropdowns have a second gap. Their panels mount on the
client, so their links are not in the server HTML for either variant.
Every eval case starts at `/docs`, where those links are the only way
into the Option 1 groups.

## Solution

- **Rewrite option-1 requests:** `proxy.ts` sends `/docs` and guide
pages with `?docs-ia-mvp-v1=option-1` to `/docs/ia/option-1/…`. Pages
there render on the first request and are then cached, so nothing is
added to the build. Requests without the parameter, and `.md` requests,
are not rewritten.
- **Read the variant from the route:** `IaNavRouteProvider`, in the root
layout, reads the variant from the layout segments. `useIaNavVariant`
returns it on the server and records no PostHog exposure for it.
`useIaNavReady` is ready at once, so the nav has no `invisible` class.
- **Strip the route prefix:** on the server, `usePathname` returns the
rewritten path. The nav components, breadcrumbs, and `AiTools` use
`useDocsPathname`, which strips the `/ia/option-1` prefix.
- **Breadcrumbs follow the variant:** they resolve from the visitor's
nav config, not always today's.
- **Top nav subheads in the HTML:** a `<noscript>` block next to the top
nav lists the dropdown links for the visitor's variant, inside an
`sr-only` nav. Browsers with JavaScript ignore it.
- **No index for the route:** direct visits to `/docs/ia/option-1/…` get
`noindex`. Canonical URLs point to the real guide.

**Not changed:**

- **Reference pages:** they keep today's nav, even with the parameter.
- **Config pages:** the five generated config pages under `self-hosting`
and `local-development/cli` are not in the markdown manifest, so they
keep today's nav too.
- **Links:** they don't carry the query parameter, so a click in the
browser leaves the forced variant. This was already the case before this
PR.
- **Conflicts with #52679:** it changes the same hooks. Whichever PR
merges second needs a rebase.

## Review instructions

`grep -c` counts the lines of server HTML that contain the text. A count
of 1 or more means the text is in the HTML that an agent fetches without
JavaScript. A count of 0 means it is not.

1. Run `curl -s
"https://docs-git-docs-ia-option-1-server-render-supabase.vercel.app/docs/guides/auth/sessions?docs-ia-mvp-v1=option-1"
| grep -c "Run and manage"`. The count is 1 or more. "Run and manage" is
an Option 1 top nav label, so this checks that the parameter gets Option
1's nav from the server.
2. Run `curl -s
"https://docs-git-docs-ia-option-1-server-render-supabase.vercel.app/docs/guides/auth/sessions"
| grep -c "Run and manage"`. The count is 0. This checks that a request
without the parameter still gets today's nav.
3. Run `curl -s
"https://docs-git-docs-ia-option-1-server-render-supabase.vercel.app/docs?docs-ia-mvp-v1=option-1"
| grep -c "guides/platform/ssl-enforcement"`. The count is 1 or more.
The home page has no sidebar, and this link sits only in the "Run and
manage" dropdown, so this checks that the top nav subhead links are in
the server HTML.
4. Run `curl -s -o /dev/null -w "%{http_code}"
"https://docs-git-docs-ia-option-1-server-render-supabase.vercel.app/docs/guides/auth.md?docs-ia-mvp-v1=option-1"`.
It returns `200`. This checks that the markdown version still loads with
the parameter.
5. Open
[/docs/guides/auth](https://docs-git-docs-ia-option-1-server-render-supabase.vercel.app/docs/guides/auth)
in a browser and hover over the top nav. You see today's nav and
dropdowns.

## 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-06 19:46:37 +00:00
Alexis Aguilar d1dcb57bdf feat(www): use the shared AiTools component on www pages (#52186)
## Problem

Docs guides, docs troubleshooting pages, and knowledge base guides
render the shared `AiTools` component from `ui-patterns`. The marketing
site renders its own copy of the same actions in `MarkdownActions`, with
the same styles and links. A change to one doesn't reach the other.

Resolves
[DOCS-1505](https://linear.app/supabase/issue/DOCS-1505/use-the-shared-aitools-component-on-www-pages).

## Solution

Blog posts, customer stories, event pages, changelog entries, and
pricing render `AiTools` through a www wrapper, and `MarkdownActions` is
deleted. The wrapper sends `copy_as_markdown_clicked` and
`ask_ai_clicked` with each page's type, as `MarkdownActions` did.

- **Prefer on Google:** blog posts show the Prefer on Google link
through `AiTools`, and clicks send `preferred_source_clicked`. #52026
proposed adding the link through `MarkdownActions`. This PR adds it
through `AiTools` instead, and #52026 is closed. The link's URL is a
shared constant in `markdown-affordance.ts`, which the docs wrapper also
uses.
- **Horizontal layout:** `AiTools` has an `orientation` prop. Pricing
uses it to keep the actions in a row under the hero. The design system's
AI Tools page documents it.
- **Headings:** `AiTools` adds an "AI tools" heading:
  - Blog posts style it like the sidebar's On this page label.
- Pricing, customer stories, and event pages hide it visually, so they
look as they do on the live site. Screen readers still announce it as
the section's label.
- Changelog entries give AI tools its own sidebar section, like Change
type and Products. The Links section appears only when an entry links to
a GitHub discussion.

The changelog index keeps `ChangelogLlmMarkdownButton`. It's a split
button in the header toolbar, and `AiTools` is a list of links built for
sidebars.

## Preview links

Compare the before and afters (since there's a lot of examples here,
links are less visually busy than images in this case):

| Site | Live | Preview |
| ------------- |
--------------------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------
|
| WWW |
[/blog/give-your-supabase-app-its-own-mcp-server](https://supabase.com/blog/give-your-supabase-app-its-own-mcp-server)
|
[/blog/give-your-supabase-app-its-own-mcp-server](https://zone-www-dot-com-git-alexisa-docs-1505-supabase.vercel.app/blog/give-your-supabase-app-its-own-mcp-server)
|
| WWW | [/pricing](https://supabase.com/pricing) |
[/pricing](https://zone-www-dot-com-git-alexisa-docs-1505-supabase.vercel.app/pricing)
|
| WWW | [/customers/berriai](https://supabase.com/customers/berriai) |
[/customers/berriai](https://zone-www-dot-com-git-alexisa-docs-1505-supabase.vercel.app/customers/berriai)
|
| WWW |
[/events/agency-webinar-ai-prototyping-production](https://supabase.com/events/agency-webinar-ai-prototyping-production)
|
[/events/agency-webinar-ai-prototyping-production](https://zone-www-dot-com-git-alexisa-docs-1505-supabase.vercel.app/events/agency-webinar-ai-prototyping-production)
|
| WWW |
[/changelog/cbc-tls-ciphers-deprecated](https://supabase.com/changelog/cbc-tls-ciphers-deprecated)
|
[/changelog/cbc-tls-ciphers-deprecated](https://zone-www-dot-com-git-alexisa-docs-1505-supabase.vercel.app/changelog/cbc-tls-ciphers-deprecated)
|
| WWW |
[/changelog/17817-pgbouncer-and-ipv4-deprecation](https://supabase.com/changelog/17817-pgbouncer-and-ipv4-deprecation)
|
[/changelog/17817-pgbouncer-and-ipv4-deprecation](https://zone-www-dot-com-git-alexisa-docs-1505-supabase.vercel.app/changelog/17817-pgbouncer-and-ipv4-deprecation)
|
| Design system |
[/design-system/docs/fragments/ai-tools](https://supabase.com/design-system/docs/fragments/ai-tools)
|
[/design-system/docs/fragments/ai-tools](https://design-system-git-alexisa-docs-1505-supabase.vercel.app/design-system/docs/fragments/ai-tools)
|

## Review instructions

1. Open each live and preview link side by side.
2. On pricing, check that the actions sit in the same row under the
hero.
3. On the blog post, check that the "AI tools" heading matches the On
this page label.
4. On the blog post, check that Prefer on Google appears in the sidebar
and at the end of the post on mobile.
5. On both changelog entries, check that AI tools has its own sidebar
section. Links appears only on the pgbouncer entry, which links to a
GitHub discussion.
6. On each page, click Copy as Markdown, Ask ChatGPT, and Ask Claude. On
the blog post, also click Prefer on Google. In the browser's network
tab, check that each telemetry request includes the page's `pageType`.
7. On the design system page, check the Horizontal layout example.

## 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-10-27 18:35:40 -04:00
Kody Jackson 051d5f79da chore(docs) - remove troubleshooting guides and rendering logic (#52339)
## Problem

Dupe content and workflows when this content now all lives in the KB.

## Solution

Removes various artifacts from the docs repo (content files, github
workflows, etc.) from the docs app.

These paths have already been redirected to /kb in #52095 and we haven't
seen any meaningful 404 traffic indicating the redirects were done
incorrectly.

## Preview links

TBD
2026-10-27 12:32:33 -05:00
Anthony Lio d9faba5a2c feat(kb): design overhaul (#51565)
## Problem

knowledge base homepage was a list of topic cards with nothing to browse
by, and guide pages had no table of contents

## Solution

- adds grid drawn hero proposal
- adds featured guides and topic cards
- updates guide page layout 

| state | preview |
| -------|------|
| after | <img width="1504" height="757" alt="image"
src="https://github.com/user-attachments/assets/41492e87-f4ad-4dea-ad30-7dc3ca2882b0"
/> |

`variants`

homepage ships with a few design options behind query params, so we can
compare them on the preview before picking one, temporary and non
selected one will be removed


Param | Values | What it does
-- | -- | --
hero | grid (default), warp | grid draws the flat table grid _
warp bends the ASCII field into a funnel below the hero copy
featured | cover (default), book | cover shows the featured guides as
cards with an ascii cover _ book shows them as books
search | off (default), on | on adds a search button under the hero copy
that opens the guide search dialog. Cmd+K / Ctrl+K also opens it

<!--
## 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 the kb preview at `/kb`
2. open a guide such as `/kb/guides/migrate-from-firebase-auth`

## 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)
2026-10-20 22:31:12 +03:00
b8eca2e1c9 feat(docs) - Add in preferred source for Google under 'AI tools' (#51846)
## Problem

Google introduced a new pattern for [`adding preferred
sources`](https://developers.google.com/search/docs/appearance/preferred-sources#deeplink)
relatively recently, where you can set specific site providers as your
preference for Google results.

We don't support this yet, but should.

## Solution

Adds in a new link under the `AI Tools` section of the sidebar.

[preview](https://docs-git-kody-devrel-728-preferred-source-google-docs-supabase.vercel.app/docs/guides/getting-started)
<img width="448" height="548" alt="image"
src="https://github.com/user-attachments/assets/865dd93a-1575-47dc-b400-7df0f4ac7605"
/>

## Open questions

**Does this feel like the right implementation?**

Other approaches:
- Google allows you to add in [fancy buttons via
JS](https://developers.google.com/search/docs/appearance/preferred-sources#standard-javascript)...
but this'd be adding a new request on every page load which feels not
ideal.
- [Vercel
KB](https://vercel.com/kb/guide/rag-chatbot-production-architecture-on-vercel)
uses the `deeplink` implementation as well, but they add a stylized
button to the righthand side of the page.

My initial thought was that it felt too visually disruptive to have a
separate button on the righthand side. Thematically this fits with other
AI affordances too, so matching the current `AI Tools` styling felt
better.

**Does this match Google branch guidelines?**

On the [preferred sources
page](https://developers.google.com/search/docs/appearance/preferred-sources#button-image-assets),
Google seems to suggest that this element can be relatively freeform.

```
You can design your own custom promotion badge or download official translated graphic assets provided by Google:
```

There's stricter guidelines for [`Sign in with
Google`](https://developers.google.com/identity/branding-guidelines#google-logo-in-the-sign-in-with-google-button)...
specifically, `don't Use monochrome versions of the Google "G" for the
button.`

Feel like that's more specific to *just* sign-in with Google, but worth
another brain confirming that.

## Preview links


https://docs-git-kody-devrel-728-preferred-source-google-docs-supabase.vercel.app/docs/guides/getting-started

---------

Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com>
Co-authored-by: anthony lio <lionnet.ant@gmail.com>
2026-10-16 13:44:47 -05:00
Alexis AguilarandMiranda Limonczenko bb1a2ab70d feat(docs): add Copy as Markdown and Ask AI to troubleshooting pages (#51501)
Resolves
[DOCS-1334](https://linear.app/supabase/issue/DOCS-1334/add-copy-as-markdown-ask-affordance-to-troubleshooting-pages).

## What this changes

Troubleshooting pages now have the same AI tools as guides: Copy as
Markdown, Ask ChatGPT, and Ask Claude. Readers can copy an article as
markdown, or open it in an AI assistant in one click.

The actions appear in the troubleshooting sidebar, after Keywords. The
heading matches the other sidebar headings. On narrow screens, the
sidebar stacks under the article, so the actions also work on mobile.

<img width="1512" height="908" alt="Screenshot 2026-10-09 at 2 29 13 PM"
src="https://github.com/user-attachments/assets/991c1555-c163-4894-91e5-8701bb1831f8"
/>

<img width="740" height="831" alt="Screenshot 2026-10-09 at 2 32 31 PM"
src="https://github.com/user-attachments/assets/1b9423d4-9f26-4f6f-9c9a-e95d50d7808e"
/>

## How it works

Before this PR, the AI tools section was built directly into the guides
sidebar, so only guides could use it. This PR moves it into its own
component, and guides and troubleshooting pages both render that
component. A future change to these actions, such as adding another
assistant or changing the Ask prompt, then happens in one place and
applies to both page types.

Each page passes a page type to the component. The component includes
that page type in the analytics events it sends when someone copies
markdown or clicks an Ask link. Guides send `guide`, and troubleshooting
pages send `troubleshooting`, so usage on each page type can be measured
separately.

## Open question

This PR adds a `troubleshooting` page type for analytics. It stays in
draft until that value is confirmed. If we reuse `guide` instead, it's a
one-line change.

## Testing

- Copy as Markdown copies the article and shows the "Copied!" state.
- Ask ChatGPT and Ask Claude open with the canonical page URL. ChatGPT
requires you to be logged in, which is also true on existing guide
pages.
- The sidebar layout works at desktop and mobile widths.
- Guide pages look and behave the same as before.

## Possible follow-up

On troubleshooting pages, the sidebar lists Products, Related error
codes, Keywords, AI tools, and then "Is this helpful?". The first four
headings use the sidebar's regular heading style. "Is this helpful?"
still uses the small monospace style from the guides sidebar, so it
stands out.

This PR lets the AI tools component accept a heading style from the page
it's placed on. The feedback component could accept a heading style the
same way. Troubleshooting pages could then pass the regular sidebar
style, and every heading in that sidebar would match.

---------

Co-authored-by: Miranda Limonczenko <miranda.limonczenko@supabase.io>
2026-10-15 08:52:14 -07:00