From a8b6b5f10e736a780bbca26de6d1ad62178a2ba6 Mon Sep 17 00:00:00 2001 From: Terry Yiu Date: Sun, 22 Jun 2025 18:09:45 -0400 Subject: [PATCH] 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 --- damus/Views/NoteContentView.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/damus/Views/NoteContentView.swift b/damus/Views/NoteContentView.swift index eaba2cf7..b4dd3c9d 100644 --- 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)) }