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')} />