fix(search): Skip stored SDK bias on SDK-agnostic doc pages#17974
Open
coolguyzone wants to merge 1 commit into
Open
fix(search): Skip stored SDK bias on SDK-agnostic doc pages#17974coolguyzone wants to merge 1 commit into
coolguyzone wants to merge 1 commit into
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
Fixes Algolia search surfacing irrelevant SDK pages above the product/concept doc the user is actually reading.
The Search component restores the user's last-used SDK from
localStoragewhenever 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 being attached to every query as anoptionalFilters: sdk:<platform>boost.SDK_AGNOSTIC_PATH_PREFIXESand gate the localStorage restore on it. On those paths,currentSearchPlatformsis cleared instead of restored.PRODUCT_DOC_PREFIXESinscripts/algolia.ts, which already treats the same pages as the top-popularity non-SDK group at index time.useStoredSearchPlatforms={false})./platforms/*behavior is unchanged.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: