From b44a6c7900cd0a233b9f517f7976ca4faa3e8ef9 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Sat, 4 Apr 2026 01:08:23 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20move=20separator=20outside=20SECTIONS=20?= =?UTF-8?q?group=20=E2=80=94=20between=20groups,=20not=20inside?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The border-b was on the SECTIONS header div only, creating a visible separator between the header and its type entries. Wrapped both header and sortable entries in a single border-b container so the divider appears between SECTIONS and FOLDERS instead. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/Sidebar.test.tsx | 13 +++++++ src/components/Sidebar.tsx | 64 +++++++++++++++++---------------- 2 files changed, 46 insertions(+), 31 deletions(-) diff --git a/src/components/Sidebar.test.tsx b/src/components/Sidebar.test.tsx index 28560c96..3cdf4d99 100644 --- a/src/components/Sidebar.test.tsx +++ b/src/components/Sidebar.test.tsx @@ -958,4 +958,17 @@ describe('Sidebar', () => { expect(onSelect).toHaveBeenCalledWith({ kind: 'filter', filter: 'favorites' }) }) }) + + describe('group separators', () => { + it('SECTIONS header and its entries share the same border-b container (no separator inside group)', () => { + render( {}} />) + const sectionsHeader = screen.getByText('SECTIONS') + const projectsSection = screen.getByText('Projects') + // Walk up from SECTIONS header to find the border-b container + const borderContainer = sectionsHeader.closest('.border-b') + expect(borderContainer).not.toBeNull() + // The section entry should be inside the same border-b container + expect(borderContainer!.contains(projectsSection)).toBe(true) + }) + }) }) diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index a685de24..21a62825 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -475,39 +475,41 @@ export const Sidebar = memo(function Sidebar({ )} - {/* Sections header + visibility popover */} -
- - {showCustomize && } -
+
+ {groupCollapsed.sections ? : } + SECTIONS +
+ { e.stopPropagation(); setShowCustomize((v) => !v) }} + > + + + + {showCustomize && } + - {/* Sortable section groups */} - {!groupCollapsed.sections && ( - - - {visibleSections.map((g) => ( - - ))} - - - )} + {/* Sortable section groups */} + {!groupCollapsed.sections && ( + + + {visibleSections.map((g) => ( + + ))} + + + )} + {/* Folder tree */} toggleGroup('folders')} />