fix(comments): show loading state instead of blank comment drawer when opened from a tile#14494
Merged
Merged
Conversation
… from a tile When the comment drawer is opened from a lineup tile (e.g. the feed), the full track may not yet be in the query cache. CommentSectionProvider returns null until the track loads, which rendered an empty bottom sheet. Fetch the track in CommentDrawer and show comment skeletons while it loads so the drawer never appears blank. 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
Pressing the comment button on a track tile in the feed opened a blank comment drawer. Opening the drawer from the track screen worked fine.
Root cause
CommentSectionProvider(packages/common/src/context/comments/commentsContext.tsx) fetches the full track viauseTrack(entityId)and short-circuits withif (!track) return nulluntil it loads.[track, trackId]cache (the screen pre-fetches it), so the provider renders immediately.CommentDrawermounts with the newentityId. WhileuseTrackis fetching, the provider returnsnull, rendering nothing inside the bottom sheet → a blank drawer.Fix
In the mobile
CommentDrawer, fetch the track withuseTrack(entityId)and render comment skeletons while it's loading, instead of relying on the provider (which renders nothing). Once the track resolves, the fullCommentSectionProvidertree renders as before. This keeps the change mobile-scoped (where the blank was observed) and reuses the existingCommentSkeletonloading aesthetic.Testing
eslintclean on the changed filetsc --noEmitclean🤖 Generated with Claude Code