diff --git a/nobilis b/nobilis index 1f6ce2c..dd450eb 160000 --- a/nobilis +++ b/nobilis @@ -1 +1 @@ -Subproject commit 1f6ce2c643b2006726d8e590171375881af6516b +Subproject commit dd450ebe86ec7c3d42ca724cfcbe20ab4a900603 diff --git a/src/renderer/src/app.css b/src/renderer/src/app.css index 8aa0ee4..3e9902d 100644 --- a/src/renderer/src/app.css +++ b/src/renderer/src/app.css @@ -6676,6 +6676,21 @@ video.lightbox-media { color: var(--error); } +/* --- Link previews ---------------------------------------------------- */ + +/* The picture a homeserver found behind a link. Capped rather than sized to + the card: a preview image is often a 1200px banner, and a card as wide as + the conversation would turn every posted link into the loudest thing in the + room. */ +.rich-embed-image { + max-width: 100%; + max-height: 220px; + margin-top: var(--spacing-xs); + border-radius: var(--corner-radius-small); + object-fit: cover; + cursor: pointer; +} + /* --- Jump to a date --------------------------------------------------- */ /* Under the search box, because it answers the same question by a different diff --git a/src/renderer/src/components/MessageRow.tsx b/src/renderer/src/components/MessageRow.tsx index 0f3064a..68b0b48 100644 --- a/src/renderer/src/components/MessageRow.tsx +++ b/src/renderer/src/components/MessageRow.tsx @@ -877,8 +877,20 @@ function MessageRowBody({ /> )} - {/* The thing the embed is about, inside the card describing it - rather than repeated below it. */} + {/* The picture the card is about, where the card brought one + of its own. A Matrix link preview is unfurled by the + homeserver and arrives as a file the daemon has already + fetched - so there is nothing to sniff and nothing to pair + it with, unlike Discord's below. */} + {embed.imageUrl && !embedMedia.claimed.has(i) && ( + embed.url && void window.moho.openExternal(embed.url)} + /> + )} {embedMedia.claimed.has(i) && (