fix: improve row selection handling and clean up code, fixes: #1504#1505
Open
kevenleone wants to merge 2 commits into
Open
fix: improve row selection handling and clean up code, fixes: #1504#1505kevenleone wants to merge 2 commits into
kevenleone wants to merge 2 commits into
Conversation
The __ps_select column rendered empty cells with no visual state indicator. Render CheckboxTable inside header and cell with pointer-events-none so selection stays handled by DataGrid mousedown handlers.
sorenbs
requested changes
Jul 18, 2026
sorenbs
left a comment
Member
There was a problem hiding this comment.
Hi @kevenleone β thanks a lot for tackling this, and for the clear demo video! Restoring the checkboxes as presentation-only elements (pointer-events-none) while keeping all pointer handling in DataGrid is exactly the right architecture, and the toggle-on-click behavior also addresses the "can't unselect" complaint from #1488. A few changes needed before we can merge:
- Drag-select still overwrites multi-selection.
selectRowsInRangereplaces the entire selection, so after checking rows 1 and 3, click-dragging rows 6β8 silently drops 1 and 3 β the same "overwritten" symptom from #1504, just via the drag path. Could you make range-drag merge into the existing selection (or clear the drag anchor when a click toggles a row off)? Related: clicking a selected row deselects it but still arms the drag ref, so a tiny mouse movement re-selects it. - Reuse the existing components.
ui/studio/cell/SelectHeaderCell.tsxandSelectRowCell.tsxalready exist (currently unused) and are almost exactly the JSX you added inline in three places β please adapt/reuse them (or delete them) rather than duplicating. - Indeterminate header state. With a partial selection the header checkbox looks unchecked β
table.getIsSomeRowsSelected() ? "indeterminate" : falsewould be clearer. - Lint. The two re-formatting hunks in
DataGrid.tsxfail the repo's pinned prettier (looks like an editor prettier-version mismatch) β please drop them. There's also a newexhaustive-depswarning:selectSingleRowModeis still used in the right-click branch but was removed from the deps array. And with plain click now toggling, the Shift+click branch is identical code β worth unifying. - Regression test + changeset. Per repo convention, bugfixes need a test that reproduces the bug (checkboxes render / additive selection would be great additions to
DataGrid.interactions.test.tsx) and a.changeset/*.mdentry so the fix ships in a release.
Happy to re-review once these are in β the core approach is solid and this will be a nice usability win. Thanks again!
This was referenced Jul 18, 2026
Author
|
Thanks @sorenbs for your review, working on the changes |
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.
Fixes: #1504
Screen.Recording.2026-05-02.at.23.35.36.mov