Skip to content

fix(generator): prevent month labels from overlapping on partial first weeks - #2

Merged
m3hrab merged 1 commit into
mainfrom
fix/months-label-overlap
Sep 8, 2026
Merged

m3hrab merged 1 commit into
mainfrom
fix/months-label-overlap

Conversation

@m3hrab

@m3hrab m3hrab commented Sep 8, 2026

Copy link
Copy Markdown
Owner

GitHub's contribution calendar almost always starts on a partial week,
which could flag two "month changed" events one column (12px) apart
not enough room for two 3-letter labels, so they rendered stacked on
top of each other.

Enforce a minimum 36px gap between rendered labels; a month change
that's too close to the previous label is skipped rather than drawn,
and picked up cleanly at the next real boundary.

Verified against the worst case (a mid-week start date straddling a
month boundary) — extracted label x-coordinates confirm >=36px spacing
in all cases.

…t weeks

GitHub's contribution calendar almost always starts on a partial week,
which could flag two 'month changed' events one column (12px) apart —
not enough room for two 3-letter labels, so they rendered stacked on
top of each other.

Enforce a minimum 36px gap between rendered labels; a month change
that's too close to the previous label is skipped rather than drawn,
and picked up cleanly at the next real boundary.

Verified against the worst case (a mid-week start date straddling a
month boundary) — extracted label x-coordinates confirm >=36px spacing
in all cases.
@m3hrab m3hrab self-assigned this Sep 8, 2026
@m3hrab
m3hrab merged commit 8870587 into main Sep 8, 2026
3 checks passed
@m3hrab
m3hrab deleted the fix/months-label-overlap branch September 8, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant