From ee8623bd208eac03233352e744a3a475b001bc39 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 29 Jul 2026 17:01:53 +0000 Subject: [PATCH] refactor: dispatch all NIP-71 video kinds via the VideoEvent interface in NoteCompose RenderNoteRow matched the four concrete video subtypes (VideoNormalEvent 21, VideoShortEvent 22, VideoHorizontalEvent 34235, VideoVerticalEvent 34236) with four identical branches. Collapse them into a single `is VideoEvent` branch, matching how ThreadFeedView's NoteMaster already dispatches, so any future VideoEvent subtype renders through VideoDisplay automatically instead of falling through to the text fallback. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01QCKP4tD2seoDpr3ZcdPJNx --- .../amethyst/ui/note/NoteCompose.kt | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt index 995197944e..42ce00cb0b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt @@ -327,10 +327,7 @@ import com.vitorpamplona.quartz.nip64Chess.game.ChessGameEvent import com.vitorpamplona.quartz.nip65RelayList.AdvertisedRelayListEvent import com.vitorpamplona.quartz.nip66RelayMonitor.discovery.RelayDiscoveryEvent import com.vitorpamplona.quartz.nip68Picture.PictureEvent -import com.vitorpamplona.quartz.nip71Video.VideoHorizontalEvent -import com.vitorpamplona.quartz.nip71Video.VideoNormalEvent -import com.vitorpamplona.quartz.nip71Video.VideoShortEvent -import com.vitorpamplona.quartz.nip71Video.VideoVerticalEvent +import com.vitorpamplona.quartz.nip71Video.VideoEvent import com.vitorpamplona.quartz.nip72ModCommunities.approval.CommunityPostApprovalEvent import com.vitorpamplona.quartz.nip72ModCommunities.communityAddress import com.vitorpamplona.quartz.nip72ModCommunities.definition.CommunityDefinitionEvent @@ -1514,19 +1511,9 @@ private fun RenderNoteRow( FileHeaderDisplay(baseNote, true, ContentScale.FillWidth, accountViewModel) } - is VideoHorizontalEvent -> { - VideoDisplay(baseNote, makeItShort, canPreview, backgroundColor, ContentScale.FillWidth, accountViewModel, nav) - } - - is VideoVerticalEvent -> { - VideoDisplay(baseNote, makeItShort, canPreview, backgroundColor, ContentScale.FillWidth, accountViewModel, nav) - } - - is VideoNormalEvent -> { - VideoDisplay(baseNote, makeItShort, canPreview, backgroundColor, ContentScale.FillWidth, accountViewModel, nav) - } - - is VideoShortEvent -> { + // Covers every NIP-71 video kind (21, 22, 34235, 34236) via the shared interface, + // so new video subtypes render automatically instead of falling through to text. + is VideoEvent -> { VideoDisplay(baseNote, makeItShort, canPreview, backgroundColor, ContentScale.FillWidth, accountViewModel, nav) }