mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 15:39:13 +00:00
## Problem We don't track clicks on the shared `DocsButton`, so we can't tell which pages send people to the docs most or where the UI needs more explanation. Closes FE-5020. ## Solution Add a `docs_button_clicked` event, fired once per click from the click handler in the shared `DocsButton`. One call covers every page that renders it. - Properties: optional `topic` (a fixed label passed by the caller, omitted when unset). `pathname` is already attached to every event by `useTrack`. - Groups are `Partial<TelemetryGroups>` because the button renders on project, organization, and account pages. - Click still stops propagation, as before. ## Review instructions 1. Run `pnpm dev:studio` and open a page with a docs button (e.g. a project's Auth or Database page). 2. Click it and check the `docs_button_clicked` event is sent once, with `topic` when the button has one. 3. Run `pnpm --filter studio exec vitest run components/ui/DocsButton.test.tsx`. Still to do after merge: verify the event in PostHog on staging.