From 6dd4d70f08892aa36047f1984e52bdc0a90a8a71 Mon Sep 17 00:00:00 2001 From: pphua Date: Tue, 25 Aug 2026 00:29:12 +0800 Subject: [PATCH] fix(ui): handle empty worker asset labels --- .../(main)/function/tasks/detail/_tabs/sessions-tab.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx b/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx index 2e313bf..bf8eea9 100644 --- a/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx +++ b/web/src/app/(main)/function/tasks/detail/_tabs/sessions-tab.tsx @@ -443,11 +443,12 @@ function WorkerAssetBadge({ assets }: { assets: IntentAsset[] }) { if (displayAssets.length === 0) return null; const first = displayAssets[0]; - const firstLabel = truncateWorkerAssetLabel(first.label || `#${first.asset_id}`); + const firstRawLabel = first.label.trim() || `#${first.asset_id}`; + const firstLabel = truncateWorkerAssetLabel(firstRawLabel); return ( - + 当前资产:{firstLabel} {displayAssets.length > 1 && +{displayAssets.length - 1}} @@ -456,7 +457,7 @@ function WorkerAssetBadge({ assets }: { assets: IntentAsset[] }) {
{displayAssets.map((asset) => (
-
{asset.label || `#${asset.asset_id}`}
+
{asset.label.trim() || `#${asset.asset_id}`}
{taskAssetTypeLabel(asset.type)} · {taskAssetSourceLabel(asset.source)} {asset.inherited ? ` · 来源任务 #${asset.source_task_id}` : ""}