@@ -7,6 +7,7 @@ import { TabRpcClient } from "@/app/store/wshrpcutil";
77import { useWaveEnv } from "@/app/waveenv/waveenv" ;
88import { WorkspaceLayoutModel } from "@/app/workspace/workspace-layout-model" ;
99import { deleteLayoutModelForTab } from "@/layout/index" ;
10+ import { isMacOSTahoeOrLater } from "@/util/platformutil" ;
1011import { fireAndForget } from "@/util/util" ;
1112import { useAtomValue } from "jotai" ;
1213import { OverlayScrollbars } from "overlayscrollbars" ;
@@ -20,6 +21,9 @@ import { WorkspaceSwitcher } from "./workspaceswitcher";
2021
2122const TabDefaultWidth = 130 ;
2223const TabMinWidth = 100 ;
24+ const MacOSTrafficLightsWidth = 74 ;
25+ const MacOSTahoeTrafficLightsWidth = 80 ;
26+
2327const OSOptions = {
2428 overflow : {
2529 x : "scroll" ,
@@ -636,10 +640,13 @@ const TabBar = memo(({ workspace, noTabs }: TabBarProps) => {
636640 // Calculate window drag left width based on platform and state
637641 let windowDragLeftWidth = 10 ;
638642 if ( env . isMacOS ( ) && ! isFullScreen ) {
643+ const trafficLightsWidth = isMacOSTahoeOrLater ( )
644+ ? MacOSTahoeTrafficLightsWidth
645+ : MacOSTrafficLightsWidth ;
639646 if ( zoomFactor > 0 ) {
640- windowDragLeftWidth = 74 / zoomFactor ;
647+ windowDragLeftWidth = trafficLightsWidth / zoomFactor ;
641648 } else {
642- windowDragLeftWidth = 74 ;
649+ windowDragLeftWidth = trafficLightsWidth ;
643650 }
644651 }
645652
@@ -684,28 +691,32 @@ const TabBar = memo(({ workspace, noTabs }: TabBarProps) => {
684691 < div
685692 className = "tabs-wrapper"
686693 ref = { tabsWrapperRef }
687- style = { { width : `${ tabsWrapperWidth } px` , ...( noTabs ? ( { WebkitAppRegion : "drag" } as React . CSSProperties ) : { } ) } }
694+ style = { {
695+ width : `${ tabsWrapperWidth } px` ,
696+ ...( noTabs ? ( { WebkitAppRegion : "drag" } as React . CSSProperties ) : { } ) ,
697+ } }
688698 >
689- { ! noTabs && tabIds . map ( ( tabId , index ) => {
690- const isActive = activeTabId === tabId ;
691- const showDivider = index !== 0 && ! isActive && index !== activeTabIndex + 1 ;
692- return (
693- < Tab
694- key = { tabId }
695- ref = { tabRefs . current [ index ] }
696- id = { tabId }
697- showDivider = { showDivider }
698- onSelect = { ( ) => handleSelectTab ( tabId ) }
699- active = { isActive }
700- onDragStart = { ( event ) => handleDragStart ( event , tabId , tabRefs . current [ index ] ) }
701- onClose = { ( event ) => handleCloseTab ( event , tabId ) }
702- onLoaded = { ( ) => handleTabLoaded ( tabId ) }
703- isDragging = { draggingTab === tabId }
704- tabWidth = { tabWidthRef . current }
705- isNew = { tabId === newTabId }
706- />
707- ) ;
708- } ) }
699+ { ! noTabs &&
700+ tabIds . map ( ( tabId , index ) => {
701+ const isActive = activeTabId === tabId ;
702+ const showDivider = index !== 0 && ! isActive && index !== activeTabIndex + 1 ;
703+ return (
704+ < Tab
705+ key = { tabId }
706+ ref = { tabRefs . current [ index ] }
707+ id = { tabId }
708+ showDivider = { showDivider }
709+ onSelect = { ( ) => handleSelectTab ( tabId ) }
710+ active = { isActive }
711+ onDragStart = { ( event ) => handleDragStart ( event , tabId , tabRefs . current [ index ] ) }
712+ onClose = { ( event ) => handleCloseTab ( event , tabId ) }
713+ onLoaded = { ( ) => handleTabLoaded ( tabId ) }
714+ isDragging = { draggingTab === tabId }
715+ tabWidth = { tabWidthRef . current }
716+ isNew = { tabId === newTabId }
717+ />
718+ ) ;
719+ } ) }
709720 </ div >
710721 </ div >
711722 < button
0 commit comments