fix(search): Skip stored SDK bias on SDK-agnostic doc pages#17974
Merged
coolguyzone merged 1 commit intoJun 2, 2026
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes: