Skip to content

fix(video-bites): show a card skeleton before the media mounts - #1785

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixcards-strip-show-a-card-skeleton-a30a98
Draft

fix(video-bites): show a card skeleton before the media mounts#1785
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixcards-strip-show-a-card-skeleton-a30a98

Conversation

@posthog

@posthog posthog Bot commented Aug 13, 2026

Copy link
Copy Markdown

Problem

  • A visitor on the flamingo.run homepage saw the video carousel paint empty dark boxes while scrolling — the first thing the page shows.
  • VideoHoverPreviewSurface gates its media on an IntersectionObserver mount signal (playerMounted). Until that fires, the un-mounted branch rendered a bare bg-ods-card rectangle: no poster, no play glyph.
  • Observer callbacks are async and batched per frame, so a fast marquee glide or a chevron jump moves a card into view before the gate catches up. Seam warps (the marquee renders two copies) are the worst case.
  • The same surface backs at least six other detail pages (case studies, interviews, investor updates, webinars, podcasts, what-i-shipped), so the defect was not confined to the homepage.

Change

  • The un-mounted branch now renders real card chrome instead of a flat fill:
    • poster present → the thumbnail as a lazy next/image (off-screen cards fetch nothing) plus the center play glyph;
    • no poster → an animated shimmer plus the play glyph.
  • An ungated card now reads as a card. Because the resting mounted card already shows the same poster, the mount-gate hand-off is now seamless — no dark flash while the observer catches up, and none on a seam warp.

Scope notes

  • The inbox report also floated making the mount index sticky and widening the root margin. With a real poster skeleton in place, both add cost for no visible gain: poster and first video frame look identical, so there is nothing left to re-blank. Sticky mount would also drop the surface's documented bounded live-player count (a homepage strip can hold up to 24 featured bites). Left out on purpose.
  • The featured-bites payload (multi-platform-hub/lib/data/featured-video-bites-utils.ts) already carries thumbnail_url for every bite that has one (it spreads the full bite). A bite with no thumbnail now shows the shimmer skeleton rather than a black box.

Test plan

  • Load the flamingo.run homepage carousel and scroll it fast / jump with the chevrons — cards show a poster + play glyph, never a flat dark box, before the player mounts.
  • A bite with no thumbnail_url shows an animated shimmer, not black.
  • Hover playback, navigation links, and the resting/active states are unchanged.

Why

The homepage hero carousel is the first thing a flamingo.run visitor sees; empty dark boxes read as broken even though nothing functional fails. This is polish on a high-visibility, shared surface.


Created with PostHog Desktop from this inbox report.

VideoHoverPreviewSurface painted a bare bg-ods-card rectangle while the
IntersectionObserver mount gate had not yet reported the card as near the
viewport. On the flamingo.run homepage carousel this showed as empty dark
boxes during a fast marquee glide or a chevron jump, because the observer
runs async and lags a fast scroll.

The un-mounted branch now renders real card chrome: the poster (a lazy
next/image, so off-screen cards fetch nothing) plus the center play glyph,
or an animated shimmer when a bite has no thumbnail. An ungated card reads
as a card instead of a flat dark box.

Generated-By: PostHog Desktop
Task-Id: fae7cfe4-7c8e-4c70-aa31-0a4cf1fe6805
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.

0 participants