Commit Graph
6 Commits
Author SHA1 Message Date
claude[bot]andClaude ffef679f70 chore(docs): add hasResults to docs_search_v2_search_submitted (#51541)
<!-- claude-slack-attribution -->
_Requested by **Pam Chia** · [Slack
thread](https://supabase.slack.com/archives/C076KTY11DF/p1791767641595649?thread_ts=1791767641.595649&cid=C076KTY11DF)_

## Problem

**Before:** `docs_search_v2_search_submitted` (added in #51146) fires
when a Search V2 query settles on either the `results` or the
`noResults` state, but it only sends `query`. A search that found
nothing looks the same as one that found results, and no other Search V2
event carries the outcome, so the no-results rate for Search V2 can't be
computed.

**After:** the event also sends `hasResults`. It's `true` when the
endpoint returned at least one result and `false` when it returned none,
so zero-result searches can be counted and their queries inspected.

## Solution

- `packages/common/telemetry-constants.ts`:
`DocsSearchV2SearchSubmittedEvent` gains a doc-commented `hasResults:
boolean` property.
- `apps/docs/features/SearchV2/SearchV2Dialog.tsx`: the existing fire
site sends `hasResults: searchState.status === 'results'`. The
`useDocsSearchV2` reducer only sets `results` when the response has at
least one hit, and `noResults` otherwise, so the status is exactly the
outcome.

The change is additive: the event name and `query` are unchanged, and
the `loading`, `error`, and `initial` states still don't fire the event.

Linear:
[GROWTH-1330](https://linear.app/supabase/issue/GROWTH-1330/docs-search-v2-add-hasresults-to-docs-search-v2-search-submitted)

## Review instructions

1. Open the docs preview with the Search V2 flag query:
`?docs-search-v2=search-v2-active`.
2. Open search and type a query that returns results. In the network
tab, the `/platform/telemetry/event` request for
`docs_search_v2_search_submitted` has `custom_properties` `{ "query":
"...", "hasResults": true }`.
3. Type a query that returns nothing (for example random characters).
The event has `"hasResults": false`.

## 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)
(not applicable: no docs content changed)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01JaqCdU2sPkBMbaUmUPW75i

---
_Generated by [Claude
Code](https://claude.ai/code/session_01JaqCdU2sPkBMbaUmUPW75i)_

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-13 10:41:53 -03:00
Pamela Chia 20d752517f feat(docs): record search v2 rollout exposure (#51300) 2026-10-06 01:35:45 -07:00
Anthony Lio dcf266c360 feat(docs): update search v2 ui (#51175) 2026-10-05 20:33:19 +00:00
Jeremias Menichelli 53ecbf9f2a chore: Add telemetry to search v2 user actions (#51146)
## Problem

We need to collect data from search v2 experiment usage.

## Solution

Add telemetry to search v2 modal being opened, closing, sending a query
and clicking a search v2 result.

<!--
## 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 preview link and add the search v2 flag query:
`?docs-search-v2=search-v2-active`
2. Trigger all actions mentioned above
3. Telemetry data should be sent on the network tab


## 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 references
[WORD_LIST](https://github.com/supabase/supabase/blob/master/apps/docs/WORD_LIST.md)
and the docs
[CONTRIBUTING](https://github.com/supabase/supabase/blob/master/apps/docs/CONTRIBUTING.md)
guide


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Improvements**
* Documentation search activity is now recorded when the dialog opens
from the keyboard shortcut or search input, and when it closes. Search
submissions include the query and whether results were found; selected
results include their destination and the highlighted query. This adds
visibility into key search interactions without changing how search
results or highlighting work.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-05 13:22:22 -03:00
Jeremias Menichelli 99103b3571 feat: Add edge function and hooks for search V2 (#51103) 2026-09-30 18:12:07 -03:00
Jeremias Menichelli 9bf43188f1 feat: Create first scaffolding around search v2 and feature flag addition (#50236) 2026-09-16 13:41:16 -03:00