mirror of
https://github.com/tiennm99/ghglance.git
synced 2026-10-11 03:13:20 +00:00
* feat(card): configurable start of week for heatmap + weekday cards New -start-of-week CLI flag (and start_of_week action input) rotates the contribution-heatmap rows and the productive-weekday bars so users whose calendars start on Monday (or any other day) get matching output. Default stays Sunday to preserve existing renders. * docs: note start-of-week in design-guidelines, codebase-summary, deployment-guide - design-guidelines: heatmap row order + productive-weekday bar order now derive from Profile.WeekStart - codebase-summary: list new weekday_start_test.go cases + TestParseWeekday - deployment-guide: mention start_of_week as an optional action input in the workflow template
1.4 KiB
1.4 KiB
Configurable start-of-week
Goal
Let users pick which weekday the contribution heatmap rows and productive-weekday bars start on. Default stays Sunday for back-compat with GitHub's own calendar.
Surface
- CLI:
-start-of-week sunday|monday(defaultsunday) - Action input:
start_of_week(defaultsunday) - Accept case-insensitive full name; anything else → warn and fall back to Sunday (mirrors existing
-tzbehaviour)
Scope intentionally limited to Sun/Mon — the two real-world cases. Re-open if someone asks for Tue/Wed/etc.
Code touchpoints
| File | Change |
|---|---|
main.go |
parse -start-of-week, set Profile.WeekStart |
internal/github/model.go |
add WeekStart time.Weekday |
internal/card/contributions_heatmap.go |
rotate padToWeekGrid offset + weekday labels using WeekStart |
internal/card/productive_weekday.go |
reorder bars and labels using WeekStart |
action.yml + entrypoint.sh |
new input plumbed through |
README.md |
document |
| tests | weekday parse + rotation grid |
Streak card is count-based — untouched.
Phases
- Wire flag + profile field + action plumbing
- Heatmap rotation
- Weekday rotation
- Tests
- README
Success
go build ./...cleango test ./...passes (existing + new)- Running with
-start-of-week mondayvisibly rotates row 0 of the heatmap to Mon and moves Sun to row 6 - Default behaviour (no flag) identical to current output