Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions mflix/client/app/components/MovieCard/MovieCard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@
font-size: 14px;
}

.vectorScore {
margin: 0 0 4px 0;
color: #0066cc;
font-size: 13px;
font-weight: 500;
background: #e6f0ff;
padding: 4px 8px;
border-radius: 4px;
display: inline-block;
}

.movieGenres {
margin: 0;
color: #888;
Expand Down
5 changes: 5 additions & 0 deletions mflix/client/app/components/MovieCard/MovieCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ export default function MovieCard({ movie, isSelected = false, onSelectionChange
{movie.year && (
<p className={movieStyles.movieYear}>({movie.year})</p>
)}
{movie.score !== undefined && (
<p className={movieStyles.vectorScore}>
🎯 Vector Score: {movie.score.toFixed(4)}
</p>
)}
{movie.imdb?.rating && (
<p className={movieStyles.movieRating}>⭐ {movie.imdb.rating}/10</p>
)}
Expand Down
1 change: 1 addition & 0 deletions mflix/client/app/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ export async function vectorSearchMovies(searchParams: {
genres: item.genres || [],
directors: item.directors || [],
cast: item.cast || [],
score: item.score,
// Add default values for fields not included in VectorSearchResult
fullplot: undefined,
released: undefined,
Expand Down
6 changes: 4 additions & 2 deletions mflix/client/app/types/movie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/**
* Movie interface for type safety
* Matches the Movie type from the Express backend
* Matches the Movie type from the backend
*/
export interface Movie {
_id: string;
Expand Down Expand Up @@ -51,11 +51,13 @@ export interface Movie {
};
metacritic?: number;
type?: string;
// Vector search score (only present in vector search results)
score?: number;
}

/**
* API Response interface for the movies endpoint
* Matches the SuccessResponse type from the Express backend
* Matches the SuccessResponse type from the backend
*/
export interface MoviesApiResponse {
success: boolean;
Expand Down