Conversation
Retain outgoing rows separately from the semantic collection, publish measured row heights, and cover interruption, independent exits, loaders, StrictMode and drag indicators. Co-authored-by: Rook <rook@rook.is>
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.
Supersedes #10378, which was closed as stale pending passing tests. This replacement is a single commit based on current
main(4693fcc84), rather than reopening the original PR.Intent
Allow non-virtualized Tree subtrees to animate when expanded or collapsed without delaying the actual expansion state. Consumers should be able to use
data-entering/data-exitingand content-sized row heights, while keyboard navigation, selection, drag targets andaria-expandedreflect collapse immediately.Prior art: Disclosure (#8867), TabPanels (#9077), and the existing shared animation lifecycle helpers. There is no separate feature issue; the problem and proposed solution are described here for discussion.
Implementation
isEntering/isExitingrender props and the corresponding data attributes toTreeItem.useAnimationhelper.defaultExpandedKeysrows do not animate.--tree-item-heightwhen a nonzero height transition is declared. Initial entry is staged before applying animation selectors; resting size changes are observed using a border-box ResizeObserver. Measurement uses the computed CSS height, supports both box-sizing modes, and does not remove animation attributes or disable author transitions. Completion cleanup is cancellation-safe.Changes From the Original PR
The original branch retained whole expanded branches rather than exact exiting rows. That could restore a completed sibling, prematurely remove an animating grandchild, or retain loaders forever. These are fixed, with independent-completion, nested, section, and loader regression coverage.
The height implementation is smaller and no longer temporarily strips selectors or suppresses transitions to measure a row. Tests now cover content and padding resizing, content-box sizing, cancellation, StrictMode effect replay, and mixed keyframe/height entry.
The browser tests also stop asserting that the unrelated root row, which contains a native button, must have the same height as plain-text child rows. Intermediate animation states are inspected explicitly, and animations are finished through the Web Animations API rather than timed sleeps.
Scope and Limitations
✅ Pull Request Checklist:
AI assistance: implemented and reviewed with Rook using GPT-6 Astra, including four focused read-only review passes and follow-up checks. The human author remains responsible for review and upstream discussion.
📝 Test Instructions:
Full verification on the identical source tree before transplanting the commit onto this clean branch:
yarn test --maxWorkers=2 --silentyarn test:ssr --silentyarn vitest run --config=vitest.browser.config.ts --no-file-parallelismyarn lintThe unrestricted full browser command exhausted browser-session startup timeouts in this single-core sandbox. Running all files with
--no-file-parallelismpassed; no CI configuration or test exclusions were changed. The focused 16-test Tree animation file was rerun after transplanting the commit and passed all 48 browser executions with default parallelism.The drag-indicator regression was also verified to fail when its fix was temporarily removed (two "Insert after Root" targets instead of one), then pass with the fix restored.
Manual review:
yarn start-> React Aria Components / Tree / Animated expand/collapse. Expand, collapse, reverse mid-animation, and check that the collapsed parent reports its actual state throughout. Also review keyboard/screen-reader dragging, reduced motion, wrapping content, and initial expanded rows.No new manual screen-reader, touch-device, high-contrast, zoom, or visual-regression matrix was performed in this refresh. Those remain review gaps; the automated tests are not a substitute for them.
🧢 Your Project:
Metaview
Rook session · Slack thread · Requested by
Rob· Modelgpt-6-astra