Skip to content

fix(embed): clip playlist card overflow to viewport#14434

Merged
raymondjacobson merged 3 commits into
mainfrom
fix/playlist-embed-card-overflow
Jun 2, 2026
Merged

fix(embed): clip playlist card overflow to viewport#14434
raymondjacobson merged 3 commits into
mainfrom
fix/playlist-embed-card-overflow

Conversation

@raymondjacobson
Copy link
Copy Markdown
Member

@raymondjacobson raymondjacobson commented Jun 2, 2026

Fixes #14431

Summary

Playlist embeds were rendering off-screen — Card flavor looked like a stuck loading spinner and Compact flavor showed only the header. Albums hid the same bug because they typically have few tracks.

What was wrong

The embed Card sizes itself from its parent's clientHeight × 0.833 (aspect ratio). The wrapping playerContainerRef div was a flex: 1, width: auto flex item with no min-*: 0, so it grew to its content's natural height. For a 96-track playlist that's ~4760px, which made the Card ~3965×4760px — entirely off the visible 480×480 iframe.

Albums with ~10 tracks landed at a viable size (~566×680px) and looked roughly fine, masking the bug. The regression goes back to #13496, which introduced the wrapping div as part of the react-router v7 upgrade.

Fix

In packages/embed/src/components/app.jsx:365-374, lock the player-container box to the iframe so the Card can't drag it open:

  • width: '100%' — drop the isCard ? 'auto' branch that fed back into Card sizing
  • minWidth: 0, minHeight: 0 — let the flex item shrink below its content size
  • overflow: 'hidden' — clip any Card content that still exceeds the viewport

This PR also fixes seven import { full } from '@audius/sdk' callsites whose full namespace was dropped by #13730. Those imports left the embed unbuildable from current source — the prod bundle has been a stale pre-#13730 build for months. The default (non-full) endpoints return the same fields the embed reads, so they swap to the named instanceOfPurchaseGate export.

Verification

With the SDK imports fixed, the embed dev server now builds. Verified against the local dev server at 480×480 viewport:

Embed Card dims Notes
/playlist/RNE1GmG?flavor=card (96 tracks, the issue's repro) 400×480 Renders correctly with scrollable track list
/album/54qOm4X?flavor=card (11 tracks, regression check) 400×480 Renders correctly
/track/KKK8bEr?flavor=card (regression check) 400×480 Renders correctly

Also cross-checked against live production (with the equivalent CSS injected via Playwright) — same results.

No automated tests added; embed has no layout test infrastructure.

For the reviewer

  • Compact + collection was always a structural mismatch — CollectionPlayerCard is the only collection player, so compact (120px tall) renders the same card layout, just clipped. This PR makes it visibly clipped instead of pushed off-screen, but designing a real compact collection view is out of scope.
  • Once this lands, the prod embed bundle should be rebuilt — it's been running a stale pre-Drop v1/full from sdk #13730 build since the full removal made source uncompilable.

🤖 Generated with Claude Code

The embed Card sizes itself from its parent's clientHeight (× the
0.833 aspect ratio). For a playlist with many tracks, the unconstrained
player-container div grew to the natural content height (~4760px for
96 tracks), so the Card became ~3965×4760px — pushed entirely off the
visible 480×480 iframe. Card flavor looked stuck on the loading
spinner, and Compact flavor showed only the header.

Albums hid this because they typically have few tracks, so the
content-driven height stayed close to the viewport and the Card
landed at a reasonable size.

Lock the player-container to the iframe box so the Card can't drag it:
- width: 100% (drop the isCard ? 'auto' branch that fed back into Card sizing)
- minWidth/minHeight: 0 (allow the flex item to shrink below content)
- overflow: hidden (clip Card content that exceeds the viewport)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 2, 2026

⚠️ No Changeset found

Latest commit: 63f2932

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

raymondjacobson and others added 2 commits June 2, 2026 10:26
full.instanceOfPurchaseGate was undefined (the validator only exists
under the default models, re-exported at the SDK top level), so the
editor's on-save fix-all kept rewriting the import and leaving the file
dirty. Switch to the valid direct named import.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The `full` namespace was dropped from @audius/sdk in #13730 but seven
embed callsites still did `import { full }` and `const { instanceOfPurchaseGate } = full`,
which left the embed unbuildable from current source — the prod bundle
has been a stale pre-#13730 build for months. The default (non-full)
endpoints return the same fields the embed reads, so swap the import
to the named export.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pull-request-size pull-request-size Bot added size/M and removed size/XS labels Jun 2, 2026
@raymondjacobson raymondjacobson merged commit 5298169 into main Jun 2, 2026
3 checks passed
@raymondjacobson raymondjacobson deleted the fix/playlist-embed-card-overflow branch June 2, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playlist Embed Issue

1 participant