Repository navigation
DataTable: add selection checkboxes to collapsible groups - #8640
rickyzhangca wants to merge 6 commits into
Conversation
🦋 Changeset detectedLatest commit: fe57443 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
🤖 Lint issues have been automatically fixed and committed to this PR. |
There was a problem hiding this comment.
🟡 Changes recommended
Two tests target a primer/css checkbox in unchanged stories that still render strapi, causing both clicks to time out and preventing the tests from completing.
2 open issues
What changed in this PR
Adds group-level selection to Primer React’s collapsible DataTable groups, allowing users to select current-page members even while a group is collapsed.
Changes:
- Adds group checkboxes with mixed and disabled states, plus controlled selection props for
Table.Group. - Aligns group and row controls and updates the existing collapsible-groups story.
- Adds selection coverage and updates accessibility guidance, API documentation, and release notes.
| File | Description |
|---|---|
packages/react/src/DataTable/useTable.ts |
Computes group selection state and toggles selectable members. |
packages/react/src/DataTable/TableGroup.tsx |
Adds controlled group checkboxes and header structure. |
packages/react/src/DataTable/Table.module.css |
Aligns controls and labels and adjusts disclosure spacing. |
packages/react/src/DataTable/DataTable.tsx |
Connects group checkboxes to selection actions. |
packages/react/src/DataTable/DataTable.features.stories.tsx |
Updates the collapsible-groups example. |
packages/react/src/DataTable/DataTable.docs.json |
Documents group selection props and behavior. |
packages/react/src/DataTable/DataTable.accessibility.md |
Describes checkbox scope, states, and keyboard order. |
packages/react/src/DataTable/__tests__/DataTableGroupSelection.test.tsx |
Covers selection scope, disabled groups, and controlled updates. |
packages/react/src/DataTable/__tests__/DataTableExpansion.test.tsx |
Updates alignment checks across directions and densities. |
e2e/components/DataTable.test.ts |
Updates group-selection interactions and checkbox locators. |
.changeset/tidy-groups-select.md |
Records the feature as a minor release. |
Review effort: Balanced
| indeterminate={selection === 'some'} | ||
| disabled={selectionDisabled} | ||
| aria-label={`Select ${ariaLabel ?? label}`} | ||
| onChange={() => onToggleSelect?.()} |
There was a problem hiding this comment.
Could we require onToggleSelect when selection is set, or disable the checkbox when it is missing? The current optional callback allows an enabled Table.Group checkbox that never changes.
There was a problem hiding this comment.
great catch, fixed, checkbox disabled if callback missing 7bf15ca
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Integration test results from github/github-ui PR: |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Adds selection checkboxes to collapsible groups when
rowSelectionis enabled. Each checkbox selects the group's selectable rows on the current page, including collapsed members, and reflects mixed or disabled states.Context: row selection handoff.
Same data and viewport; before uses the current main implementation.
Changelog
selection,selectionDisabled, andonToggleSelectprops toTable.Group.Rollout strategy
Testing & Reviewing
update snapshotsworkflow.