commit 839ef6a80d934cfd43b9b10192a6f69dadcc2511
parent c073dd8fead8b83db6a9b5dd6b9075d5d867b3c1
Author: Terry Yiu <git@tyiu.xyz>
Date: Sun, 22 Jun 2025 18:09:45 -0400
Remove image, video, and icon from non-media link previews if media links are present to reduce screen clutter
Changelog-Changed: Removed media from regular link previews if media is already being shown
Signed-off-by: Terry Yiu <git@tyiu.xyz>
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/damus/Views/NoteContentView.swift b/damus/Views/NoteContentView.swift
@@ -87,6 +87,12 @@ struct NoteContentView: View {
return linkPreviewWithNoMedia(cached)
}
+ // If media is already being shown, do not show media in the link preview
+ // to avoid taking up additional screen space.
+ if case let .separated(separated) = note_artifacts, !separated.media.isEmpty && !self.options.contains(.no_media) {
+ return linkPreviewWithNoMedia(cached)
+ }
+
return LinkViewRepresentable(meta: .linkmeta(cached))
}