Skip to content

feat: adaptive deck — top-up recommends based on what you liked - #36

Merged
valeboth merged 1 commit into
mainfrom
feat/adaptive-deck
Aug 28, 2026
Merged

valeboth merged 1 commit into
mainfrom
feat/adaptive-deck

Conversation

@valeboth

Copy link
Copy Markdown
Owner

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:

  1. Reads the room's most-recent likes (direction='like').
  2. Expands them into TMDb recommendations (the same getRecommendations path onboarding seeds already use).
  3. Mixes them in personalized-first, deduped into the shared pool.

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

  • Only the 3 most-recent likes are expanded per top-up, ≤8 recs each.
  • All via the 24h-cached getRecommendations → a handful of mostly-cached TMDb reads per top-up.
  • No extra KV/D1 writes beyond what top-up already did; still capped at MAX_DECK = 300.

Cleanups + tests

  • Recs aren't genre-filtered by TMDb, so avoid_genres is re-applied via a new pure helper rejectAvoidGenres, which also de-duplicates the inline filter in generatePool.
  • Unit tests for rejectAvoidGenres; typecheck, lint, vitest (8/8) and wrangler --dry-run all pass.

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.
@valeboth
valeboth merged commit f25ae45 into main Aug 28, 2026
1 check passed
@valeboth
valeboth deleted the feat/adaptive-deck branch August 28, 2026 13:17
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.

1 participant