From 0e2a9a9c0ce0e2da63535210c553b3ae2f79b239 Mon Sep 17 00:00:00 2001 From: boojack Date: Tue, 2 Jun 2026 23:08:16 +0800 Subject: [PATCH] fix(web): render video attachment posters on mobile --- .../AttachmentLibrary/AttachmentFileRows.tsx | 3 +- .../AttachmentLibrary/AttachmentMediaGrid.tsx | 8 +- .../Attachment/AttachmentListView.tsx | 5 +- web/src/components/VideoPoster.tsx | 82 +++++++++++++++++++ web/tests/video-poster.test.tsx | 47 +++++++++++ 5 files changed, 141 insertions(+), 4 deletions(-) create mode 100644 web/src/components/VideoPoster.tsx create mode 100644 web/tests/video-poster.test.tsx diff --git a/web/src/components/AttachmentLibrary/AttachmentFileRows.tsx b/web/src/components/AttachmentLibrary/AttachmentFileRows.tsx index cfa64d02..ef80a3b0 100644 --- a/web/src/components/AttachmentLibrary/AttachmentFileRows.tsx +++ b/web/src/components/AttachmentLibrary/AttachmentFileRows.tsx @@ -1,5 +1,6 @@ import { FileAudioIcon, FileIcon, PlayIcon } from "lucide-react"; import AudioAttachmentItem from "@/components/MemoMetadata/Attachment/AudioAttachmentItem"; +import VideoPoster from "@/components/VideoPoster"; import type { AttachmentLibraryListItem } from "@/hooks/useAttachmentLibrary"; import { cn } from "@/lib/utils"; import { getAttachmentThumbnailUrl, getAttachmentType, isMotionAttachment } from "@/utils/attachment"; @@ -26,7 +27,7 @@ const AttachmentThumb = ({ item, className }: { item: AttachmentLibraryListItem; if (type === "video/*") { return (
-