feat(client): personalize empty-feed follow suggestions - #14562
Merged
Conversation
Wires the new GET /users/:id/suggested-follows endpoint into the two surfaces that currently show a hardcoded list: web's empty feed and mobile's SuggestedFollows. useFollowSuggestions is the shared entry point -- personalized suggestions when the user has favorites or reposts to draw on, and the existing SUGGESTED_FOLLOW_HANDLES list when they don't. Both surfaces go through it so the fallback rule lives in one place rather than being duplicated per platform. Sign-up artist selection deliberately keeps the static list; personalization has nothing to work with there. The fallback is fetched unconditionally rather than gated on the personalized query coming back empty. Empty is exactly the new-account case these surfaces exist for, so gating would put a serial round-trip in front of the users who need them most, and the fallback is a small static file. sdk.users.getSuggestedFollows is hand-written rather than generated: `npm run gen` pulls the spec from a running node, so the generated method can't exist until the API side deploys. It mirrors what the generator emits, and both it and its request type carry a comment to delete them after the next regen. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
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.
Wires
GET /users/:id/suggested-follows(AudiusProject/api#1020) into the two surfaces that currently show a hardcoded list: web's empty feed and mobile'sSuggestedFollows.Depends on AudiusProject/api#1020 being merged and deployed. Until then
sdk.users.getSuggestedFollows404s. It degrades to the current behavior rather than breaking — an errored query leavesdataundefined, which takes the fallback path — but it'll be noisy in the meantime, so please don't merge this first.Shape
useFollowSuggestionsis the shared entry point: personalized suggestions when the user has favorites or reposts to draw on, the existingSUGGESTED_FOLLOW_HANDLESlist when they don't. Both surfaces go through it so the fallback rule lives in one place instead of being duplicated per platform.Sign-up artist selection deliberately keeps the static list — personalization has nothing to work with for an account that's seconds old.
The fallback is fetched unconditionally rather than gated on the personalized query returning empty. Empty is the new-account case these surfaces exist for, so gating would put a serial round-trip in front of exactly the users who need them most, and the fallback is a small static file. Web also swaps its copy when the suggestions are personalized.
The hand-written SDK method
sdk.users.getSuggestedFollowsis hand-written in theUsersApiwrapper rather than generated, becausenpm run genpulls the spec from a running node — the generated method can't exist until the API side deploys. It mirrors what the generator emits, so swapping to the generated one later is a no-op for callers. Both it andGetSuggestedFollowsRequestcarry a comment saying to delete them after the next regen.Testing
sdk, common, web, and mobile all typecheck clean; eslint clean on the changed files.
Not verified: this hasn't been run against a live API with real data, so the render and the fallback switch are unproven at runtime — worth exercising once the API PR is deployed to staging.
🤖 Generated with Claude Code