Repository navigation
Load the hero video before hydration and align its still image - #1425
Conversation
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Motion-aware source and poster src/components/home/HeroPalmMedia.tsx, tests/hero-media.test.ts |
The video source is restricted to no-preference. The poster overlays the video while it loads and remains opaque for reduced motion. Tests check source selection, poster layering, and image/video aspect ratios. |
Playback, readiness, and retry src/components/home/HeroPalmMedia.tsx, tests/hero-media.test.ts |
Playback loads the video when needed. The component initializes playback and readiness state from the video element. Tests cover requests before hydration, playback failures, and retrying a failed request. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant Browser
participant VideoElement
participant HeroPalmMedia
participant PlayControl
participant PosterImage
Browser->>VideoElement: Select source based on motion preference
VideoElement->>Browser: Request video for no-preference
PlayControl->>HeroPalmMedia: Request playback
HeroPalmMedia->>VideoElement: Load when no source, then play
VideoElement->>PosterImage: Update readiness state
Suggested reviewers: ladybluenotes
Merge Risk: 
Minimal · up to 45793
-
Users can start the hero video after changing their motion preference. No merge-blocking issue remains.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
🤖 Made with codex, reviewed by human
The homepage currently assigns the hero video URL after hydration. Include the video source in server-rendered HTML so the browser can request it without waiting for hydration. A media condition preserves the initial download avoidance for reduced-motion users.
Crop the existing high-resolution still images to match the video's aspect ratio. Both layers use centered
object-cover, preserving the palm's framing when playback starts across viewport sizes. Keep the still visible untilcanplay, and preserve playback controls and reduced-motion handling.Earlier parser-blocking resources can still delay video discovery. Stylesheet ordering and font loading are separate work.
Before / after
The before with reduced motion should match the other 3.
Motion-enabled rows show the unchanged video paused at its first frame. Reduced-motion rows show the still image. Captures use the production layout with original versus cropped still-image assets.
Validation
Summary by CodeRabbit