Repository navigation
fix(undo): stop idle renders and flush pending commits on unmount - #968
Merged
thlpkee20-wq merged 1 commit intoOct 22, 2026
Merged
Conversation
|
@Tonychris127 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Overview
useUndoBannerspreviously updated its host every 100 ms even when empty and discarded pending commits when the host unmounted. The hook now runs one ticker only while actions are pending, skips unchanged banner snapshots, and commits remaining actions when their undo controls disappear on unmount.Related Issue
Closes #941
Changes
Verification Results
master(c00dd8430ec77f45d36faa59f314dacda54d81ed) before the implementation change.node node_modules/vitest/vitest.mjs run src/hooks/useUndoBanners.test.tsx src/hooks/useUndoKeyboard.test.tsx src/components/UndoBanner: 48 passed.npm run build: passed, with existing CSS/chunk-size warnings.git diff --check: passed.tsc --noEmitreports existing syntax errors inTwoFactorSetup.test.tsxlines 100/107, also matching the base.npm test -- --maxWorkers=2with coverage: 4,033 passed / 149 failed / 3 pending on Windows/Node24. Compared with existing Linux/Node22 evidence for the exact base (4,026 passed / 148 failed / 3 pending), all 148 failed test identities and failed-to-load suites are unchanged. The one extra failure isScheduledExportsPanel has no axe violations(waitFortimeout), also recorded in the earlier Windows run; its isolated rerun passes all 13 tests. The eight new hook tests pass. The repository-wide suite is not green.action_required, run 39238376821)