🧩 Background
components/dashboard/CommitClock.tsx computes a peakIndex (the day with the most commits) to render the dominant spoke. This logic is currently untested.
🎯 Objective
Extract findPeakIndex(data: CommitClockData[]): number and add unit tests.
📁 Files to touch
components/dashboard/CommitClock.tsx
components/dashboard/CommitClock.test.ts (new)
🛠️ Implementation steps
- Extract the helper.
- Test: single item, all equal (first wins), clear winner, all zeros.
✅ Definition of done
🧩 Background
components/dashboard/CommitClock.tsxcomputes apeakIndex(the day with the most commits) to render the dominant spoke. This logic is currently untested.🎯 Objective
Extract
findPeakIndex(data: CommitClockData[]): numberand add unit tests.📁 Files to touch
components/dashboard/CommitClock.tsxcomponents/dashboard/CommitClock.test.ts(new)🛠️ Implementation steps
✅ Definition of done