fix(sidebar): keep incoming host headers above sticky groups (#34751)

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-10-27 22:46:42 -07:00
committed by GitHub
co-authored by OrcaWin
parent 66e2d39827
commit 7b74657a32
@@ -65,7 +65,7 @@ function renderHostHeaderVirtualRow(
row: Extract<RenderRow, { type: 'host-header' }>,
vItem: VirtualItem
): React.JSX.Element {
// Why: the host card is the outer tier; it pins above group headers (z-30 vs z-20) and stays put as they hand off.
// Incoming hosts must cover the outgoing sticky group before they pin.
const isActiveStickyHost = ctx.activeStickyHostIndexRef.current === vItem.index
const hasHeaderTopSpacing = shouldUseHeaderTopSpacing({
rows: ctx.renderRows,
@@ -83,9 +83,9 @@ function renderHostHeaderVirtualRow(
data-index={vItem.index}
ref={ctx.measureVirtualRowElement}
className={cn(
'left-0 right-0',
'left-0 right-0 z-30 bg-worktree-sidebar',
hasHeaderTopSpacing && !isActiveStickyHost && 'pt-1',
isActiveStickyHost ? 'sticky -top-px z-30 bg-worktree-sidebar' : 'absolute top-0'
isActiveStickyHost ? 'sticky -top-px' : 'absolute top-0'
)}
style={isActiveStickyHost ? undefined : { transform: getVirtualRowTransform(vItem.start) }}
>