fix(web): show Stems & Downloads section for stem-only tracks#14523
Merged
Conversation
The track page on web gated the Stems & Downloads section on `is_downloadable` alone, so a track that ships stems but has the original file download disabled never rendered the section — even after the user purchased it. Sample packs are exactly this shape: `is_downloadable` is false and the purchased content lives entirely in the stems. Native mobile already gates on `is_downloadable || stems.length > 0`, which is why the section appeared there but not on web. Match the native mobile gate on both web surfaces: - GiantTrackTile (desktop) gated only on `is_downloadable`. - Mobile-web TrackHeader also checked `_stems`, but nothing ever populates that field, so it degraded to the same broken check. Use the `useStems` query instead and drop the dead `_stems` read. Verified against Full Crate's "Sounds For The People Vol. 2 | ATMO & TEXTURES" (is_downloadable=false, 12 stems): the section is absent before the change and lists all 12 stems after. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Reported in Slack: after purchasing a premium sample pack on web, the extras (downloadable files) never appear. Michael could see them on the native mobile app but not on web.
Repro track: Sounds For The People Vol. 2 | ATMO & TEXTURES
Root cause
This is not a post-purchase access-gate problem — the section never renders for this track regardless of purchase state.
The web track page gated the Stems & Downloads section on
is_downloadablealone:Sample packs have
is_downloadable === false— the purchased content is entirely stems. Confirmed against the reported track via the API:So the gate evaluated to
falseand the section was never mounted. Native mobile gates onis_downloadable || stems.length > 0, which is why it worked there.The mobile-web
TrackHeaderlooked correct (is_downloadable || (_stems?.length ?? 0) > 0), but_stemsis a vestigial field on theTrackmodel that nothing ever assigns — it's only ever read. That check silently degraded to the same broken condition.Fix
Match native mobile's gate on both web surfaces by sourcing stems from the
useStemsquery:GiantTrackTile.tsx(desktop) — add the stems check.TrackHeader.tsx(mobile web) — useuseStemsand drop the dead_stemsread.Verification
Ran the web client against production and loaded the reported track logged out, toggling the fix via
git stashto isolate cause and effect:The purchase gate itself was already correct — once the section mounts,
useDownloadableContentAccessdrives the locked/unlocked state as expected.tsc --noEmitandeslintpass clean on both changed files.Notes for reviewers
useStemsquery to the desktop track tile. It's the same query theDownloadSectionalready issues, so it's a cache hit rather than an extra request._stemsis now unread on the track page but still referenced by the purchase modals (PurchaseContentPage,GuestCheckoutPage,PremiumContentPurchaseDrawer,PurchaseSuccess), where it looks equally dead — those show a stem count in the purchase UI and are likely rendering0. Left alone here to keep this fix scoped; worth a follow-up.🤖 Generated with Claude Code