Repository navigation
Fixed edited grades in the marks spreadsheet reverting after being saved - #8260
Merged
david-yz-liu merged 5 commits intoNov 6, 2026
Merged
david-yz-liu merged 5 commits into
david-yz-liu merged 5 commits into
Conversation
GradeEntryCell reset its input from props on every re-render, but the table can re-render with stale row data (e.g. when resizing a column), since RawMarksSpreadsheet.shouldComponentUpdate does not propagate updated grades. Now the input is only reset when the row's value or student changes. Also ignore responses to save requests superseded by a later edit of the same cell, so out-of-order responses no longer overwrite newer grades. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Coverage Report for CI Build 42150147914Coverage increased (+0.01%) to 91.415%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
…ks-spreadsheet-revert
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Fixes a report that, in the marks spreadsheet, a changed grade would flash green (saved) and then revert to its original value a few seconds later. Refreshing the page showed the new grade, so the save had worked.
There were two causes, both in
GradeEntryCell:updateTotalupdatesRawMarksSpreadsheet'sdatastate. However,shouldComponentUpdatedoesn't re-render for that change (the row count is unchanged), so react-table keeps the data from page load.GradeEntryCell.componentWillReceivePropsreset the input from props on every re-render, so any re-render react-table makes on its own (e.g. resizing a column) put the original grade back in the cell.componentWillReceivePropsis replaced withcomponentDidUpdate, which only resets the input whendefault_valueorstudent_idchanges. Thestudent_idcheck is needed because react-table keys rows by position, so a cell can be reused for a different student after sorting. This also removes React's deprecation warning forcomponentWillReceiveProps.2, then25). If the earlier response arrived last, it overwrote the newer grade in the component's data, and the next re-render showed the older value.Type of Change
Checklist
Before opening your pull request:
After opening your pull request:
Questions and Comments
GradeEntryTotaluses the same pattern and might briefly show another row's total after an edit followed by a sort. I haven't confirmed this, and it is not changed here.🤖 Generated with Claude Code