Skip to content

feat: add match breakdown tooltip and TMDB poster support - #6

Merged
LavishSphere merged 6 commits into
mainfrom
feat/match-tooltip-posters
Jun 22, 2026
Merged

LavishSphere merged 6 commits into
mainfrom
feat/match-tooltip-posters

Conversation

@cheangie

Copy link
Copy Markdown
Collaborator

Summary

Adds two new frontend features and wires up TMDB poster image support in the backend data loader.

  • Adds a hoverable match breakdown tooltip to the % similarity badge on each title card — shows per-field TF-IDF scores (Description, Genres, Cast, Director) plus IMDb and Popularity signals as a mini bar chart overlaying the card face
  • Adds the same hoverable breakdown to the % match text in the detail drawer via a DrawerMatchBadge component
  • Adds poster image support to TitleCard — renders item.poster_url as a full-bleed cover image when available, falls back to monogram initials until the backend provides it
  • Adds TMDB poster fetching to data_loader.py with a disk cache (data/poster_cache.csv) so TMDB is only queried once on first startup — subsequent restarts load instantly from cache

Frontend changes

File Description
frontend/src/App.jsx Added MatchTooltip, DrawerMatchBadge components; hoverable badge on TitleCard; poster image support with monogram fallback

Backend changes

File Description
backend/data_loader.py Added _fetch_poster_url, _build_poster_cache; TMDB API config via TMDB_API_KEY env var; poster_url column added to master DataFrame

What needs to happen on the backend before posters work

  1. Set TMDB_API_KEY as an environment variable on the server
  2. Add poster_url: Optional[str] = None to TitleResult in main.py
  3. Return poster_url in the /recommend and /title responses

The frontend is already wired — the moment poster_url exists in the API response, posters appear automatically with no further frontend changes needed.

@cheangie
cheangie requested a review from LavishSphere June 22, 2026 03:52
Comment thread backend/data_loader.py
import time

import pandas as pd
import requests

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requirements.txt not updated

@LavishSphere LavishSphere left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint is also failing, everything else looks fine.

@LavishSphere LavishSphere left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LavishSphere
LavishSphere merged commit 1ea5a11 into main Jun 22, 2026
4 checks passed
@LavishSphere
LavishSphere deleted the feat/match-tooltip-posters branch June 22, 2026 04:18
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.

2 participants