Skip to content

fix(search): Skip stored SDK bias on SDK-agnostic doc pages#17974

Merged
coolguyzone merged 1 commit into
masterfrom
coolguyzone/fix/skip-platform-bias-on-product-docs
Jun 2, 2026
Merged

fix(search): Skip stored SDK bias on SDK-agnostic doc pages#17974
coolguyzone merged 1 commit into
masterfrom
coolguyzone/fix/skip-platform-bias-on-product-docs

Conversation

@coolguyzone
Copy link
Copy Markdown
Contributor

@coolguyzone coolguyzone commented Jun 1, 2026

DESCRIBE YOUR PR

Right now if you visit a non-SDK page (e.g. /product/...) after visiting an SDK page, your search results will still be weighted towards content relevant to that SDK. With this fix, you will only see SDK-specific results when you are in the SDK docs.

This adds an 'SDK_AGNOSTIC_PATH_PREFIXES' array which lets the search component know when you are not on an SDK page. Homepage behavior is unchanged. See video for an example of the fix:

pr-17974.mov

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

The Search component restores the user's last-used SDK from localStorage
whenever the page passes no platform. On `/platforms/*` that's correct,
but on product/concepts/cli/guides/integrations pages — which have no
SDK — the stored platform was still attached to every query as an
`optionalFilters: sdk:<platform>` boost, surfacing irrelevant SDK pages
above the product doc the user is actually reading.

Detect these SDK-agnostic prefixes and clear `currentSearchPlatforms`
instead of restoring. The set mirrors `PRODUCT_DOC_PREFIXES` in
`scripts/algolia.ts`, which already treats the same pages as the
top-popularity non-SDK group in the index ranking. Behavior on the
homepage (`useStoredSearchPlatforms={false}`) and on `/platforms/*`
pages is unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Jun 1, 2026 9:34pm
sentry-docs Ready Ready Preview, Comment Jun 1, 2026 9:34pm

Request Review

Copy link
Copy Markdown
Member

@sergical sergical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one!

@coolguyzone coolguyzone merged commit 989bb2e into master Jun 2, 2026
23 checks passed
@coolguyzone coolguyzone deleted the coolguyzone/fix/skip-platform-bias-on-product-docs branch June 2, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants