fix(animated-theme-toggler): prevent compositor crashes and glitches on rapid click#987
Merged
Yeom-JinHo merged 5 commits intoJul 19, 2026
Conversation
|
@itskdhere is attempting to deploy a commit to the product-studio Team on Vercel. A member of the Team first needs to authorize it. |
Yeom-JinHo
self-requested a review
July 18, 2026 15:33
Yeom-JinHo
approved these changes
Jul 19, 2026
Yeom-JinHo
left a comment
Member
There was a problem hiding this comment.
Thanks @itskdhere — pushed follow-ups that trim the fix down to just the in-flight transition lock, since overlapping transitions are what crash the compositor
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.
Description
This PR introduces concurrency locks, a toggle cooldown, and temporary user-interaction disabling (
inert) to theAnimatedThemeTogglercomponent. These measures ensure that multiple View Transitions cannot overlap or run simultaneously, preventing browser-level crashes and rendering glitches.Changes
isTransitioningRefandisTransitioningstate to block initiating a new transition if one is already active.500msstrict debounce threshold (lastToggleTimeRef) between toggles to prevent spamming the compositor.inertand added apointer-events: none !importantstyle to all::view-transitionpseudo-elements during execution..catch()and cleanup states to prevent the layout from locking up if a transition is aborted or fails.Motivation
Fixes #986
Breaking Changes
None.
ScreenshotsDemo