# Space groups Herdr's Spaces sidebar with foldable groups. Spaces whose names share a prefix (`acme-api`, `acme-web`, `acme-docs`) sit under one header (`acme`); a click on the header folds the group to one line. ![Space groups](preview.png) ## What you see - The Spaces sidebar as Herdr ships it: "Spaces" title with `+`, a header per machine once a remote machine is known, colored letter avatars, repo and branch after each name, worktrees under their repo with a branch icon. - A group header row, 28px high, 8px padding, 9px gap, rounded 8: an 18px slot with a 12px `chevron-down.svg` (open) or a 14px `folder.svg` (folded), the group label in `muted` (`foreground` on hover, `hover` background), and the number of spaces in it at 11.5px in `dim` on the right. - Open group: its spaces below the header, indented 12px, each drawn exactly like an ungrouped row. Worktree rows stay under their repo inside the group. - Folded group: the header only, plus the space you are in if it is a member (the header then has the `selected` background). - A bad `groups.json`: its error in `blocked` color, 11px, at the end of the list. ## How it behaves - Automatic groups: the text before the first `-`, `_` or `.` (with text on both sides) is a space's prefix. 2 or more top-level spaces on one machine with the same prefix (case ignored) form a group named by the first one's prefix. - `groups.json` in the mod folder: `auto`, `min`, `separators`, `groups: {label: [patterns]}`, `ignore: [patterns]` (default `["~"]`). A pattern is a name with `*` for any text. Explicit groups win; a group listed there keeps even a single member. Saving the file reloads the mod. - A group takes the place of its first member; members keep their order. - Agent status: a folded group shows `●` in the `blocked` or `done` color when its most urgent space status (blocked > done > working > idle) is one of those. Working and idle show nothing, as in the shipped sidebar. - Click a header: fold or open it. Fold state is kept in `localStorage` (`groups.folded`, keys `/