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

406 animate the command menu button #10305

Conversation

bosiraphael
Copy link
Contributor

@bosiraphael bosiraphael commented Feb 18, 2025

Closes twentyhq/core-team-issues#406

  • Added animation on the Icon (The dots rotate and transform into an a cross)
  • Introduced a new component AnimatedButton. All the button styling could be extracted to another file so we don't duplicate the code, but since AnimatedLightIconButton duplicates the style from LightIconButton, I did the same here.
  • Added an animate presence component on the command menu to have a smooth transition from open to close state
  • Merged the open and close command menu button
  • For all the pages that are not an index page or a record page, we want the old behavior because there is no button in the page header to open the command menu

Before

Enregistrement.de.l.ecran.2025-02-18.a.17.21.51.mov

After

Enregistrement.de.l.ecran.2025-02-18.a.17.11.36.mov

@bosiraphael bosiraphael changed the title 406 animate the k button to make people understand its the same button 406 animate the command menu button Feb 18, 2025
@bosiraphael bosiraphael marked this pull request as ready for review February 18, 2025 16:38
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

This PR enhances the command menu button with smooth animations and transitions, improving visual feedback and user experience.

  • Added animated transformation of dots icon to X icon in PageHeaderOpenCommandMenuButton.tsx using SVG animations
  • Introduced new AnimatedButton component in twenty-ui with support for custom animations and styling variants
  • Added fade in/out animations with AnimatePresence to CommandMenuContainer for smoother transitions
  • Merged open/close command menu buttons into a single component with rotation animation
  • Added feature flag IsCommandMenuV2Enabled to control new animation behavior

6 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile

…the-same-button' of github.com:twentyhq/twenty into 406-animate-the-k-button-to-make-people-understand-its-the-same-button
Copy link
Contributor

@Devessier Devessier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really interesting implementation! I love the effect. Good job!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 💯

Comment on lines +132 to +134
const isButtonVisible =
!location.pathname.startsWith('/objects/') &&
!location.pathname.startsWith('/object/');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a safest way to determine whether the button should be visible? Do you think we'll want to add it to more pages soon? If so, could we make it simpler to update the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we will potentially add it everywhere, so we will just have to remove this check ;)

@Weiko Weiko merged commit aeed1c9 into main Feb 18, 2025
43 of 47 checks passed
@Weiko Weiko deleted the 406-animate-the-k-button-to-make-people-understand-its-the-same-button branch February 18, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Animate the ⌘K button to make people understand it's the same button
3 participants