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:
copilot-swe-agent[bot] 2026-03-15 01:56:01 +00:00
parent 77599c4082
commit 345c71b6ea
2 changed files with 4 additions and 3 deletions

View File

@ -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}

View File

@ -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,
};
}