Skip to content

refinements proposal for #342#355

Merged
martin-mfg merged 3 commits into
stats-organization:fix-warningsfrom
marcalexiei:fix-warnings-2
Jul 12, 2026
Merged

refinements proposal for #342#355
martin-mfg merged 3 commits into
stats-organization:fix-warningsfrom
marcalexiei:fix-warnings-2

Conversation

@marcalexiei

@marcalexiei marcalexiei commented Jul 11, 2026

Copy link
Copy Markdown

fix(top-languages): default color when a language has no color

GitHub's Language.color is nullable, so a language can reach the card with color: null.

The compact, pie, donut, and donut-vertical layouts validated the raw color and threw on null,
turning a normal request into a "Something went wrong" error card (previously such languages rendered gray).

refactor(core): restructure color validation

Cleans up common/color.ts (no behavior change for valid inputs):

  • Split the isValidHexColor(x, numberSignPrefix) into isBareHexColor / isPrefixedHexColor.
  • Moved the hex regex to a module constant (was rebuilt on every call in render loops).
  • Gradient angle now validated with Number.isFinite (rejects Infinity)
  • Reworked color.test.ts for the two predicates + non-finite-angle cases.

@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

@marcalexiei is attempting to deploy a commit to the martin-mfg's projects Team on Vercel.

A member of the Team first needs to authorize it.

@marcalexiei marcalexiei changed the title fix(top-languages): default color when a language has no color refinements proposal for #342 Jul 11, 2026
@marcalexiei marcalexiei mentioned this pull request Jul 11, 2026
@martin-mfg

Copy link
Copy Markdown
Member

The compact, pie, donut, and donut-vertical layouts validated the raw color and threw on null,
turning a normal request into a "Something went wrong" error card (previously such languages rendered gray).

Good catch!

@martin-mfg martin-mfg merged commit 6d656a5 into stats-organization:fix-warnings Jul 12, 2026
0 of 2 checks passed
@marcalexiei marcalexiei deleted the fix-warnings-2 branch July 12, 2026 13:03
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.

2 participants