fix: v0.14.2 修复长提示词标签被挤出可视区域
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m16s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m16s
- 截断计算时预留mention标签的额外渲染宽度(每个约24px),防止标签被overflow:hidden裁掉 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
973a4f049d
commit
b25d1f3e8c
@ -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')!;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user