Repository navigation
Conversation
A sidebar row that was there at first render could come back
invisible. When a row leaves and returns after its exit fade has
finished, but before AnimatePresence removes it (it waits for every
exiting row), Motion jumps the row to its `initial` opacity of 0 and
replays the enter. Before Motion 13.4.4, AnimatePresence initial={false}
still blocks that replay for rows from the first render, so the row
stays at opacity 0 for good.
Skip the first render's fade per row with `initial={false}` instead, so
AnimatePresence never blocks an enter.
Co-authored-by: Jitter <2b2e6415e748c35180847a37aadae06a11e30dddc76b784e7fd9354c4eb42e7a@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
This branch has not been deployed
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.
Why
#4586 stops a reorder batch from waiting forever on a lost fade completion. It doesn't cover the other way a sidebar row goes blank. In that case the batch isn't stuck. Motion has left the row's opacity at 0.
It happens when a row that was there at first render leaves the sidebar and comes back after its exit fade has finished, but before AnimatePresence has unmounted it. AnimatePresence keeps finished rows mounted until every exiting row is done. When that row re-enters, Motion 12 jumps its opacity to the
initialvalue of 0 and replays the enter. The replay is blocked, because AnimatePresenceinitial={false}marks rows from the first render withblockInitialAnimation. The row ends up visible to layout, focusable, and invisible for good.Motion fixed this upstream in 13.4.4: its exit feature now clears
blockInitialAnimationon re-entry. We pinmotion12.40.0, and two major bumps are too much for this fix.What
ChannelSidebarRowsno longer passesinitial={false}to AnimatePresence. Each row getsinitial={false}only if it mounts in the first render, which skips the same first-render fade without ever blocking a later enter. A row that re-enters now fades back to opacity 1.This can be reverted once we're on Motion 13.4.4 or later.
Testing
afterEachnow drains Motion's pending frame after real-timer tests too. Without that, the frame is stranded when the next test switches to fake timers.tests/browser/navigation-sorting.spec.mjs: 44 passed (Chromium and WebKit).🤖 Generated with Claude Code