{/* Always-on drag stripe so the window can be moved even when tabs fill the bar */}
{/* Fixed left tabs: Vaults and SFTP */}
{showSftpTab && (
)}
{/* Scrollable tabs container with fade masks */}
{
if (hasWorkspaceSessionDrag(e.dataTransfer)) {
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
return;
}
// Keep drop indicator active while dragging over the container
if (draggedTabIdRef.current && isDraggingForReorder && !dropIndicator) {
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
}
}}
onDrop={handleTabBarDrop}
>
{hasHostTreeToggleSurface && (
{isHostTreeOpen ? t('terminal.layer.hostTree.collapse') : t('terminal.layer.hostTree.expand')}
)}
{hasHostTreeToggleSurface && (
)}
{/* Left fade mask */}
{canScrollLeft && (
)}
{/* Scrollable container */}
{
if (hasWorkspaceSessionDrag(e.dataTransfer)) {
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
}
}}
onDrop={handleTabBarDrop}
>
{renderOrderedTabs()}
{/* Add new tab button - follows last tab when not overflowing */}
{!hasOverflow && (
{t('topTabs.openQuickSwitcher')}
)}
{/* Draggable spacer - fixed width handle at the end */}
{/* Right fade mask */}
{canScrollRight && (
)}
{/* More tabs button - only when overflowing */}
{hasOverflow && (
{t('topTabs.moreTabs')}
)}
{/* Right controls share the tab row. */}
{t('topTabs.aiAssistant')}
{appLockEnabled && onLockApp && (
{t('topTabs.lockApp')}
)}
{t('topTabs.openSettings')}
{showWindowControls && }
{/* Small drag shim to the right edge (macOS only – on Windows the close button should touch the edge) */}
{isMacClient && !showWindowControls && (
)}