Skip to content

Student table select all fix#8037

Open
danielrafailov1 wants to merge 6 commits into
MarkUsProject:masterfrom
danielrafailov1:student-table-select-all-fix
Open

Student table select all fix#8037
danielrafailov1 wants to merge 6 commits into
MarkUsProject:masterfrom
danielrafailov1:student-table-select-all-fix

Conversation

@danielrafailov1

@danielrafailov1 danielrafailov1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

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:

  1. Clicking the select-all checkbox checks the header checkbox and all row checkboxes.
  2. Clicking it again unchecks the header checkbox and all row checkboxes.
Screenshots of your changes (if applicable) Screenshot 2026-07-01 at 12 43 11 PM

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue) X
🎨 User interface change (change to user interface; provide screenshots)
♻️ Refactoring (internal change to codebase, without changing functionality)
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
📖 Documentation update (change that updates documentation)
🔧 Internal (change that only affects developers or continuous integration)

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:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have updated the project Changelog (this is required for all changes).
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

(Include any questions or comments you have regarding your changes.)

@coveralls

coveralls commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28626397201

Coverage increased (+0.001%) to 90.252%

Details

  • Coverage increased (+0.001%) from the base build.
  • Patch coverage: 3 of 3 lines across 2 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 50873
Covered Lines: 46929
Line Coverage: 92.25%
Relevant Branches: 2421
Covered Branches: 1170
Branch Coverage: 48.33%
Branches in Coverage %: Yes
Coverage Strength: 127.32 hits per line

💛 - Coveralls

Comment thread Changelog.md Outdated
- 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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", () => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please reword to "checks and unchecks" (throughout)

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.

3 participants