Skip to content

Improve command menu animation#16197

Merged
FelixMalfait merged 5 commits intomainfrom
improve-command-menu-animation
Dec 1, 2025
Merged

Improve command menu animation#16197
FelixMalfait merged 5 commits intomainfrom
improve-command-menu-animation

Conversation

@abdulrahmancodes
Copy link
Copy Markdown
Contributor

@abdulrahmancodes abdulrahmancodes commented Nov 29, 2025

Screen.Recording.2025-11-30.at.8.51.43.AM.mov

Note

Removes legacy layout and refactors CommandMenuPageLayout to use width-based animation with shared constants and close-animation cleanup.

  • UI/Command Menu:
    • Refactor CommandMenuPageLayout:
      • Switch to width/margin animation on StyledSidePanelWrapper; remove side panel x translate animation.
      • Use shared COMMAND_MENU_SIDE_PANEL_WIDTH constant.
      • Add close-state handling via isCommandMenuClosingState and useCommandMenuCloseAnimationCompleteCleanup on animation completion.
      • Simplify props: remove isSidePanelOpen; rely on isCommandMenuOpenedState and internal shouldRenderContent.
    • Cleanup:
      • Remove obsolete CommandMenuLayout.tsx.

Written by Cursor Bugbot for commit d6cb011. This will update automatically on new commits. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Nov 29, 2025

Greptile Overview

Greptile Summary

Simplified command menu animation by removing redundant x-axis slide animation from StyledSidePanel. The PR deleted the duplicate CommandMenuLayout.tsx component and removed the animate={{ x: ... }} property from CommandMenuPageLayout.tsx, keeping only the width-based animation from the wrapper.

Key changes:

  • Removed horizontal slide animation that was creating visual conflicts with the width animation
  • Animation now relies solely on the wrapper's width change (0px → 400px) with overflow: hidden
  • Eliminated duplicate component that had conflicting animation logic

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes simplify the animation logic by removing redundant x-axis translation. The wrapper already handles the reveal/hide animation via width changes with overflow:hidden, making the nested x-axis animation unnecessary. No logic changes, state management, or API modifications - purely a visual refinement that reduces animation complexity.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/twenty-front/src/modules/object-record/components/CommandMenuLayout.tsx 5/5 Deleted duplicate component that had conflicting animation logic
packages/twenty-front/src/modules/object-record/components/CommandMenuPageLayout.tsx 5/5 Removed redundant x-axis slide animation for cleaner side panel behavior

Sequence Diagram

sequenceDiagram
    participant User
    participant CommandMenuPageLayout
    participant StyledSidePanelWrapper
    participant StyledSidePanel
    participant CommandMenuRouter

    User->>CommandMenuPageLayout: Open command menu
    CommandMenuPageLayout->>CommandMenuPageLayout: isCommandMenuOpened = true
    CommandMenuPageLayout->>StyledSidePanelWrapper: animate width (0 → 400px)
    CommandMenuPageLayout->>StyledSidePanelWrapper: animate marginLeft (0 → spacing)
    Note over StyledSidePanel: No x-axis translation (removed)
    StyledSidePanelWrapper->>CommandMenuPageLayout: onAnimationStart()
    CommandMenuPageLayout->>CommandMenuPageLayout: setShouldRenderContent(true)
    CommandMenuPageLayout->>CommandMenuRouter: Render content
    StyledSidePanelWrapper->>CommandMenuPageLayout: onAnimationComplete()
    
    User->>CommandMenuPageLayout: Close command menu
    CommandMenuPageLayout->>CommandMenuPageLayout: isCommandMenuOpened = false
    CommandMenuPageLayout->>StyledSidePanelWrapper: animate width (400px → 0)
    CommandMenuPageLayout->>StyledSidePanelWrapper: animate marginLeft (spacing → 0)
    StyledSidePanelWrapper->>CommandMenuPageLayout: onAnimationComplete()
    CommandMenuPageLayout->>CommandMenuPageLayout: setShouldRenderContent(false)
    CommandMenuPageLayout->>CommandMenuPageLayout: commandMenuCloseAnimationCompleteCleanup()
Loading

Copy link
Copy Markdown
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.

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Copy Markdown

@omnalamwar omnalamwar left a comment

Choose a reason for hiding this comment

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

Looks fine to me.

@abdulrahmancodes abdulrahmancodes force-pushed the improve-command-menu-animation branch from e929b53 to b099c95 Compare December 1, 2025 11:20
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 1, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:4988

This environment will automatically shut down when the PR is closed or after 5 hours.

Copy link
Copy Markdown
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.

Great. Thank you!

@FelixMalfait FelixMalfait merged commit b5ec6df into main Dec 1, 2025
21 of 25 checks passed
@FelixMalfait FelixMalfait deleted the improve-command-menu-animation branch December 1, 2025 14:27
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 1, 2025

Thanks @abdulrahmancodes for your contribution!
This marks your 84th PR on the repo. You're top 1% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

NotYen pushed a commit to NotYen/twenty-ym that referenced this pull request Dec 4, 2025
https://github.com/user-attachments/assets/c9ff288d-0e68-4877-af6b-8685a6bbeeaf


<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Removes legacy layout and refactors `CommandMenuPageLayout` to use
width-based animation with shared constants and close-animation cleanup.
> 
> - **UI/Command Menu**:
>   - **Refactor `CommandMenuPageLayout`**:
> - Switch to width/margin animation on `StyledSidePanelWrapper`; remove
side panel `x` translate animation.
>     - Use shared `COMMAND_MENU_SIDE_PANEL_WIDTH` constant.
> - Add close-state handling via `isCommandMenuClosingState` and
`useCommandMenuCloseAnimationCompleteCleanup` on animation completion.
> - Simplify props: remove `isSidePanelOpen`; rely on
`isCommandMenuOpenedState` and internal `shouldRenderContent`.
>   - **Cleanup**:
>     - Remove obsolete `CommandMenuLayout.tsx`.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d6cb011. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
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.

4 participants