Repository navigation
Description
Overview
The Collections section in the navigation sidebar uses a static folder icon that does not change when the section is expanded or collapsed. Users have no visual indicator of the current state unless child items happen to be visible.
Problem Statement
User Experience:
- User sees the Collections nav item with a closed folder icon
- User clicks to expand — child collections appear, but the folder icon stays the same
- User cannot tell at a glance whether Collections is expanded or collapsed when no children are visible
Expected: The folder icon should switch to an "open folder" variant when collectionsExpanded is true, and back to a "closed folder" when false — consistent with standard file explorer conventions.
Proposed Solution
Conditionally render two folder SVG icons in the Collapsible.Trigger based on the collectionsExpanded state:
- Closed (
collectionsExpanded === false): current closed folder icon - Open (
collectionsExpanded === true): open folder icon variant
Acceptance Criteria
- Folder icon shows closed state when Collections section is collapsed
- Folder icon shows open state when Collections section is expanded
- Icon switches immediately on click (no delay)
- Works correctly on initial load when
collectionsExpandedis restored from persisted layout state - Tests pass (
bun run test:all) - Code passes
bun run quality:fix
Technical Specifications
Files to Modify
- NavigationSidebar:
packages/desktop-app/src/lib/components/layout/navigation-sidebar.svelte—Collapsible.Triggerblock for Collections (~lines 262–363)
Implementation Details
The collectionsExpanded boolean is already available in scope from the layout store. The trigger currently renders a single static folder SVG. Replace it with a conditional that swaps between a closed folder icon and an open folder icon (e.g. Lucide folder vs folder-open, or equivalent inline SVGs matching the existing icon style).
The existing icon uses:
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" />
</svg>The open folder variant should follow the same SVG style/dimensions.
Related Issues
- Mermaid diagram disappears after blurring from edit mode #938 (sibling UI bug in same sidebar area)
Activity
Fix folder icon to reflect expanded/collapsed state in collections si…
Collections sidenav folder icon should reflect expanded/collapsed sta…
Collections sidenav folder icon should reflect expanded/collapsed sta…