fix: DH-22867: Fix Table Options slide animation#2698
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2698 +/- ##
==========================================
+ Coverage 50.43% 50.72% +0.28%
==========================================
Files 788 788
Lines 44909 44921 +12
Branches 11442 11446 +4
==========================================
+ Hits 22652 22787 +135
+ Misses 22238 22115 -123
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR addresses a skipped/unstable slide-in animation in the TableOptions sidebar by making Stack navigation transitions resilient to frequent host re-renders (where “equivalent” views may be re-created as new React elements).
Changes:
- Update
Stackto track the active/pushing views by Reactkey(instead of element identity) to prevent animation/state churn during host re-renders. - Update
SlideTransitionref handling to re-readfirstElementChildwhenintoggles soCSSTransitiontargets the current child DOM node at enter/exit time.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/components/src/transitions/SlideTransition.tsx | Re-attaches the ref callback when in changes so the transition always animates the current child node. |
| packages/components/src/navigation/Stack.tsx | Switches Stack’s view tracking to React keys to avoid re-triggering animations on equivalent re-renders while keeping props “live”. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Opening a config page in the TableOptions sidebar re-renders in a burst during the transition. The only visible effect is the skipped slide-in animation when opening the built-in Table Options pages, but this can also trigger a re-mount loop with plugin-supplied table options.
Fix:
Stackviews by react key instead of element identity, so equivalent-but-new child elements from a host re-render don't churn state or re-trigger the slide animation.