fix(workspace): 优化今日日报侧栏文本展示

This commit is contained in:
Script Generator
2026-06-26 15:10:44 +08:00
parent 17dd4afada
commit 952e13677c

View File

@@ -46,22 +46,26 @@ export function DailyReportPanel({ report }: Props) {
</div> </div>
) : ( ) : (
<div className="space-y-2"> <div className="space-y-2">
{report.items.map((item) => ( {report.items.map((item) => {
const contextLabel = [item.productName, item.projectName, item.versionName].filter(Boolean).join(' / ');
return (
<div key={item.id} className="rounded-lg border border-[var(--line)] bg-[var(--bg)] p-3"> <div key={item.id} className="rounded-lg border border-[var(--line)] bg-[var(--bg)] p-3">
<div className="flex items-start justify-between gap-2"> <div className="flex items-start justify-between gap-2">
<p className="min-w-0 flex-1 text-[12px] font-medium leading-5 text-[var(--ink)]">{item.workContent}</p> <p className="min-w-0 flex-1 break-words text-[12px] font-medium leading-5 text-[var(--ink)]">{item.workContent}</p>
<span className="shrink-0 rounded bg-[var(--accent-soft)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--accent)]"> <span className="shrink-0 rounded bg-[var(--accent-soft)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--accent)]">
{formatWorkHoursShort(item.hours)} {formatWorkHoursShort(item.hours)}
</span> </span>
</div> </div>
<p className="mt-2 truncate text-[11px] text-[var(--ink-soft)]">{item.taskTitle}</p> <p className="mt-2 truncate text-[11px] text-[var(--ink-soft)]" title={item.taskTitle}>{item.taskTitle}</p>
{(item.productName || item.projectName || item.versionName) && ( {contextLabel && (
<p className="mt-1 truncate text-[10px] text-[var(--ink-muted)]"> <p className="mt-1 truncate text-[10px] text-[var(--ink-muted)]" title={contextLabel}>
{[item.productName, item.projectName, item.versionName].filter(Boolean).join(' / ')} {contextLabel}
</p> </p>
)} )}
</div> </div>
))} );
})}
</div> </div>
)} )}
</div> </div>