-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animate the Sidebar Objects Tree view opening #6521
Conversation
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.
PR Summary
Introduced animations for the sidebar objects tree view opening and closing using framer-motion
to enhance user experience.
- Modified
packages/twenty-front/src/modules/object-metadata/components/ObjectMetadataNavItems.tsx
to include animation variants. - Applied
motion.div
withhidden
andvisible
states for smooth transitions. - Set animation duration to 300ms as specified in the related issue.
- Ensured no interference with existing functionality and handled edge cases.
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
const navItemsAnimationVariants = { | ||
hidden: { height: 0 }, | ||
visible: { height: 'auto' }, | ||
}; |
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.
Hello @AliElamir, thank you for contributing.
The animation is not exactly what @Bonapara described in his issue.
When you display your animation slowly, you can see that the children appear instantly and then the parent element height is animated, I feel like you should also animate the height of the children elements to make it feel smoother.
Enregistrement.de.l.ecran.2024-08-05.a.17.06.03.mov
More insights:
- the animation should also be displayed when we close the menu
- the opacity also seems to be animated from 0 to 1
Thank you :)
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.
Hey @bosiraphael , thank you for your feedback.
I have adjusted the animation based on your comments and pushed the latest changes. It looks right to me now, but please let me know if there are any more adjustments needed. @Bonapara
Thank you!
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.
LGTM, I made a few modifications to make the animation smoother. Thank you for contributing :)
@Bonapara
Issue #6485
Introduced the animation when opening the menu.
Please let me know if this is fine or I need to make further changes. Thank you.