Skip to content

feat: project groups (collapsible folders in the sidebar project list)#84

Open
MHohlios wants to merge 1 commit into
simion:mainfrom
MHohlios:feature/project-groups
Open

feat: project groups (collapsible folders in the sidebar project list)#84
MHohlios wants to merge 1 commit into
simion:mainfrom
MHohlios:feature/project-groups

Conversation

@MHohlios

@MHohlios MHohlios commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Closes #76.

What

Projects can carry an optional group label. Grouped projects render under collapsible folder headers in the sidebar, so many similarly named repos (app-ios / app-android / service-auth / ...) can be clustered by product or layer while staying visible at a glance. Groups are purely derived: a group exists while at least one project carries its label. No group entity, no filesystem effect, and existing projects.json files load unchanged.

UX

  • Right-click a project: Move to group (existing groups / New group / Remove from group), works in compact mode too
  • Drag and drop: drag a project into, out of, or within a folder; drop on a collapsed folder's header to file it; drag a folder header to reorder whole groups as blocks
  • Group names are ALL-CAPS by design (the rename input enforces it; matching is case-insensitive so "frontend" and "Frontend" cannot split into two groups)
  • Folder colors: the folder context menu opens with a Finder-tag-style inline swatch row (Default + 8 fixed colors). Color paints the folder glyph, name, and the members' guide line. Default folders stay muted (fg-faint) so only assigned colors are loud
  • Collapsed folders roll up member agent state into a header dot (attention wins over done) so hidden members can still call for the user
  • Header shows a member count; collapse state persists across launches
  • "Expand all agents" / "Collapse all agents" also expand/collapse group folders
  • Keyboard nav (option-arrows, next/prev task) walks the same visual order the sidebar renders
  • A11y: headers are focusable buttons with aria-expanded; swatches carry aria-labels

Implementation

  • src-tauri/src/lib.rs: optional group field on Project (serde default + skip-if-none) and one atomic project_set_group(ids, group) command so rename/dissolve is a single projects.json write
  • src/lib/projectGroups.ts (new): groupOf() is the single normalization point (trim + uppercase); shared section/order helpers keep sidebar rendering and keyboard nav on one definition of visual order
  • src/store/app.ts: collapse + color state in localStorage keyed by normalized group name, pruned when a group disappears, migrated on rename
  • src/components/sidebar/Sidebar.tsx: folder rendering and the pointer-event drag logic (document-level listeners, arm-on-pointerdown, threshold start, live optimistic reorder)
  • Folder accents come from a fixed palette table mapped to --color-palette-* tokens in @theme (light theme re-tunes the shades for contrast); everything else the feature paints uses existing theme tokens (fg-faint for default folders, warn/info for the roll-up dot, accent for drag highlights)
  • Input hygiene: the stored color is a palette key validated against the table before rendering (unknown keys fall back to default), group names render only as React-escaped text and never reach a CSS value, the two interpolated selectors are CSS.escaped, and JSON-parsed localStorage maps are read with Object.hasOwn

Testing

  • make check-all clean (cargo check + tsc), vitest 214/214, production build passes
  • Manual pass on a fleet of test repos: grouping via menu and drag, folder reorder, collapsed-folder drops, rename merge, dissolve, collapse/expand all, compact rail, hide-inactive interaction, theme switching, relaunch persistence

Deliberately out of scope (follow-ups)

  • New Project dialog: pick or create a group at add time
  • Group header "+" action (choose what to create inside the folder)
  • Theme-defined palette shades (per-theme swatch tuning + custom-theme keys) - prepared on a separate branch, PR to follow if wanted

@MHohlios MHohlios marked this pull request as ready for review July 10, 2026 20:20
@MHohlios

Copy link
Copy Markdown
Contributor Author

Made some UX assumptions here so feel free to push back.

@MHohlios MHohlios marked this pull request as draft July 10, 2026 20:40
@MHohlios MHohlios force-pushed the feature/project-groups branch 2 times, most recently from bba1eab to 0f18250 Compare July 10, 2026 20:45
@MHohlios MHohlios marked this pull request as ready for review July 10, 2026 20:50
@adamatan

Copy link
Copy Markdown
Contributor

Love it. Clean, easy to use.
image
Reordering works well.
image

Good improvement!

@simion

simion commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Looks slick and clean! Congrats. Will test, review and merge tonight.

Projects can carry an optional UI-only group label. Grouped projects
render under collapsible folder headers in the sidebar with drag and
drop (into/out of/within folders, header drag to reorder groups),
context-menu management, aggregated attention/done dots on collapsed
folders, and localStorage-persisted collapse state. No filesystem
effect; existing projects.json files load unchanged.
@MHohlios MHohlios force-pushed the feature/project-groups branch from 0f18250 to 9b9e8c8 Compare July 11, 2026 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature request] Project Groups: collapsible folders in the sidebar project list

3 participants