Skip to content

docs(core,driver,react): document the public API - #235

Merged
pbroom merged 4 commits into
mainfrom
docs/s0-jsdoc-and-surface
Oct 10, 2026
Merged

pbroom merged 4 commits into
mainfrom
docs/s0-jsdoc-and-surface

Conversation

@pbroom

@pbroom pbroom commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Slice S0 of the docs overhaul. The generated API pages need complete JSDoc, so this PR documents the whole public API and trims the public surface.

Commits

  • docs(core,driver,react): document the public API (d930462). Comments only, across 88 files; a comment-stripped comparison confirms no code changed. Every value export now has a JSDoc summary, and every function has an @example.
  • refactor(react,core)! (251e098). Removes BENCHMARK_SELECTED_COLOR_PLANE_RENDERER and COLOR_PLANE_{VERTEX,FRAGMENT}_SHADER_SOURCE from color-kit/react, which is a hard cut-over of internal constants. Also exports assertGamutTarget from the root, adds test-exports assertions, and includes a minor changeset.

Coverage (symbols with JSDoc)

256/513 → 510/510 deduplicated. Function @example: 82 → all.

Entry Value summaries Function examples
root 162/176 → 177/177 53/165 → 166/166
plane 29/41 → 41/41 0/37 → 37/37
compute 3/10 → 10/10 0/10 → 10/10
hct 2/3 → 3/3 0/3 → 3/3
driver 21/75 → 75/75 2/70 → 70/70
react 20/27 → 24/24 1/23 → 23/23
interop already complete already complete

Example accuracy

A harness ran all 149 example blocks against the built package: 199 // → results matched and none failed. The few that couldn't be run automatically were checked by hand. One wrong existing comment, in the mix example, is fixed.

Bundle sizes are identical before and after the JSDoc commit, and TypeDoc reports no warnings. All repo gates pass.

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

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
color-kit Ready Ready Preview Oct 10, 2026 8:06pm UTC

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 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-08T02:54:12.326356Z 251e098 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 8, 2026

@pbroom pbroom left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full incremental PR and its corrections at b5e0f78dc73e155bc4263f346393cd9cae6268e5. Public API documentation reviewed; gradient validation and workspace provider example corrected. No remaining actionable findings in the reviewed scope.

Independent correction re-reviews and stack preservation verification passed. At the integrated tip, lint, full build/DTS, 2,208 tests, formatting, strict agent checks and 14 built-site Chrome tests passed. All recorded actionable review threads are addressed. Hosted CI is being verified separately; this review does not authorize merge or release.

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, 8:02 PM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 10, 8:03 PM UTC: @pbroom merged this pull request with Graphite.

@pbroom
pbroom changed the base branch from chore/bump-control-kit-workspace to graphite-base/235 October 10, 2026 19:58
@pbroom
pbroom changed the base branch from graphite-base/235 to main October 10, 2026 20:00
pbroom and others added 4 commits October 10, 2026 20:01
Add JSDoc summaries to every value export across the color-kit facade
entry points (root, plane, interop, compute, hct, driver, react) and a
runnable @example on every exported function, component and hook, with
// → results computed against the built package. Document user-facing
option and result fields with @DefaultValue, and add @throws and @see
where they apply. Normalise @default to @DefaultValue.

Comments only; no code changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ace and export assertGamutTarget from the root

Drop BENCHMARK_SELECTED_COLOR_PLANE_RENDERER, COLOR_PLANE_VERTEX_SHADER_SOURCE
and COLOR_PLANE_FRAGMENT_SHADER_SOURCE from the color-kit/react barrel; they
stay internal to ColorPlane. Export assertGamutTarget from the core root in
addition to color-kit/plane. The facade export test now asserts both.

BREAKING CHANGE: color-kit/react no longer exports the three ColorPlane
internals.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@pbroom
pbroom force-pushed the docs/s0-jsdoc-and-surface branch from 92d5ace to 8e0e8de Compare October 10, 2026 20:01
@pbroom
pbroom merged commit 230cc1c into main Oct 10, 2026
6 of 7 checks passed
@pbroom
pbroom deleted the docs/s0-jsdoc-and-surface branch October 10, 2026 20:03
pbroom added a commit that referenced this pull request Oct 10, 2026
…237)

Validate the active gamut with core's assertGamutTarget in
createColorState, setColorActiveGamut, createMultiColorModel,
setMultiColorActiveGamut and getColorDisplayStyles, so 'p3' throws the
same TypeError as the core plane queries instead of rendering sRGB.
The reducers also reject a missing gamut.

sampleSliderGradient now throws a RangeError for steps below 2, and the
multi-color entry builders throw a TypeError for colors that are neither
strings nor objects instead of storing an empty color.



Found while documenting the public API in #235. Each finding was reproduced against the built package before the fix, has a regression test, and its affected JSDoc examples were recomputed. lint, build, test, format:check, typecheck, size, check:artifacts, check:preprod and agents:check:strict pass.

Part of the color-kit assessment stack.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
pbroom added a commit that referenced this pull request Oct 10, 2026
…#238)

saturate/desaturate clamped chroma to [0, 0.4], so wide-gamut colors
above 0.4 lost chroma (saturate lowered it, desaturate(c, 0) changed
it). Chroma is now only clamped below at 0, like lighten/darken clamp
lightness to its domain; 0.4 stays as the saturate step span.

planeHue returned the model's own hue on HSL, HSV and HCT planes, but
its callers (gamut boundary, contrast and chroma-band queries and their
result hue) expect an OKLCH hue. It now converts the fixed color, and
falls back to the model hue's most saturated color when that fixed color
is achromatic.



Found while documenting the public API in #235. Each finding was reproduced against the built package before the fix, has a regression test, and its affected JSDoc examples were recomputed. lint, build, test, format:check, typecheck, size, check:artifacts, check:preprod and agents:check:strict pass.

Part of the color-kit assessment stack.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
pbroom added a commit that referenced this pull request Oct 10, 2026
…tep precision (#239)

parseColorInputExpression evaluated each absolute % as a span fraction
and added range[0] once to the whole result, so on an offset range any
expression that multiplied or combined percents was wrong ('50% * 2' on
[100, 200] gave 200). Every absolute % is now a position in the range,
like a lone '50%'; relative input keeps span fractions.

getColorInputPrecisionFromStep used an absolute rounding tolerance, so
steps below 1e-7 looked like whole numbers and returned 0. The tolerance
is now relative to the step, and such steps return the 6-decimal cap.



Found while documenting the public API in #235. Each finding was reproduced against the built package before the fix, has a regression test, and its affected JSDoc examples were recomputed. lint, build, test, format:check, typecheck, size, check:artifacts, check:preprod and agents:check:strict pass.

Part of the color-kit assessment stack.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
pbroom added a commit that referenced this pull request Oct 10, 2026
ColorInput and ColorStringInput spread the rest props (including
aria-label) onto the wrapper div and also set aria-label on the inner
input, so a consumer label was rendered twice. aria-label and
aria-labelledby are now taken out of the rest props and applied only to
the inner input; a consumer label replaces the default, and
aria-labelledby alone suppresses the default aria-label.



Found while documenting the public API in #235. Each finding was reproduced against the built package before the fix, has a regression test, and its affected JSDoc examples were recomputed. lint, build, test, format:check, typecheck, size, check:artifacts, check:preprod and agents:check:strict pass.

Part of the color-kit assessment stack.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
pbroom added a commit that referenced this pull request Oct 10, 2026
… PlaneWithSense (#241)

The gamut-boundary, chroma-band and gradient query specs budgeted
`steps ?? 48`, but their solvers default to 100, 12 and 16 samples, and
adaptive sampling ignores steps. Budgets now use the shared solver
defaults and estimate adaptive paths from adaptiveTolerance and
adaptiveMaxDepth (calibrated against traced point counts).

PlaneWithSense was exported but nothing produced it (sense() returns
PlaneSense), so it is removed from the core and plane barrels.

BREAKING CHANGE: the PlaneWithSense type is removed; use
Plane & PlaneSense.



Found while documenting the public API in #235. Each finding was reproduced against the built package before the fix, has a regression test, and its affected JSDoc examples were recomputed. lint, build, test, format:check, typecheck, size, check:artifacts, check:preprod and agents:check:strict pass.

Part of the color-kit assessment stack.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

This branch was successfully deployed

1 active deployment
Preview — 8e0e8de1 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