From b848ce5db3677641851005100e936c2c919dee40 Mon Sep 17 00:00:00 2001 From: TerryM Date: Sat, 30 May 2026 02:26:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=202=E5=9B=BE=E7=9B=B8=E5=86=8C=E6=8C=89?= =?UTF-8?q?=E7=9C=9F=E5=AE=9E=E6=AF=94=E4=BE=8B+=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E8=B4=B4=E5=90=88,=E7=AB=96=E5=9B=BE=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E8=A2=AB=E8=A3=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - albumLayout: 2 图不再 clamp 比例,格子按图片真实比例,避免下限 0.55 把竖图 当矮图导致裁顶;3+ 张马赛克仍 clamp 保持整齐 - AlbumBubble: 2 图改用 object-contain,整图缩放贴合框内,永不裁剪;高度上限 不变,不占用过多空间 Co-Authored-By: Claude Opus 4.8 (1M context) --- src/components/messageStream/bubbles/AlbumBubble.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/messageStream/bubbles/AlbumBubble.tsx b/src/components/messageStream/bubbles/AlbumBubble.tsx index 6720d05..d50074e 100644 --- a/src/components/messageStream/bubbles/AlbumBubble.tsx +++ b/src/components/messageStream/bubbles/AlbumBubble.tsx @@ -26,6 +26,12 @@ export function AlbumBubble({ post }: { post: Post }) { const ratios = useImageRatios(visible, sources); const layout = computeAlbumLayout(ratios); + // Two-image albums scale each image to fit its cell (object-contain) so a + // tall poster is never cropped — the cell already matches the image ratio, so + // there are no bars except on very wide screens where the height is capped. + // 3+ images keep object-cover to stay a tidy mosaic. + const imgFit = visible.length === 2 ? "object-contain" : "object-cover"; + return (
{/* aspect-ratio sets a definite box height; tiles are absolutely @@ -67,7 +73,7 @@ export function AlbumBubble({ post }: { post: Post }) { src={sources[i]} fallbackSrc={[att.thumbUrl, att.url]} loading="lazy" - className="h-full w-full object-cover transition duration-300 group-hover:scale-[1.03]" + className={`h-full w-full ${imgFit} transition duration-300 group-hover:scale-[1.03]`} /> {isLastSlot ? (