Overview
TheMovieCard component is the primary card display for movies and TV shows in StreamVault. It features poster images, metadata overlays, progress tracking, hover animations, and a context menu for actions.
Features
- Poster Display: Shows movie/TV show posters with fallback placeholders
- Progress Tracking: Visual progress bar and resume indicator
- Hover Effects: Smooth animations with glow effects and play button overlay
- Context Menu: Right-click menu for Play, Fix Match, Watch Together, Delete, and more
- Status Badges: “Watched” badge for completed content, progress percentage for in-progress items
- Optimized Performance: Memoized with custom comparison function to prevent unnecessary re-renders
- Cloud Integration: AI chat button for cloud-hosted content
Component Interface
Props
The media item to display (movie or TV show)
Callback when the card is clicked to play the media
Callback to fix metadata matching for incorrect matches
Optional callback to remove item from watch history
Optional callback to delete the media file from cloud storage
Optional callback to start a Watch Together session (beta feature)
Optional callback to open AI chat for this media (cloud items only)
Disable the staggered entry animation when cards first appear
Aspect ratio of the poster container
Additional CSS classes to apply to the card container
Card index for staggered animation delay calculation
MediaItem Interface
Usage Examples
Basic Movie Grid
With All Features (Cloud Library)
History View
Visual States
Progress Tracking
The card automatically displays progress for partially watched content:- Progress Badge: Shows percentage complete (1-94%)
- Progress Bar: White bar at bottom of poster showing progress
- Watched Badge: Gray “Watched” badge for items 95%+ complete
Hover Interactions
On hover, the card displays:- Glow effect behind the card
- Lift animation (moves up and scales slightly)
- Play button in center with pulsing glow ring
- Action buttons in top-right (AI Chat, More options)
- Enhanced border with white glow
Context Menu
Right-click opens a context menu with:- Play Now - Start playback immediately
- Fix Match - Correct metadata matching
- Ask AI (cloud only) - Open AI chat about this title
- Watch Together (beta) - Create synchronized watch session
- Remove from History (history view only)
- Delete from Drive (cloud only)
Performance Optimization
The component usesReact.memo with a custom comparison function to prevent unnecessary re-renders:
- Callback prop references (to avoid stale closures)
- Visual properties (title, poster, progress, etc.)
- Metadata (season/episode, year, cloud status)
Animations
Entry Animation
Cards animate in with a staggered delay based on their index:disableEntryAnimation={true} to skip this for dynamic updates.
Hover Animation
Smooth spring-based animations for hover states using Framer Motion.Styling
The card uses Tailwind CSS with custom backdrop blur and shadow effects:- Background: Semi-transparent dark card with backdrop blur
- Border: Subtle white border that intensifies on hover
- Shadow: Elevation increases on hover with glow effect
- Typography: White title with muted metadata text
Image Loading
Poster images are loaded from the local cache with fallback:- Load from
image_cache/viagetCachedImageUrl() - Show skeleton shimmer while loading
- Fallback to placeholder with title initials if no poster
Accessibility
- Semantic button elements for clickable areas
aria-labelattributes on action buttonstitleattributes for tooltips- Keyboard navigation support via context menu
Related Components
ContinueCard
Horizontal card variant for Continue Watching section
EpisodeBrowser
Browse and play TV show episodes by season
Source Code
Location:~/workspace/source/src/components/MovieCard.tsx
The component is approximately 640 lines including the ContinueCard variant and comparison functions.