Skip to content

fix: ensure side panel content doesn't shrink#17746

Closed
Devessier wants to merge 1 commit intomainfrom
fix-shrunk-content
Closed

fix: ensure side panel content doesn't shrink#17746
Devessier wants to merge 1 commit intomainfrom
fix-shrunk-content

Conversation

@Devessier
Copy link
Contributor

Ensure side panel's content doesn't change during the animation. I set a fixed width to the content and rely on the parent to hide overflowing content.

Before

CleanShot.2026-02-05.at.15.48.26.mp4

After

CleanShot.2026-02-05.at.15.47.28.mp4

Copilot AI review requested due to automatic review settings February 5, 2026 14:49
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

Changed StyledSidePanel width from 100% to var(--command-menu-width) to prevent content from shrinking during the side panel's open/close animation.

  • Fixed animation jank where side panel content would resize as the parent wrapper animated
  • Inner panel now maintains fixed width matching the CSS variable value
  • Parent wrapper still handles overflow clipping and width transitions
  • Consistent with the wrapper's approach of using the same CSS variable

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • Simple CSS fix that correctly addresses animation jank with a one-line change, follows existing patterns in the codebase, and has no logical or behavioral side effects
  • No files require special attention

Important Files Changed

Filename Overview
packages/twenty-front/src/modules/command-menu/components/CommandMenuSidePanelForDesktop.tsx Fixed side panel width to prevent content shrinking during animation by using CSS variable instead of 100%

Sequence Diagram

sequenceDiagram
    participant User
    participant Component as CommandMenuSidePanelForDesktop
    participant WidthEffect as CommandMenuWidthEffect
    participant Recoil as commandMenuWidthState
    participant DOM as CSS Variable
    participant Wrapper as StyledSidePanelWrapper
    participant Panel as StyledSidePanel

    Note over Component: Component renders
    Component->>WidthEffect: Renders CommandMenuWidthEffect
    WidthEffect->>Recoil: useRecoilValue(commandMenuWidthState)
    Recoil-->>WidthEffect: Returns width (e.g., 350px)
    WidthEffect->>DOM: setProperty('--command-menu-width', '350px')
    
    Note over Component: User opens command menu
    Component->>Wrapper: isOpen=true triggers width transition
    Wrapper->>DOM: width: var(--command-menu-width)
    Note over Wrapper: Animates from 0px to 350px
    
    Panel->>DOM: width: var(--command-menu-width)
    Note over Panel: Fixed width prevents shrinking
    Note over Wrapper: overflow: hidden clips content
    
    Note over Wrapper: Animation completes
    Wrapper->>Component: onTransitionEnd()
    Component->>Component: setShouldRenderContent(true)
Loading

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.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an animation issue where the side panel's content would shrink during the open/close animation. The fix changes the inner panel's width from a relative 100% to a fixed CSS variable value, allowing the parent wrapper to handle the animation while the content maintains its size.

Changes:

  • Modified StyledSidePanel width from 100% to var(--command-menu-width) to prevent content shrinkage during animation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🚀 Preview Environment Ready!

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

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

@Devessier
Copy link
Contributor Author

This introduces a small regression when resizing the side panel. I'm not fully satisfied. We should find a better solution.

@Devessier Devessier closed this Feb 9, 2026
@charlesBochet charlesBochet deleted the fix-shrunk-content branch February 9, 2026 22:52
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.

1 participant