fix: ensure side panel content doesn't shrink#17746
Conversation
Greptile OverviewGreptile SummaryChanged
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
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)
|
There was a problem hiding this comment.
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
StyledSidePanelwidth from100%tovar(--command-menu-width)to prevent content shrinkage during animation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🚀 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. |
|
This introduces a small regression when resizing the side panel. I'm not fully satisfied. We should find a better solution. |
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