The best way to control Claude Code, Codex and more from any computer or phone
fix(web): prevent sidebar shelf animations from overlapping headers (#25384)
Co-authored-by: maria-rcks <maria@kuuro.net>
Brandon Julio Thenaro committed
Nov 1, 2026 at 09:31 UTC
503bf77668081817a526eef9ebe06c3960ddb4b6
1 file changed
+9
-2
apps/web/src/components/Sidebar.tsx
+9
-2
@@ -1990,10 +1990,17 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
1990
dragState === null && sidebarListItems.length + visibleDraftSessionCount > 0;
1991
// Cache on both fields so layout-key changes trigger the effect even when animate is unchanged.
1992
const listMotionPass = { layoutKey: listMotionLayoutKey, animate: listMotionAnimate };
1993
+ const shelfExpansionKey = [workingShelfExpanded, snoozedShelfExpanded, settledShelfExpanded].join(
1994
+ ":",
1995
+ );
1996
+ const previousShelfExpansionKeyRef = useRef(shelfExpansionKey);
1997
// oxlint-disable-next-line t3code/no-unreasoned-state-sync -- tells the list motion controller to animate or not after each layout-affecting commit
1998
useLayoutEffect(() => {
1995
- listMotionRef.current?.update(listMotionPass.animate);
1996
- }, [listMotionPass]);
1999
+ // Shelf rows would travel over stationary headers below the bottom-anchored shelf.
2000
+ const shelvesUnchanged = previousShelfExpansionKeyRef.current === shelfExpansionKey;
2001
+ previousShelfExpansionKeyRef.current = shelfExpansionKey;
2002
+ listMotionRef.current?.update(listMotionPass.animate && shelvesUnchanged);
2003
+ }, [listMotionPass, shelfExpansionKey]);
2004
const handleThreadDragOver = (event: DragOverEvent) => {
2005
const target = event.over
2006
? resolveSidebarDropTarget(sidebarListItems, String(event.active.id), String(event.over.id))