mirror of
https://github.com/stablyai/orca
synced 2026-04-21 14:17:16 +00:00
fix(sidebar): drop top margin on first worktree group header (#824)
The worktree search bar already provides spacing above the list, so the first group header doesn't need its own mt-2 offset. Secondary headers still get the margin to separate groups.
This commit is contained in:
parent
75f68a0a84
commit
0f43ab02e6
1 changed files with 7 additions and 1 deletions
|
|
@ -235,6 +235,8 @@ const VirtualizedWorktreeViewport = React.memo(function VirtualizedWorktreeViewp
|
|||
[navigateWorktree]
|
||||
)
|
||||
|
||||
const firstHeaderIndex = useMemo(() => rows.findIndex((r) => r.type === 'header'), [rows])
|
||||
|
||||
const virtualItems = virtualizer.getVirtualItems()
|
||||
const activeDescendantId =
|
||||
activeWorktreeId != null &&
|
||||
|
|
@ -291,7 +293,11 @@ const VirtualizedWorktreeViewport = React.memo(function VirtualizedWorktreeViewp
|
|||
role="button"
|
||||
tabIndex={0}
|
||||
className={cn(
|
||||
'group mt-2 flex h-7 w-full items-center gap-1.5 px-1.5 text-left transition-all cursor-pointer',
|
||||
'group flex h-7 w-full items-center gap-1.5 px-1.5 text-left transition-all cursor-pointer',
|
||||
// First header sits right under the sidebar search bar, which
|
||||
// already supplies its own spacing — only offset secondary
|
||||
// group headers.
|
||||
vItem.index !== firstHeaderIndex && 'mt-2',
|
||||
row.repo ? 'overflow-hidden' : row.tone
|
||||
)}
|
||||
onClick={() => toggleGroup(row.key)}
|
||||
|
|
|
|||
Loading…
Reference in a new issue