[BUG] AI Mentor says "coded on 30 of the last 30 days" with a 1-day streak

Đang mở
#4,030 3 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@laypatel13 đang làm issue này rồi.

Từ ngày 3/12/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug needs-triage status:assigned
What happened?

The AI Mentor says "You coded on 30 of the last 30 days". Same dashboard: 1 day streak, 3/7 active days, longest streak ever 18 days. Can't code 30 days in a row with an 18 day best.

The trend is off too. It says ↓1%, but my commits are down 33 vs last week. The AI weekly summary repeats it.

Why: the commit data only has rows for days with commits. In src/lib/ai-mentor.ts:

  • analyzePatterns takes commits.slice(-30): the last 30 rows, not the last 30 days
  • computeTrends splits the rows in half, not the calendar

So anyone with 30+ coding days in the last 90 always gets "30 of 30". The tests never caught it because they give a row for every day, even days with 0 commits.

Expected: count calendar days, so the card matches the streak and active days cards. Compare the trend over two equal date windows.

Attached the failing test that reproduces it below.

Steps to reproduce
  1. Sign in with an account that has 30+ coding days in the last 90, with gaps in the last 30
  2. Open the dashboard (HQ)
  3. Compare the AI Mentor card with the Streak, Active days and Personal records cards
Where is it?

AI features (insights, personality, project tutor, career)

Where did you see it?

devtrack.live

Browser and device

Chrome on macOS

Screenshots, console errors or logs
Screenshot 2026-12-04 at 12 00 31 AM Screenshot 2026-12-04 at 12 00 50 AM Screenshot 2026-12-04 at 12 07 44 AM
Want to fix it?
  • I'd like to work on this. A maintainer will assign you; please don't start before that.
Ngôn ngữ chính
TypeScript
Star
246
Fork
436
Merge trung bình
9 giờ 33 phút
Pull request đã merge (30 ngày)
213

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Priyanshu-byte-coder/devtrack

Tất cả issue của Priyanshu-byte-coder/devtrack

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.