This repository was archived by the owner on Sep 2, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 332
fix(bento): dispose homepage animation listeners and timers on unmount #3168
Open
WhoamiI00
wants to merge
2
commits into
appwrite:main
Choose a base branch
from
WhoamiI00:fix/bento-animation-cleanup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stopHover()andstopInView()only detach Motion's event and observer handlers; they do not stop animations already started by their callbacks. Navigating away during an animation therefore leaves work running against the detached card until completion; retain and stop the animation controls here and in the equivalent messaging, realtime, and storage cleanup paths.Knowledge Base Used: Marketing pages
Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid, and fixed in f2f5c3a — thanks.
You're right that the returned cleanups only detach the pointer listener and the observer. What made this worth fixing is that the PR was already inconsistent about it:
auth,functionsandsitesdo hold their controls and stop them on teardown, whiledatabases,messaging,realtimeandstoragediscarded the return value ofanimate()entirely. So the four you flagged were the gap, and the fix just brings them in line with the three that were already right.Each of those four animates a single element and a new animation supersedes the previous one on it, so holding the latest controls is sufficient — no set or bookkeeping needed:
I used
stop()rather thancancel()deliberately:stop()halts at the current state, whilecancel()applies the initial state, which would visibly snap the card back if the effect re-ran rather than unmounted.Typed via
ReturnType<typeof animate>becauseAnimationPlaybackControlsWithThenis imported frommotion-dominside framer-motion'sdom.d.tsrather than re-exported frommotion, so naming it directly would reach past the public entry point.svelte-checkis clean — 0 errors, 0 warnings.