v3: journal now shows the generated still for video dumps, like the hot/new feeds already did
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 46s

The hot/new feeds go through FilePreview, which asks for
GET /api/thumbnails/:dumpId unconditionally on a video mime and lets VideoThumb
fall back to an icon if it 404s. The journal instead only recognised image files
and dump.thumbnailMime — and that field maps to custom_thumbnail_mime, i.e. a
thumbnail somebody uploaded by hand. Nothing on the Dump object advertises the
ffmpeg still the route generates on demand, so hasThumbnail() returned false,
mode degraded to text, and the card rendered a 🎬.

hasThumbnail() and JournalCard's thumbnail resolution now both treat a video
file as art, resolving to the same route. Since hasThumbnail() also gates grid
footprints, video dumps can now claim feature/tall/wide slots — the mosaic has
noticeably more image cards as a result, which is the point.

ThumbnailPlaceholder gains `glyph` and `seed`: a host without ffmpeg gets a 404
and lands on the placeholder, where the mime emoji says more about the dump than
an initial taken from its filename, and the hue is seeded from the filename
since there's no hostname to hash.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
khannurien
2026-08-11 20:04:09 +00:00
parent 7303509b6f
commit 89314b1b6e
4 changed files with 40 additions and 17 deletions

View File

@@ -41,12 +41,17 @@ export function JournalCard(
navigate(dumpUrl(dump));
}
const thumbnailUrl =
dump.kind === "file" && dump.fileMime?.startsWith("image/")
// Mirrors FilePreview (the hot/new feeds) so a video shows its generated
// still here too, rather than degrading to a text card with a 🎬.
const thumbnailUrl = dump.thumbnailMime
? dumpThumbnailUrl(dump, token)
: dump.kind === "file"
? (dump.fileMime?.startsWith("image/")
? dumpFileUrl(dump, token)
: dump.thumbnailMime
: dump.fileMime?.startsWith("video/")
? dumpThumbnailUrl(dump, token)
: (dump.richContent?.thumbnailUrl ?? null);
: null)
: (dump.richContent?.thumbnailUrl ?? null);
// Content mode is independent of grid footprint: a thumbnailed dump reads as
// an image card, a thumbnail-less dump with a note becomes a pull-quote, and
@@ -151,12 +156,16 @@ export function JournalCard(
<div className="journal-card-image">
<Thumbnail
src={thumbnailUrl ?? undefined}
placeholder={{
url: dump.url,
accentColor: dump.richContent?.accentColor,
faviconUrl: dump.richContent?.faviconUrl,
siteName: dump.richContent?.siteName,
}}
placeholder={dump.kind === "file"
// No ffmpeg on the host means no still — the mime glyph says more
// about the dump than an initial taken from its filename.
? { seed: dump.fileName ?? dump.id, glyph: fallbackIcon }
: {
url: dump.url,
accentColor: dump.richContent?.accentColor,
faviconUrl: dump.richContent?.faviconUrl,
siteName: dump.richContent?.siteName,
}}
/>
{embedUrl && (
<span className="rich-content-play-overlay" aria-hidden="true">