feat: adaptive deck — top-up recommends based on what you liked - #36
Merged
Merged
Conversation
As you swipe right, the deck now leans toward what's actually being liked. On each top-up, extendDeck expands the room's most-recent likes into TMDb recommendations and mixes them (personalized first) with the existing genre-discovery slice. - Likes are read from BOTH users, so recommendations land in the SHARED pool → matches still work. In a solo room it's just that one user's likes, so browsing alone gets personalized too. - Bounded for the free tier: only the 3 most-recent likes are expanded, ≤8 recs each, all via the 24h-cached getRecommendations — a handful of mostly-cached TMDb reads per top-up, no extra KV/D1 writes. Still capped at MAX_DECK=300. - Recs aren't genre-filtered by TMDb, so avoid_genres is re-applied via a new pure helper rejectAvoidGenres (also dedupes generatePool's inline filter). Unit-tested.
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.
As you swipe right, the deck now adapts toward what's actually being liked — not just fixed onboarding tastes.
How it works
On each top-up (
extendDeck), before the genre-discovery slice, it now:direction='like').getRecommendationspath onboarding seeds already use).Shared pool preserved (matches still work) + solo
Likes are read from both users, so the recommendations they generate land in the shared
rooms.deck— both users can see and therefore match on them. In a solo room the same query naturally returns just that one user's likes, so browsing alone gets personalized recommendations too.Free-tier safety
getRecommendations→ a handful of mostly-cached TMDb reads per top-up.MAX_DECK = 300.Cleanups + tests
avoid_genresis re-applied via a new pure helperrejectAvoidGenres, which also de-duplicates the inline filter ingeneratePool.rejectAvoidGenres;typecheck,lint,vitest(8/8) andwrangler --dry-runall pass.