Workspace number follows creation order, but the sidebar renders grouped by space
Version: herdr 0.7.5 (stable, Homebrew), macOS 15 (Darwin 25.5.0), Ghostty
Summary
number is assigned in workspace creation order, while the expanded sidebar
renders workspaces grouped by their worktree space. The two orderings only agree
when a user happens to create all of one repo's workspaces consecutively.
Interleave work across two repos and the numbers shown in the expanded sidebar
are no longer monotonic, so they stop being usable as positional identifiers —
which matters most when the sidebar is collapsed and the number is the primary
handle you have.
Reproduce
- Open a workspace in repo A (
herdr worktree open).
- Open a plain workspace (
herdr workspace create, no repo).
- Open a workspace in repo B.
- Open a second worktree workspace in repo A.
- Expand the sidebar and read the numbers top to bottom.
Expected: 1, 2, 3, 4.
Actual: 1, 4, 2, 3 — grouping reorders the rows, numbering does not follow.
Observed
Seven workspaces, created interleaved across two repos. herdr workspace list
returns identical output with the sidebar expanded and collapsed:
number |
id |
label |
worktree.repo_name |
| 1 |
w1 |
intocare |
intocare |
| 2 |
w4 |
portal |
portal |
| 3 |
w6 |
intocare/ICP-19995-… |
intocare |
| 4 |
w7 |
navigation |
(none) |
| 5 |
w9 |
portal/ICP-20047-… |
portal |
| 6 |
wA |
intocare/ICP-20009-… |
intocare |
| 7 |
wB |
intocare/ICP-20006-… |
intocare |
Grouped by space, as the expanded sidebar renders them:
intocare → 1, 3, 6, 7
portal → 2, 5
(ungrouped) → 4
So the expanded sidebar reads 1, 3, 6, 7, 2, 5, 4 top to bottom, while the
collapsed rail reads 1, 2, 3, 4, 5, 6, 7. Same seven workspaces, two
orderings, never reconciled.
agent_panel_sort is at its default ("spaces"), and this is the workspace
section of the sidebar, not the agent panel.
number is clearly intended as positional rather than as a stable identifier:
closing a workspace renumbers every workspace after it (closing the workspace at
number: 2 moved the one at 3 to 2, 4 to 3, and so on). That's the right
behaviour for a positional index — it just tracks the wrong sequence.
Why it matters
switch_workspace is documented as an optional indexed binding
("prefix+shift+1..9"). Anyone who enables it and navigates by what they see in
the expanded sidebar will jump to the wrong workspace. Today the mismatch is
cosmetic only because that binding is unset by default.
Suggested fix
Assign number from the rendered order rather than creation order, so it always
matches what the sidebar shows, and renumber when grouping changes — the same
way it already renumbers when a workspace is closed.
Workspace
numberfollows creation order, but the sidebar renders grouped by spaceVersion: herdr 0.7.5 (stable, Homebrew), macOS 15 (Darwin 25.5.0), Ghostty
Summary
numberis assigned in workspace creation order, while the expanded sidebarrenders workspaces grouped by their worktree space. The two orderings only agree
when a user happens to create all of one repo's workspaces consecutively.
Interleave work across two repos and the numbers shown in the expanded sidebar
are no longer monotonic, so they stop being usable as positional identifiers —
which matters most when the sidebar is collapsed and the number is the primary
handle you have.
Reproduce
herdr worktree open).herdr workspace create, no repo).Expected: 1, 2, 3, 4.
Actual: 1, 4, 2, 3 — grouping reorders the rows, numbering does not follow.
Observed
Seven workspaces, created interleaved across two repos.
herdr workspace listreturns identical output with the sidebar expanded and collapsed:
numberworktree.repo_nameGrouped by space, as the expanded sidebar renders them:
So the expanded sidebar reads 1, 3, 6, 7, 2, 5, 4 top to bottom, while the
collapsed rail reads 1, 2, 3, 4, 5, 6, 7. Same seven workspaces, two
orderings, never reconciled.
agent_panel_sortis at its default ("spaces"), and this is the workspacesection of the sidebar, not the agent panel.
numberis clearly intended as positional rather than as a stable identifier:closing a workspace renumbers every workspace after it (closing the workspace at
number: 2moved the one at 3 to 2, 4 to 3, and so on). That's the rightbehaviour for a positional index — it just tracks the wrong sequence.
Why it matters
switch_workspaceis documented as an optional indexed binding(
"prefix+shift+1..9"). Anyone who enables it and navigates by what they see inthe expanded sidebar will jump to the wrong workspace. Today the mismatch is
cosmetic only because that binding is unset by default.
Suggested fix
Assign
numberfrom the rendered order rather than creation order, so it alwaysmatches what the sidebar shows, and renumber when grouping changes — the same
way it already renumbers when a workspace is closed.