Skip to content

Fix embed#13496

Merged
raymondjacobson merged 1 commit into
mainfrom
rj-embed-fixes
Dec 17, 2025
Merged

Fix embed#13496
raymondjacobson merged 1 commit into
mainfrom
rj-embed-fixes

Conversation

@raymondjacobson
Copy link
Copy Markdown
Member

Fix embed player from react upgrades

  • Fix broken/weird app-redirect URL
  • Fix layout broken by react upgrade
  • Add image fetch timeout
  • Fix link redirect when viewing coin gated

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Dec 17, 2025

⚠️ No Changeset found

Latest commit: 3558108

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

Copy link
Copy Markdown
Contributor

@dylanjeffers dylanjeffers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!!

@raymondjacobson raymondjacobson merged commit dce5c1b into main Dec 17, 2025
5 checks passed
@raymondjacobson raymondjacobson deleted the rj-embed-fixes branch December 17, 2025 17:12
raymondjacobson added a commit that referenced this pull request Jun 2, 2026
Fixes [#14431](#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](#13496), which
introduced the wrapping div as part of the react-router v7 upgrade.

## Fix

In
[packages/embed/src/components/app.jsx:365-374](packages/embed/src/components/app.jsx#L365-L374),
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

## Verification

I couldn't run the embed's dev server locally — the `import { full }
from '@audius/sdk'` imports in `track/*.jsx`, `pausedpopover/*.jsx`, and
`collection/CollectionPlayerCard.jsx` are dead (the `full` namespace was
removed by [#13730](#13730)
but those callsites weren't updated). That's a separate, pre-existing
problem.

Instead I verified the fix against the live production embed via
Playwright by injecting the equivalent CSS rule (`#app > div {
min-height: 0 !important; min-width: 0 !important; height: 100%
!important; width: 100% !important; overflow: hidden !important; }`) at
page load:

| Embed | Before | After |
|---|---|---|
| `/embed/playlist/RNE1GmG?flavor=card` (96 tracks) | Card 3965×4760,
viewport empty | Card 400×480, renders correctly |
| `/embed/album/54qOm4X?flavor=card` (11 tracks, regression check) |
Card 566×680, mostly OK | Card 400×480, renders correctly |
| `/embed/track/...?flavor=card` (regression check) | Renders | Renders
|

No automated tests added — embed has no layout test infrastructure and
this is a one-line CSS change.

## 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.
- **The dead `full` imports** in `track/*.jsx` etc. should be fixed in a
follow-up so the embed can actually be built and deployed. The
production embed is currently running a stale bundle from before that
breakage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants