## Change
Workspace pins are favorites: add a childless shortcut in the pinned
card, but keep the full
repository tree below unchanged, including pinned heads and pinned
worktrees.
- Keep drag, touch long-press and Alt+Up/Down reordering inside the
card; cross-card drops do nothing.
- Let every tree row reorder through herdr normally, regardless of
favorites.
- Give shortcuts separate DOM/reorder identities while keeping the
underlying workspace and selection
shared. Restore focus to the originating row, or its surviving tree row
when unpinning a shortcut.
- Keep shortcuts visible when their repository is collapsed, and open
rename only on the row used.
- Preserve pin keys, pin order, pruning and preference sync.
- Update DESIGN.md and consolidate the unreleased #1233/#1235 notes into
one final-behavior
`### Changed` fragment.
Owner: pins-favorites worker. Branch: `fix/pins-as-favorites`.
Worktree: `/tmp/tmp.IJc2hmd83H/wt`.
Start SHA: `811a4b9c`. Dependencies: none. Status: implemented and
locally verified.
## Validation
Every command used a private temporary/cache environment:
```sh
export TMPDIR=/tmp/tmp.IJc2hmd83H
export NODE_COMPILE_CACHE="$TMPDIR/node-compile-cache"
export BUN_RUNTIME_TRANSPILER_CACHE_PATH="$TMPDIR/bun-transpiler"
cd "$TMPDIR/wt"
```
### Unit: fail before / pass after
Updated the existing split expectations before changing the
implementation.
Command:
```sh
bun test src/lib/sidebarPins.test.ts
```
Before, on the original implementation at `811a4b9c`:
```text
(fail) adds favorite shortcuts without removing pinned heads or worktrees from the tree
(fail) keeps the full repository tree in source order when its head is a favorite
(fail) reorders favorite shortcuts and unpins a head without changing the original tree
11 pass
3 fail
UNIT_BEFORE_EXIT=1
```
After:
```text
14 pass
0 fail
33 expect() calls
Ran 14 tests across 1 file.
```
### Browser regressions: fail before / pass after
Both scripts ran exclusively through the isolated wrapper, with
`CHECK_MAX_RUNS=3`.
They build the real client over disposable demo fixtures, not the user's
live session.
```sh
CHECK_MAX_RUNS=3 bun run check run --build bun scripts/sidebar-activity-demo-regression.ts
CHECK_MAX_RUNS=3 bun run check run --build bun scripts/workspace-touch-reorder-demo-regression.ts
```
Before, with the new intact-tree assertions on the original
implementation:
```text
sidebar-activity-demo-regression.ts:
AssertionError: favorites keep the complete repository tree unchanged
FAILED run (7.9s)
ACTIVITY_BEFORE_EXIT=1
workspace-touch-reorder-demo-regression.ts:
AssertionError: favorites keep every repository head in the normal tree
actual: [ "w2t", "w1E", "w1F", "w1G", "w2s" ]
expected: [ "w1D", "w1C", "w1E", "w1F", "w1G", "w2s" ]
FAILED run (9.3s)
REORDER_BEFORE_EXIT=1
```
After, on the final source:
```text
sidebar-activity-demo-regression.ts:
PASS repository favorites add only a shortcut and preserve the full movable tree on desktop and phone
ok build (5.5s)
ok run (37.7s)
ACTIVITY_AFTER_EXIT=0
workspace-touch-reorder-demo-regression.ts:
PASS touch long press and Alt+Up/Down reorder favorites within the card, preserve the complete tree and herdr order, and survive reload
PASS desktop drag and Alt+Up/Down reorder favorites within the card, preserve the complete tree and herdr order, and survive reload
ok build (6.9s)
ok run (17.9s)
REORDER_AFTER_EXIT=0
```
The activity regression additionally covers pinned worktrees staying
nested, shortcut reorder,
collapsed-tree shortcuts, shared selection/aria-current, distinct DOM
IDs, pin/unpin focus return,
normal sibling reorder, and no duplicate rename editors. It runs the
favorite scenario in dark and
light themes at 1280px desktop and 390px phone widths.
The reorder regression covers touch and desktop card reorder, both
directions across the card edge,
normal tree reorder of a favorite repository with its worktree,
unchanged shortcut order during tree
moves, and saved pin order after reload.
Both final wrapper reports have `status: success`, exit code `0`,
`verification.status: verified`,
`source.unchanged: true`, and matching source fingerprints:
`ca8c8902503bebee7ed8c89389698e393204e4ee283bdadc4ab32c52c7f39435`.
Report IDs: `c46725d8-fd97-40a0-84bf-eb80bdccf25e` and
`644af18e-15f8-4d64-ae40-dad2875e6513`.
The scripts independently build their demo client from source; the
wrapper's generic
`browserCurrentSource` field is `not-claimed`.
### Other checks
```sh
bun run typecheck
bun test src/lib/sidebarPins.test.ts src/conventions.test.ts server/conventions.test.ts scripts/conventions.test.ts scripts/changelog-fold.test.ts
git diff --check
```
```text
$ tsc --noEmit && tsc --noEmit -p tsconfig.tools.json
FINAL_CHECKS_EXIT=0
51 pass
0 fail
123 expect() calls
Ran 51 tests across 5 files.
```
Screenshots inspected directly: `/tmp/tmp.IJc2hmd83H/evidence/`
(desktop/phone, light/dark,
plus card reorder). Full command logs:
`/tmp/tmp.IJc2hmd83H/{unit,activity,reorder}-{before,after}.log`
and `final-tests.log`. Native gate-review spawning was unavailable
because this worker is already
at the session's maximum subagent depth; the final diff was reviewed
directly instead.
Full CI and native Windows checks were not run locally. The production
build retains its existing
large-chunk warning.
Context decisions: a removed shortcut returns focus to its tree row; if
that worktree was hidden,
expand its repository to make the focus target visible. Preserve the
existing group-move contract
that moves a repository's worktrees alongside it in herdr order.
Change
Pinned workspaces stood in their card in pin order and could not be moved:
canLiftand the drag source refused every pinned row (fixedIds), so the only way to reorder was to unpin and pin again.A pinned workspace group can now be dragged (desktop) or lifted with a long press (touch) within the pinned card, and moved with the keyboard as the other rows. The drop rewrites the pin order (
reorderWorkspacePinsinsrc/lib/sidebarPins.ts, synced as pins already are), not herdr's workspace order. A pinned repository's worktrees move with it and are not moved on their own inside the card; a drop across the card's edge changes neither order. Unpinned rows reorder through herdr exactly as before. Pinned agents are unchanged: agent rows have no list reordering at all.DESIGN.md and
changelog.d/pinned-workspace-reorder.mdsay so.Validation
bun test src/lib/sidebarPins.test.ts: new cases forreorderWorkspacePins, pass.bun run check fast: exit 0.bun run check run --build bun scripts/workspace-touch-reorder-demo-regression.ts: exit 0. Covers desktop drag and touch long-press reordering inside the pinned card, the saved pin order surviving a reload, a pinned repository's worktree child moving with it, a drop across the pinned/unpinned edge being refused, and herdr's workspace order staying unchanged; the existing unpinned touch and keyboard cases still pass.