Skip to content

feat: add indeterminate state to Checkbox and DataView select-all#1504

Draft
jeffredodd wants to merge 10 commits intomainfrom
feat/SDK-535-dataview-select-all-indeterminate
Draft

feat: add indeterminate state to Checkbox and DataView select-all#1504
jeffredodd wants to merge 10 commits intomainfrom
feat/SDK-535-dataview-select-all-indeterminate

Conversation

@jeffredodd
Copy link
Copy Markdown
Contributor

Summary

  • Adds isIndeterminate prop to the Checkbox component with proper DOM .indeterminate handling, visual styling, and accessibility support
  • Wires indeterminate state into DataTable and DataCards select-all header checkboxes via useSelectionState hook
  • Includes full test coverage for the indeterminate visual state and controlled toggle behavior

Extracted from #1489 for separate design review of the indeterminate checkbox visual. This PR targets the feat/SDK-535-dataview-select-all branch.

Test plan

  • Design reviews the indeterminate checkbox visual in Storybook
  • Verify indeterminate state displays correctly when some (but not all) rows are selected
  • Verify indeterminate state clears when all rows are selected or deselected

Made with Cursor

- Add isIndeterminate prop to Checkbox component with CSS :indeterminate styling
- Add onSelectAll callback prop to DataView/DataTable/useDataView
- Thread isItemSelected into DataTable to make row checkboxes controlled
- Render header checkbox in multiple selection mode with checked/indeterminate state
- Add table.selectAllRowsLabel i18n key
- Add DataViewSelectableCheckboxControlled Storybook story
- Fix indeterminate icon CSS positioning (position: relative on .checkbox)
- Fix row checkboxes to stay uncontrolled when isItemSelected is not provided

Made-with: Cursor
…ds select-all

- Fix Checkbox onChange not firing reliably by switching from onChange
  to onClick handler, deriving next state from value prop instead of
  native event.target.checked
- Replace CSS :checked/:indeterminate pseudo-selectors with class-based
  styling driven by React props to avoid DOM sync issues
- Add select-all checkbox to DataCards (mobile view) above the card list
- Explicitly forward onSelectAll through DataView to both DataTable and
  DataCards
- Convert Storybook stories to controlled state with working select-all
- Add paginated select-all story
- Add comprehensive tests for Checkbox indeterminate, controlled toggle,
  disabled click prevention, and DataCards select-all
- Add integration test for full select/deselect/indeterminate cycle

Made-with: Cursor
- Only render select-all header checkbox when isItemSelected is provided,
  preventing misleading UI in uncontrolled mode
- Memoize mergedRef with useCallback to avoid unnecessary ref churn
- Add disabled+indeterminate styling to match disabled+checked appearance

Made-with: Cursor
- Document Checkbox onChange click-based behavior for partner adapters
- Extract noop onChange to module-level constant to avoid re-creation
- Add data-checked/data-indeterminate attributes to Checkbox wrapper
  for stable test assertions independent of CSS module hashing
- Add index parameter to onSelect callback for reliable item identity
- Add visibleData parameter to onSelectAll to clarify pagination semantics
- Extract shared useSelectionState hook with single-pass memoized
  derivation, replacing duplicated every/some logic in DataTable/DataCards
- Add aria-label to DataCards list element for accessibility
- Add dev-mode console.warn when onSelect is used without isItemSelected
- Update all stories to use index param instead of fragile indexOf
- Update all test assertions for new callback signatures and data attrs

Made-with: Cursor
- Extract shared compensationColumns, useIndexSelection hook, and
  renderItemMenu in DataView stories to eliminate repeated code
- Extract baseProps, selectableProps, and renderCards/renderTable
  helpers in DataCards and DataTable tests
- Collapse single-line compensation data entries for density
- Net reduction of ~455 lines with identical test coverage

Made-with: Cursor
- Add index parameter to EmployeeTable onSelect test assertion
- Fix prettier formatting in DataTable test file

Made-with: Cursor
…view

Remove isIndeterminate prop, icon, styles, and related logic from
Checkbox, DataTable, DataCards, and useSelectionState. The indeterminate
visual state is preserved on a sibling branch for design review without
blocking the select-all feature from getting approved.

Made-with: Cursor
@jeffredodd jeffredodd force-pushed the feat/SDK-535-dataview-select-all branch 3 times, most recently from 46da8f2 to a027914 Compare April 8, 2026 21:35
Base automatically changed from feat/SDK-535-dataview-select-all to main April 8, 2026 21:36
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