diff --git a/src/ui/Workload.tsx b/src/ui/Workload.tsx index cf264aa..c1bd6d7 100644 --- a/src/ui/Workload.tsx +++ b/src/ui/Workload.tsx @@ -7,7 +7,11 @@ export function Workload({state,groups,today}:Props){ const {rows,peak,week,nextWeek}=buildWorkload(groups,today); if(!rows.some(r=>r.load>0))return null; const label=(day:string)=>new Intl.DateTimeFormat(locale,{month:'short',day:'numeric',weekday:'short',timeZone:'UTC'}).format(new Date(day+'T12:00:00Z')); - const hint=(r:typeof rows[number])=>zh?`${label(r.day)}:${r.tasks} 项截止,${r.exams} 场考试`:`${label(r.day)}: ${r.tasks} due, ${r.exams} exam${r.exams===1?'':'s'}`; + const entriesByDay=new Map(groups.map(g=>[g.day,g.entries])); + const hint=(r:typeof rows[number])=>{ + const summary=zh?`${label(r.day)}:${r.tasks} 项截止,${r.exams} 场考试`:`${label(r.day)}: ${r.tasks} due, ${r.exams} exam${r.exams===1?'':'s'}`; + return [summary,...(entriesByDay.get(r.day)||[]).map(e=>[e.course,e.title].filter(Boolean).join(' · '))].join('\n'); + }; return

{zh?'工作量':'WORKLOAD'}

{zh?'未来两周':'Next two weeks'}

{zh?`本周 ${week} 项 · 下周 ${nextWeek} 项`:`This week ${week} · next week ${nextWeek}`}

{rows.map(r=>
{Number(r.day.slice(8))}
)}