Student table select all fix#8037
Open
danielrafailov1 wants to merge 6 commits into
Open
Conversation
Collaborator
Coverage Report for CI Build 28626397201Coverage increased (+0.001%) to 90.252%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
david-yz-liu
reviewed
Jul 1, 2026
| - Added support for all annotation types for POST /add_annotations (#8007) | ||
|
|
||
| ### 🐛 Bug fixes | ||
| - Fixed broken checkbox in the header of SelectionColumn for tables with row selection enabled. |
Collaborator
There was a problem hiding this comment.
"SelectionColumn" sounds like an identifier name from the codebase, but it doesn't actually exist (though selectionColumn does).
Since this is a user-facing UI change, I would use the plain language "selection column" instead
| isSorted={header.column.getIsSorted()} | ||
| isResizing={header.column.getIsResizing()} | ||
| allRowsSelected={ | ||
| header.column.id === "select" ? table.getIsAllRowsSelected() : undefined |
Collaborator
There was a problem hiding this comment.
Since we're now using the string "select" in multiple places, please pull it out into a constant.
| }); | ||
| }); | ||
|
|
||
| describe("filling and unfilling of the select column checkboxes", () => { |
Collaborator
There was a problem hiding this comment.
please reword to "checks and unchecks" (throughout)
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.
Proposed Changes
The Problem
There was a bug in the student table where if you tried selecting the checkbox in the select column header it would select all of the rows but the select column header checkbox itself wouldn't be checked. Moreover, checking it again after selection had no effect.
*The Cause
The TableHeaderCell component that is being used by the Table component to create table headers was being memoized, but there was no prop being changed to trigger a re-render on select of the checkbox.
The Fix
I passed a new prop, allRowsSelected, to TableHeaderCell for the select column. Its value comes from table.getIsAllRowsSelected() and changes when selection changes, which forces a re-render so the header checkbox updates correctly.
Tests
I added two Jest tests in table.test.jsx since this bug affects any table with row selection enabled:
Screenshots of your changes (if applicable)
Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)