mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
## 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)