From c5c7ab571a4933b69a941752bd803d437ed6ffdd Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Fri, 27 Mar 2026 05:20:58 +0100 Subject: [PATCH] fix(federation): use inline badge for all attachment types Overlay badges inside overflow-hidden containers (images, video) were invisible. Use inline badges below the media for all types. --- .../components/chat/AttachmentRenderer.tsx | 70 ++++++++----------- 1 file changed, 30 insertions(+), 40 deletions(-) diff --git a/packages/web/src/components/chat/AttachmentRenderer.tsx b/packages/web/src/components/chat/AttachmentRenderer.tsx index 6741741e..849225a6 100644 --- a/packages/web/src/components/chat/AttachmentRenderer.tsx +++ b/packages/web/src/components/chat/AttachmentRenderer.tsx @@ -64,21 +64,7 @@ export function AttachmentRenderer({ attachment }: AttachmentRendererProps) { return null; })(); - // Overlay badge for media (images/video) — absolute positioned inside overflow-hidden container - const federationOverlayBadge = federationTooltip ? ( - -
- - {federationTooltip.type === 'remote' - ? - : <> - } - -
-
- ) : null; - - // Inline badge for file cards (audio/generic) — sits inside the card layout, not absolute + // Inline badge — sits next to file size or below media, never absolute-positioned const federationInlineBadge = federationTooltip ? (
@@ -95,18 +81,20 @@ export function AttachmentRenderer({ attachment }: AttachmentRendererProps) { if (mimetype.startsWith('image/')) { const { width, height } = attachment; return ( -
- {originalName} openImagePreview(attUrl)} - loading="lazy" - /> - {federationOverlayBadge} +
+
+ {originalName} openImagePreview(attUrl)} + loading="lazy" + /> +
+ {federationInlineBadge &&
{federationInlineBadge}
}
); } @@ -115,20 +103,22 @@ export function AttachmentRenderer({ attachment }: AttachmentRendererProps) { const { width, height } = attachment; const hasDimensions = width && height; return ( -
-
); }