Skip to content

Commit a45d8ca

Browse files
committed
Fixes the side menu collapsing animation for Metrics items
1 parent ccdab0e commit a45d8ca

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

apps/webapp/app/components/navigation/SideMenu.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export function SideMenu({
230230
mounted: gridMounted,
231231
} = useContainerWidth({ initialWidth: 216 });
232232

233-
const canReorder = orderedDashboards.length >= 2 && !isCollapsed;
233+
const canReorder = orderedDashboards.length >= 2;
234234

235235
// Handle drag stop - extract new order from layout y-positions
236236
const handleDashboardDragStop = useCallback(
@@ -582,7 +582,7 @@ export function SideMenu({
582582
}
583583
/>
584584
<div ref={gridContainerRef as Ref<HTMLDivElement>}>
585-
{canReorder && gridMounted ? (
585+
{canReorder ? (
586586
<ReactGridLayout
587587
layout={dashboardLayout}
588588
width={gridWidth}
@@ -593,7 +593,7 @@ export function SideMenu({
593593
containerPadding: [0, 0] as const,
594594
}}
595595
resizeConfig={{ enabled: false }}
596-
dragConfig={{ enabled: true, handle: ".sidebar-drag-handle" }}
596+
dragConfig={{ enabled: !isCollapsed, handle: ".sidebar-drag-handle" }}
597597
onDragStop={handleDashboardDragStop}
598598
className="sidebar-reorder-grid"
599599
autoSize

apps/webapp/app/components/navigation/SideMenuItem.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function SideMenuItem({
8282
</Link>
8383
);
8484

85-
if (action && !isCollapsed) {
85+
if (action) {
8686
return (
8787
<div className="group/menuitem relative h-8 w-full">
8888
<SimpleTooltip
@@ -95,9 +95,11 @@ export function SideMenuItem({
9595
asChild
9696
disableHoverableContent
9797
/>
98-
<div className="absolute top-1 right-1 bottom-1 flex aspect-square items-center justify-center">
99-
{action}
100-
</div>
98+
{!isCollapsed && (
99+
<div className="absolute top-1 right-1 bottom-1 flex aspect-square items-center justify-center">
100+
{action}
101+
</div>
102+
)}
101103
</div>
102104
);
103105
}

0 commit comments

Comments
 (0)