From 0139eb207c7ededab236cf20b5f9340af73a6f96 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 27 May 2026 14:49:02 +0000 Subject: [PATCH] fix(music): subscribe each playlist track to relays so they actually load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LoadAddressableNote only resolves the AddressableNote shell from cache — it doesn't kick off a relay query. So a freshly-arrived playlist whose track events weren't already in the cache sat on the "Loading…" placeholder row forever. For each resolved track shell, wire up EventFinderFilterAssemblerSubscription (same pattern ProfileBadgesScreen uses for badge definitions). Its NoteEventLoaderSubAssembler asks relays for the addressable's actual event, and EventWatcherSubAssembler picks up reactions / replies on top. The subscription is keyed on the AddressableNote and lifecycle-aware, so scrolling the playlist off-screen drops the watchers. --- .../vitorpamplona/amethyst/ui/note/types/MusicPlaylist.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/MusicPlaylist.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/MusicPlaylist.kt index 3a304974c0..8298f10081 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/MusicPlaylist.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/MusicPlaylist.kt @@ -59,6 +59,7 @@ import com.vitorpamplona.amethyst.commons.model.toImmutableListOfLists import com.vitorpamplona.amethyst.model.AddressableNote import com.vitorpamplona.amethyst.model.LocalCache import com.vitorpamplona.amethyst.model.Note +import com.vitorpamplona.amethyst.service.relayClient.reqCommand.event.EventFinderFilterAssemblerSubscription import com.vitorpamplona.amethyst.ui.components.LoadNote import com.vitorpamplona.amethyst.ui.components.MyAsyncImage import com.vitorpamplona.amethyst.ui.components.TranslatableRichTextViewer @@ -221,6 +222,13 @@ fun MusicPlaylistHeader( } LoadAddressableNote(address, accountViewModel) { trackNote -> if (trackNote != null) { + // Ask relays for the track event itself (and its + // reactions/replies) so a playlist whose tracks aren't + // already in cache populates instead of sitting on the + // "Loading…" placeholder. The subscription is keyed on + // the AddressableNote and lifecycle-aware, so it stops + // when the playlist scrolls off-screen. + EventFinderFilterAssemblerSubscription(trackNote, accountViewModel) PlaylistTrackRow( position = index + 1, trackNote = trackNote,