Skip to content

F3: Sidebar hierarchy (Client > Project > Thread tree) #6

@rororowyourboat

Description

@rororowyourboat

Summary

Replace the current flat project list in the sidebar with a three-level navigation tree: Client > Project > Thread. This replaces the client-side-only project-group UI with a server-backed hierarchy.

Scope

  • Refactor Sidebar.tsx to render Clients as top-level collapsible sections
  • Each Client section contains its assigned Projects (existing SortableProjectItem adapted)
  • Each Project contains its Threads (existing behavior preserved)
  • Add "Unassigned" section at the bottom for projects with no clientId (hidden when empty)
  • Client sections show: name, project count badge, collapse/expand toggle, context menu (rename, archive, delete)
  • Collapse/expand state for Client sections stored in localStorage (UI-only, via uiStateStore)
  • Read clients[] from Zustand store (synced via snapshot)
  • Sort clients by sortOrder, projects by user-selected sort mode, threads unchanged

Design details

  • Empty Client section: show subtle empty state + "New Project" affordance
  • Zero Clients: show prompt to create first Client + any unassigned Projects
  • Search/filter active: hierarchy flattens to matching results
  • Keyboard navigation: support traversal across all three levels (Client → Project → Thread)
  • Preserve existing status indicators (terminal running, PR open, unread) on Thread items

Key files to modify

  • apps/web/src/components/Sidebar.tsx — major refactor, nested rendering
  • apps/web/src/components/Sidebar.logic.ts — update sort/group logic to work with Client hierarchy
  • apps/web/src/uiStateStore.ts — add Client expand/collapse state
  • apps/web/src/store.ts — ensure clients[] from snapshot is accessible
  • apps/web/src/types.ts — add Client frontend type if needed

Dependencies

  • F1 (Client entity), F2 (Client-Project binding)

Acceptance criteria

  • Sidebar renders Client > Project > Thread hierarchy
  • Clients are collapsible, state persisted in localStorage
  • "Unassigned" section shows projects without a Client
  • "Unassigned" section hidden when empty
  • Context menu on Client headers (rename, archive, delete)
  • "New Client" button in sidebar
  • Search still works across the hierarchy
  • Thread status indicators preserved

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Priority 1 - Foundationclient-hierarchyClient hierarchy & workspace organizationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions