Skip to content

fix(driver): validate the gamut in getColorAreaFallbackPoint - #230

Merged
pbroom merged 2 commits into
mainfrom
fix/driver-fallback-gamut-validation
Oct 10, 2026
Merged

pbroom merged 2 commits into
mainfrom
fix/driver-fallback-gamut-validation

Conversation

@pbroom

@pbroom pbroom commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

getColorAreaFallbackPoint silently mapped any unknown gamut, such as the
removed 'p3' spelling, to sRGB while every core entry point throws. It now
calls core's assertGamutTarget, so the TypeError wording is identical and
ends "'p3' is not supported; use 'display-p3'".

Validator placement: routing through the core plane fallbackPoint query
would change behaviour (it forces a finite hue and returns unclamped plane
coordinates, while the driver returns clamped, y-flipped UI coordinates
for any axes). The repo has no ./gamut subpath, and adding one would
widen the package export map, tsup entries and facade. assertGamutTarget
is therefore exported from the existing ./plane subpath, which already
owns the gamut-taking queries, and not from the root barrel.

lint, build, test, format:check, typecheck, size, check:artifacts, check:preprod and agents:check:strict all pass on this branch.

Part of the color-kit assessment stack (#204 → #232).

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T21:29:21.529878Z bdef093 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This was referenced Oct 7, 2026
@pbroom
pbroom changed the base branch from feat/preserve-hue-on-achromatic-input to graphite-base/230 October 8, 2026 15:25
@pbroom
pbroom force-pushed the fix/driver-fallback-gamut-validation branch from d82d0c2 to 2858bfe Compare October 8, 2026 17:04
@pbroom
pbroom changed the base branch from graphite-base/230 to feat/preserve-hue-on-achromatic-input October 8, 2026 17:04

pbroom commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner Author

Merge activity

  • Oct 10, 6:47 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 10, 7:52 PM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 10, 7:53 PM UTC: @pbroom merged this pull request with Graphite.

@pbroom
pbroom changed the base branch from feat/preserve-hue-on-achromatic-input to graphite-base/230 October 10, 2026 19:48
@pbroom
pbroom changed the base branch from graphite-base/230 to main October 10, 2026 19:50
pbroom and others added 2 commits October 10, 2026 19:51
getColorAreaFallbackPoint silently mapped any unknown gamut, such as the
removed 'p3' spelling, to sRGB while every core entry point throws. It now
calls core's assertGamutTarget, so the TypeError wording is identical and
ends "'p3' is not supported; use 'display-p3'".

Validator placement: routing through the core plane fallbackPoint query
would change behaviour (it forces a finite hue and returns unclamped plane
coordinates, while the driver returns clamped, y-flipped UI coordinates
for any axes). The repo has no `./gamut` subpath, and adding one would
widen the package export map, tsup entries and facade. assertGamutTarget
is therefore exported from the existing `./plane` subpath, which already
owns the gamut-taking queries, and not from the root barrel.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
assertGamutTarget treats undefined as an omitted optional gamut, so a
JavaScript caller that left out query.gamut got an sRGB mapping back with
gamut: undefined. The fallback point's gamut is required: throw a TypeError
instead, as the @throws note now says.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@pbroom
pbroom force-pushed the fix/driver-fallback-gamut-validation branch from bac18cc to 902b3dd Compare October 10, 2026 19:51
@pbroom
pbroom merged commit 2fe8b4e into main Oct 10, 2026
4 of 7 checks passed
@pbroom
pbroom deleted the fix/driver-fallback-gamut-validation branch October 10, 2026 19:53

This branch was successfully deployed

1 active deployment
Preview — 902b3ddf Deployed Oct 10, 2026 by vercel[bot]
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