From b25d1f3e8c5c2243d405bdd0e13b70fcbe3d5eb5 Mon Sep 17 00:00:00 2001 From: seaislee1209 Date: Sun, 29 Mar 2026 02:55:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20v0.14.2=20=E4=BF=AE=E5=A4=8D=E9=95=BF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=8D=E6=A0=87=E7=AD=BE=E8=A2=AB=E6=8C=A4?= =?UTF-8?q?=E5=87=BA=E5=8F=AF=E8=A7=86=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 截断计算时预留mention标签的额外渲染宽度(每个约24px),防止标签被overflow:hidden裁掉 Co-Authored-By: Claude Opus 4.6 (1M context) --- web/src/components/GenerationCard.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/components/GenerationCard.tsx b/web/src/components/GenerationCard.tsx index 8d16575..d618817 100644 --- a/web/src/components/GenerationCard.tsx +++ b/web/src/components/GenerationCard.tsx @@ -173,7 +173,10 @@ export function GenerationCard({ task, onOpenDetail }: Props) { const style = getComputedStyle(container); const font = `${style.fontSize} ${style.fontFamily}`; const labelsWidth = labelsEl.offsetWidth + 8; - const totalAvailable = containerWidth * 2 - labelsWidth - 24; + // Account for mention tags (thumbnails) taking extra width vs plain text + const mentionCount = (task.assetMentions?.length || 0) + (task.references?.length || 0); + const mentionExtraWidth = mentionCount * 24; // ~24px extra per mention (thumbnail + padding) + const totalAvailable = containerWidth * 2 - labelsWidth - 24 - mentionExtraWidth; const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d')!;