Skip to content

Add table range selection feature#1837

Open
paustint wants to merge 1 commit into
mainfrom
feat/add-table-range-checkbox-toggle
Open

Add table range selection feature#1837
paustint wants to merge 1 commit into
mainfrom
feat/add-table-range-checkbox-toggle

Conversation

@paustint

Copy link
Copy Markdown
Contributor

Introduce a shift-click range selection capability for table rows, allowing users to select multiple rows at once. This feature includes the necessary state management and updates to the row selection logic. The implementation ensures that the last toggled row serves as an anchor for the selection range.

@paustint paustint marked this pull request as ready for review July 1, 2026 14:47
Copilot AI review requested due to automatic review settings July 1, 2026 14:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Shift-click range selection for data-table row checkboxes by introducing a shared “anchor row” (last non-shift toggle) and a helper that applies selection across the visible row model range.

Changes:

  • Added a selectRowRange() helper to apply selection/unselection across a contiguous visible row range.
  • Introduced a shared row-selection “anchor” via GridRuntimeContext, backed by a stable ref in GridContainer.
  • Updated checkbox selection handling and keyboard navigation to avoid conflicting Shift behaviors in the select column.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
libs/ui/src/lib/data-table/grid/renderers/CellRenderers.tsx Implements Shift-click range selection behavior in the select-row checkbox renderer.
libs/ui/src/lib/data-table/grid/keyboard/useGridKeyboardNavigation.ts Prevents Shift-click in the select column from extending rectangular cell selection.
libs/ui/src/lib/data-table/grid/grid-row-utils.ts Adds selectRowRange() utility to update selection across a row id range.
libs/ui/src/lib/data-table/grid/grid-context.tsx Extends grid runtime context with optional row-selection anchor getter/setter.
libs/ui/src/lib/data-table/grid/components/GridContainer.tsx Stores the selection anchor in a ref and exposes stable getter/setter via runtime context.
libs/ui/src/lib/data-table/grid/tests/grid-row-utils.spec.ts Adds unit tests covering selectRowRange() behavior (forward/backward, grouped rows, non-selectable rows, missing ids).

Comment thread libs/ui/src/lib/data-table/grid/renderers/CellRenderers.tsx
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