Fix row bulk delete freeze#3063
Conversation
Greptile SummaryThis PR fixes a UI freeze that occurred when bulk-deleting rows in the spreadsheet view. The fix snapshots the target row IDs before clearing reactive state, resets selections and triggers a grid re-render up-front (before any awaited API calls), and moves
Confidence Score: 4/5Safe to merge; the change correctly prevents the freeze and follows the existing error-handling pattern with no new API surface. The logic restructuring is clean and the state reset order is correct. The only outstanding item is a now-dead No files require special attention beyond the single changed component. Important Files Changed
Reviews (1): Last reviewed commit: "lint issue" | Re-trigger Greptile |
| showDelete = false; | ||
| let hadErrors = false; | ||
| const rowIdsToDelete = selectedRowForDelete ? [selectedRowForDelete] : [...selectedRows]; | ||
| const deletedRowsCount = rowIdsToDelete.length || 1; |
There was a problem hiding this comment.
The
|| 1 fallback is now unreachable dead code. rowIdsToDelete is built as [selectedRowForDelete] or [...selectedRows], so when any deletion occurs its length is always ≥ 1. In the original code the fallback was needed because selectedRows.length was checked separately and could be 0 when only selectedRowForDelete was set — but that split no longer exists here.
| const deletedRowsCount = rowIdsToDelete.length || 1; | |
| const deletedRowsCount = rowIdsToDelete.length; |
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)