Skip to content

Rename SelectCheckbox's value prop to checked - #4259

Merged
nstepien merged 2 commits into
mainfrom
breaking/select-checkbox-checked
Oct 29, 2026
Merged

nstepien merged 2 commits into
mainfrom
breaking/select-checkbox-checked

Conversation

@nstepien

Copy link
Copy Markdown
Collaborator

SelectCheckbox now takes a checked prop instead of value, so its props are the same as RenderCheckboxProps, with checked required. Every other checkbox API in the package (RenderCheckboxProps, renderCheckbox, and the native <input type="checkbox">) already says checked, and the README no longer has to explain the exception.

Breaking change

- <SelectCheckbox value={row.available} onChange={…} />
+ <SelectCheckbox checked={row.available} onChange={…} />

Affects custom cell renderers that render SelectCheckbox. Its props are now RenderCheckboxProps with checked required.

Changes

  • SelectCheckboxProps extends RenderCheckboxProps and narrows checked to a required boolean. It replaces the Pick<RenderCheckboxProps, …>-based SharedInputProps, and is now exported, so it's part of the public types.
  • SelectCheckbox passes its props object straight to renderCheckbox instead of rebuilding it property by property; it isn't a hot path that needs a fixed shape.
  • Updated the select column's cells in src/Columns.tsx, the "Available" column of the CommonFeatures demo, and the <SelectCheckbox /> section of the README.

Verification

vp run ci passes, except that Firefox timed out under load from other Playwright sessions on the machine (clicks in setupBrowser.ts's beforeEach focus loop). I reran the 23 Firefox files that failed with vp test … --project "*firefox*", and they all passed. The Chromium, WebKit, and Node projects passed in separate runs.

  • Added a test in test/browser/renderers.test.tsx that renders <SelectCheckbox checked={…} onChange={…} /> in a column's renderCell, and checks the checked states and that clicking toggles them.
  • Built the package with vp pack and type-checked a consumer of lib/index.js with tsc --strict, with and without --exactOptionalPropertyTypes: checked is required, and value is rejected.

🤖 Generated with Claude Code

@codecov-commenter

codecov-commenter commented Oct 27, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.27%. Comparing base (be16443) to head (afa8afb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4259      +/-   ##
==========================================
- Coverage   99.27%   99.27%   -0.01%     
==========================================
  Files          44       44              
  Lines        2213     2204       -9     
  Branches      971      965       -6     
==========================================
- Hits         2197     2188       -9     
  Misses         16       16              
Files with missing lines Coverage Δ
src/Columns.tsx 100.00% <100.00%> (ø)
src/cellRenderers/SelectCheckbox.tsx 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nstepien
nstepien marked this pull request as ready for review October 29, 2026 03:10
@nstepien
nstepien merged commit 5e7977b into main Oct 29, 2026
5 checks passed
@nstepien
nstepien deleted the breaking/select-checkbox-checked branch October 29, 2026 03:12
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