fix: address code review feedback - topStreak edge case, remove unused var
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
parent
77599c4082
commit
345c71b6ea
|
|
@ -179,7 +179,6 @@ function generateReport(devStatus, activity) {
|
|||
// 项目概览
|
||||
const activeDevs = team.filter(d => d.status !== 'paused').length;
|
||||
const summary = devStatus.summary || {};
|
||||
const graduatedCount = summary.graduated_modules?.length || 0;
|
||||
|
||||
const report = `# 🌊 光湖开发日报 · ${dateStr}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,9 @@ function mapNotionStatus(status) {
|
|||
function generateSummary(team) {
|
||||
const activeCount = team.filter(d => d.status === 'active').length;
|
||||
const waitingSyslog = team.filter(d => d.status === 'waiting_syslog').length;
|
||||
const topStreak = team.reduce((max, d) => d.streak > max.streak ? d : max, { streak: 0 });
|
||||
const topStreakDev = team.length > 0
|
||||
? team.reduce((max, d) => d.streak > max.streak ? d : max, team[0])
|
||||
: null;
|
||||
const alerts = team
|
||||
.filter(d => d.waiting && d.waiting.includes('⚠️'))
|
||||
.map(d => `${d.dev_id} ${d.name}: ${d.waiting}`);
|
||||
|
|
@ -142,7 +144,7 @@ function generateSummary(team) {
|
|||
total_devs: team.length,
|
||||
active_waiting_syslog: waitingSyslog,
|
||||
active_normal: activeCount,
|
||||
top_streak: topStreak.dev_id ? `${topStreak.dev_id} ${topStreak.name} ${topStreak.streak}连胜` : '无',
|
||||
top_streak: topStreakDev ? `${topStreakDev.dev_id} ${topStreakDev.name} ${topStreakDev.streak}连胜` : '无',
|
||||
alerts,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue