Skip to content
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

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

AliElamir
Copy link
Contributor

@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.

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 with hidden and visible 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

Comment on lines 20 to 23
const navItemsAnimationVariants = {
hidden: { height: 0 },
visible: { height: 'auto' },
};
Copy link
Contributor

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 :)

Copy link
Contributor Author

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!

Copy link
Contributor

@bosiraphael bosiraphael left a 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 :)

@bosiraphael bosiraphael merged commit cd33471 into twentyhq:main Aug 6, 2024
5 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants