Repository navigation
fix(id-web): isLightColor expands 3-digit shorthand hex (#846) - #848
Conversation
…alformed colors (#846)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Sweep verification (2026-10-25): nix flake check leg CANCELLED after 60m19s (started 06:16:53Z, completed 07:17:12Z) — the id-check.yml timeout-minutes:60 cap documented on #551, not a check failure. All other checks SUCCESS (run, treefmt, Nix flake evaluation, CodeRabbit). Verified the change locally on head 249c2ac: vitest run src/cursor-utils.test.ts — 76/76 PASS. Merging per standing directive (verify locally and merge when the flake leg is cap-cancelled). |
Fixes #846
isLightColor(pkgs/id/web/src/cursor-utils.ts) sliced the hex string at fixed 2-char offsets, so CSS 3-digit shorthand colors misaligned:#fffparsed as r=255, g=15, b=NaN, and theNaNluminance comparison silently classified every shorthand color as dark. Malformed input took the same accidentalNaNpath.Verified before the fix with the verbatim function in node:
isLightColor("#fff") === falseandisLightColor("#ff0") === false(both light; expectedtrue).Change:
falseexplicitly, instead of being decided by aNaNcomparison.Tests: 3 new cases in
cursor-utils.test.ts(shorthand expansion incl.#fff/#ff0/#000, shorthand-without-#equivalence, malformed inputs). Focused suite:vitest run src/cursor-utils.test.ts— 76/76 PASS.Need help on this PR? Tag
@codesmith-botwith what you need.