File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1990,10 +1990,17 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve
19901990 dragState === null && sidebarListItems . length + visibleDraftSessionCount > 0 ;
19911991 // Cache on both fields so layout-key changes trigger the effect even when animate is unchanged.
19921992 const listMotionPass = { layoutKey : listMotionLayoutKey , animate : listMotionAnimate } ;
1993+ const shelfExpansionKey = [ workingShelfExpanded , snoozedShelfExpanded , settledShelfExpanded ] . join (
1994+ ":" ,
1995+ ) ;
1996+ const previousShelfExpansionKeyRef = useRef ( shelfExpansionKey ) ;
19931997 // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- tells the list motion controller to animate or not after each layout-affecting commit
19941998 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 ] ) ;
19972004 const handleThreadDragOver = ( event : DragOverEvent ) => {
19982005 const target = event . over
19992006 ? resolveSidebarDropTarget ( sidebarListItems , String ( event . active . id ) , String ( event . over . id ) )
You can’t perform that action at this time.
0 commit comments