@@ -1511,10 +1511,7 @@ var SidebarController = {
15111511 ) ;
15121512 this . _panelResizeObserver . observe ( this . _box ) ;
15131513
1514- this . _launcherDropHandler = ( ) => {
1515- this . _state . launcherDragActive = false ;
1516- this . updatePinnedTabsHeightOnResize ( ) ;
1517- } ;
1514+ this . _launcherDropHandler = ( ) => ( this . _state . launcherDragActive = false ) ;
15181515 this . _launcherSplitter . addEventListener (
15191516 "command" ,
15201517 this . _launcherDropHandler
@@ -1538,19 +1535,15 @@ var SidebarController = {
15381535 }
15391536 } ) ;
15401537
1541- this . _itemsWrapperResizeObserver = new ResizeObserver ( async ( [ entry ] ) => {
1538+ this . _itemsWrapperResizeObserver = new ResizeObserver ( async ( ) => {
15421539 await window . promiseDocumentFlushed ( ( ) => {
1540+ // Adjust pinned tabs container height if needed
15431541 requestAnimationFrame ( ( ) => {
1542+ // If we are currently moving tabs, don't resize
15441543 if ( this . _pinnedTabsContainer . hasAttribute ( "dragActive" ) ) {
15451544 return ;
15461545 }
1547- // Only respond to WIDTH changes (sidebar being resized wider/narrower).
1548- // Ignoring height changes prevents an infinite resize loop.
1549- const newWidth = entry . contentBoxSize [ 0 ] . inlineSize ;
1550- if ( newWidth === this . _pinnedTabsItemsWrapperWidth ) {
1551- return ;
1552- }
1553- this . _pinnedTabsItemsWrapperWidth = newWidth ;
1546+
15541547 this . updatePinnedTabsHeightOnResize ( ) ;
15551548 } ) ;
15561549 } ) ;
@@ -1605,32 +1598,17 @@ var SidebarController = {
16051598 } ,
16061599
16071600 updatePinnedTabsHeightOnResize ( ) {
1608- // Skip during sidebar width drag to prevent unpinned tabs from jumping.
1609- // The drop handler calls this function once cleanly after drag ends.
1610- if ( this . isLauncherDragging ) {
1611- return ;
1612- }
1613-
1614- const preferredHeight = this . _state . launcherExpanded
1615- ? this . _state . expandedPinnedTabsHeight
1616- : this . _state . collapsedPinnedTabsHeight ;
1617-
1618- if ( ! preferredHeight || ! this . _pinnedTabsContainer . childElementCount ) {
1619- return ;
1620- }
1621-
1622- if ( this . isLauncherDragging ) {
1623- // Clear height during drag so we can measure the natural content height accurately
1624- this . _pinnedTabsContainer . style . height = "" ;
1625- }
1626-
16271601 let itemsWrapperHeight = window . windowUtils . getBoundsWithoutFlushing (
16281602 this . _pinnedTabsItemsWrapper
16291603 ) . height ;
1630-
1631- // Clamp for display only — never overwrite the user's saved preference
1632- const clampedHeight = Math . min ( preferredHeight , itemsWrapperHeight ) ;
1633- this . _pinnedTabsContainer . style . height = `${ clampedHeight } px` ;
1604+ if ( this . _state . pinnedTabsHeight > itemsWrapperHeight ) {
1605+ this . _state . pinnedTabsHeight = itemsWrapperHeight ;
1606+ if ( this . _state . launcherExpanded ) {
1607+ this . _state . expandedPinnedTabsHeight = this . _state . pinnedTabsHeight ;
1608+ } else {
1609+ this . _state . collapsedPinnedTabsHeight = this . _state . pinnedTabsHeight ;
1610+ }
1611+ }
16341612 } ,
16351613
16361614 /**
0 commit comments