feat: add indeterminate state to Checkbox and DataView select-all#1504
Draft
jeffredodd wants to merge 10 commits intomainfrom
Draft
feat: add indeterminate state to Checkbox and DataView select-all#1504jeffredodd wants to merge 10 commits intomainfrom
jeffredodd wants to merge 10 commits intomainfrom
Conversation
- 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
Made-with: Cursor
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
…esign review" This reverts commit 509b75d.
46da8f2 to
a027914
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isIndeterminateprop to the Checkbox component with proper DOM.indeterminatehandling, visual styling, and accessibility supportuseSelectionStatehookExtracted from #1489 for separate design review of the indeterminate checkbox visual. This PR targets the
feat/SDK-535-dataview-select-allbranch.Test plan
Made with Cursor