Skip to content

Pin projects in the sidebar and close a project's panes before removing it - #109

Merged
yansfil merged 14 commits into
mainfrom
prd/hide-sidebar-pinning
Sep 19, 2026
Merged

yansfil merged 14 commits into
mainfrom
prd/hide-sidebar-pinning

Conversation

@yansfil

@yansfil yansfil commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Registered projects can be pinned from the row menu (⋯ or right-click): a Pinned N section leads the Projects list above Projects · Recent activity, pinned rows keep activity order among themselves, and a pinned project never falls into the Inactive projects fold. The flag lives on WorkspaceRegistration and survives relaunch; older stores load unpinned.
  • Remove project… replaces the old refusal for a project with open panes. The confirmation names what the close will send (Closes 3 panes (1 running agent).) and the core closes those panes through Herdr, waits for the confirmation, and only then removes the registration. A timeout or refusal keeps the project registered with the reason in the status banner, and the same command retries from the panes that remain.
  • Removing the project that holds the focused checkout moves focus and the pane selection to the next project, the way a Herdr restart does; without this the shell reported pane.projection_unavailable on every sync until the operator clicked elsewhere (found live, fixed in b6d21b4).
  • Section headers are rows of the one sidebar list, so pinning moves a row in place instead of removing and reinserting it, and the list reveals the Pinned header when it first appears (the two-ForEach version left the list scrolled past it).
  • design/hide.pen: Screen / Sidebar / Projects gains the pin-0, Pinned 2, row-menu and Remove project… states drawn from the existing masters; the five Scratch / boards that rode the branch base are deleted. DESIGN.md, docs/README.md and docs/PERFORMANCE_TESTING.md are updated with the behavior.

Related

Result

  • A registered project can be pinned and unpinned from its row menu; a Pinned N section leads the Projects list while any exist, ordered by activity, never folded, and the flag survives relaunch.
  • Remove project… on a project with panes confirms with the pane and running-agent counts, closes the panes through Herdr, and removes the registration only after Herdr confirms; the project stays registered with the reason visible on timeout, refusal, or no live connection.
  • Removing the focused project moves focus to the next project instead of leaving a dangling selection.
  • Not included (PRD non-goals): deleting files, worktrees or Herdr workspaces; pinning a remote project or a temporary folder row; a progress indicator while the close is in flight.

Screenshots / Demo

No inline images: the screenshots are registered run artifacts under agents/runs/hide-sidebar-pinning/live/shots/ (local-only by repository rule, see AGENTS.md "Evidence Belongs Outside The Repository"), and this session had no channel to upload GitHub user attachments. What each shows is written out under Evidence below and in the artifact descriptions in state.json; the design target is the Screen / Sidebar / Projects board in design/hide.pen (states Pinned 2, Row menu, Remove project…).

Human Review Focus

  • 사람이 판단할 것: dialog copy defaults not spelled out by the PRD: Closes N pane(s) (M running agent(s)). with the parenthetical omitted at 0 running agents, Close N pane(s) and remove; "running" means the agent's activity axis says working. Row-menu order Pin/Unpin, divider, Refresh GitHub status, New worktree…, divider, Remove project…. Pin and Remove are offered only for local registrations (a remote project is the device's own; a temporary folder row has nothing to store the pin in).
  • 위험한 파일: herdr-core/src/runtime/projects.rs (remove_workspace, ingest_workspace_close_result, retire_workspace_registration: the in-flight set and the focus hand-off), herdr-core/src/worktree_control.rs (spawn_workspace_close reuses the worktree close-then-confirm thread), herdr-core/src/sidebar.rs (removal counts on the per-sync summary pass), macos/Sources/HerdrMacOS/SidebarList.swift (revealTopRowID scroll).
  • 리뷰어에게 묻는 것: the focus hand-off after removing the focused project picks the first existing checkout in list order (resync_navigator_focus), which is the first pinned project when one exists. Is that the order you want, or should it prefer the most recently active project?

Risk surface

  • Runtime mutex: the pane close runs on the herdr-core-workspace-close thread (same shape as worktree removal) and re-enters the runtime once with the result; under the lock the removal path only mutates snapshot vectors and queues the off-lock state save. Removal counts are computed on the existing per-sync summary pass, one pass over the checkout pane lists.
  • Ownership: Herdr owns pane existence, so the registration is retired only after Herdr confirms every pane is gone (confirmation_state over session.snapshot); the pin is core-owned UI state persisted to the app state file.
  • Herdr contract: pane.close and session.snapshot only, both in contracts/herdr-api.schema.json for the pinned v0.9.1.
  • Failure path: a close timeout or refusal sets workspace.remove_failed in the status banner ("… The project stays registered; remove it again to close the panes that remain."); removing with panes and no live connection sets the same kind with "needs a live Herdr connection"; pinning an unregistered id sets workspace.pin_unregistered. Every transition emits a workspace.pinned|unpinned|unregistered diagnostic and remove.close_requested names the pane ids.

Evidence

  • 확인한 것: bash scripts/verify-cargo.sh test (561 lib tests + workspace crates), bash scripts/verify-swift.sh test (448 tests), bash scripts/verify-cargo.sh lint, every check-* lane in CONTRIBUTING.md, node scripts/check-design-contract.mjs (canvas: Screen 25, Scratch 0), python3 -m unittest discover -s scripts/tests (38). Live, against a private Herdr 0.9.1 server (HERDR_SOCKET_PATH=/tmp/hsp/h.sock, isolated HOME and XDG dirs, four fixture projects: alpha with 3 panes and two long-running processes, bravo with 1 pane, charlie 14d and delta 18d inactive) in the dev app built by macos/scripts/build_dev_app.sh, input bound to that PID: pin from the ⋯ menu and from right-click; Pinned 1 appears and the header is the first row after relaunch; unpin returns today's screen; pinning the folded charlie takes it out of Inactive projects 2 into Pinned 1; two pins order alpha (18m) above charlie (14d); a pinned row's menu says Unpin; Remove project… on alpha shows Closes 3 panes. The folder, repository, and worktrees stay on disk. / Close 3 panes and remove; after confirming, herdr pane list holds only w2:p1 and ps finds neither hsp-longrun process (PRD Risk 1: the pane close ended the PTY and the processes in it, no survivors); Remove project… on a project with no panes shows the registration-only copy; removing the focused project lands on the next project with its pane projected.
  • 확인하지 못한 것과 그 이유: a Herdr close timeout or refusal in the live app (only unit-tested; the private server closed every pane within the timeout). A remote device's project rows (no remote target in the isolated setup; the menu gating is unit-tested through the presentation policy only by code reading). A pane with a running agent in the dialog count (the fixtures ran plain shells, so the live dialog always showed 0 running agents; the (1 running agent) copy is covered by removalPromptNamesThePanesAndAgentsItCloses and the count by removing_a_registration_with_panes_closes_them_and_removes_only_on_confirmation).
  • 화면 증거: the screenshots are registered in the local run directory (agents/runs/hide-sidebar-pinning/live/shots/, local-only by repository rule) and described above; no upload channel for GitHub user attachments was available from this session, so none are inline.

Product And Scope Result

  • PRD: agents/prd/hide-sidebar-pinning/prd.md
  • Implementation state: agents/runs/hide-sidebar-pinning/state.json
  • Verification report: agents/runs/hide-sidebar-pinning/verification-report.json (status: PASS)
  • Verification summary: agents/runs/hide-sidebar-pinning/verification-report.md

Actual Tests

  • S1: GREEN - bash scripts/verify-cargo.sh test (cwd: ., exit 0)
  • S2: GREEN - bash scripts/verify-swift.sh test (cwd: ., exit 0)
  • S3: GREEN - bash scripts/verify-cargo.sh lint (cwd: ., exit 0)

Actual Observations

  • agents/runs/hide-sidebar-pinning/live/shots/13b-charlie-menu.png (screenshot, observed 2026-09-19T04:39:11.475Z, sha256 408a39a7c72dad1745ab3343af8578f4325cde968a2060eb548471e8dde8df29): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/shots/13e-charlie-pinned.png (screenshot, observed 2026-09-19T04:39:11.782Z, sha256 8945fa92bb8289be1e2efbe128479fe12120c1907691d54527cdc780b7f45f2c): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/shots/14b-pinned-two.png (screenshot, observed 2026-09-19T04:39:12.150Z, sha256 e4ea63e32c5095f33da156f70bc60358967038364f61ed9fc67abd58a1ae1ef6): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/shots/15a-alpha-menu.png (screenshot, observed 2026-09-19T04:39:12.489Z, sha256 ac8dee2309a153a569eed9df47db334f0a5d01f885cc8cdb06680cb13d6531a7): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/shots/15b-remove-dialog.png (screenshot, observed 2026-09-19T04:39:12.825Z, sha256 674012843bd21c341a78c5512552a72542c52d71c8f2878c95dcc137eb719f41): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/shots/15c-after-remove.png (screenshot, observed 2026-09-19T04:39:13.163Z, sha256 d37c1712dd6f49877fb4310cc2f48f0ce65d75f7853dd0b6268d73017c79f1a3): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/shots/16b-remove-nopane-dialog.png (screenshot, observed 2026-09-19T04:39:13.498Z, sha256 c411e708c062c1f42f1cdf4f9084dac23edd18ad8218d8cde67fa247695684d2): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/shots/18b-after-remove-focused.png (screenshot, observed 2026-09-19T04:39:13.841Z, sha256 15adb3b4f7f98187262e941f80624c24faf5dcd54bc574664eee98116374c1cf): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/shots/15d-after-remove-wide.png (screenshot, observed 2026-09-19T04:39:14.174Z, sha256 99e5967a213ff95af7faf79a49343bde9b4cadda6ee50847aae05c1ccef570ec): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/remove-after-panes.txt (log, observed 2026-09-19T04:39:14.507Z, sha256 44fcb64c4dcf91c6ec51ef354bddbd5f4fc36f9c40c87bffa85d6ccf7963668f): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/remove-before-ps.txt (log, observed 2026-09-19T04:39:15.199Z, sha256 dbbfe86c344ccbe492f8819c29622a998235452b426f02485eff74478956ea7f): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/process-survival.txt (log, observed 2026-09-19T04:39:27.439Z, sha256 9b2deb6199cc3c266aa88538403d7dcf8c8946b813441c6b62f1c196c242056f): ps -eo pid,command and herdr pane list against the private server
  • agents/runs/hide-sidebar-pinning/live/shots/08b-pin-alpha-unified-rows.png (screenshot, observed 2026-09-19T04:39:37.964Z, sha256 384e2008ad8c4dbc9068338fb8b142b77544bce98ef74ec8f6886b93d7da9c81): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/shots/11-relaunch-pinned-reveal.png (screenshot, observed 2026-09-19T04:39:38.318Z, sha256 434c7488a529bb34433681499fb776b7622a1aa4aa93dfac4852f3bf188b6bbf): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID
  • agents/runs/hide-sidebar-pinning/live/shots/12b-alpha-unpinned.png (screenshot, observed 2026-09-19T04:39:38.670Z, sha256 b9f505bc427d1c91f85f8cdf3b229eaa8dd15e88f76d37f9789a22a9d4ad3ff8): screencapture -R on the candidate window; input via CGEvent bound to the candidate PID

Deterministic Verification

  • Deterministic verification: PASS
  • PRD SHA: 587af69a9e8194a663292388c1a65a9793b793f5867b89ae616a6be5cdb9a175
  • Base SHA: 2c3c39b
  • Head SHA: 11f1aa8
  • Source fingerprint: 054468945e73520b6dd0f6f74d796d26e7c8ac750b2f8bd33c6f7ca23ccdbe39
  • Generated: 2026-09-19T05:09:24.716Z
  • Agent reviews are visible advisory notes produced by native runtime subagents.

Agent Review: Fix Now

Review availability: Fidelity and Code reviews ran as native subagents on b6d21b4, again on 950f4ae, confirmed on 680ef9d, and confirmed the origin/main merge at 11f1aa8. No Security review (the PRD is not tagged high-risk).

Fidelity verdicts at 680ef9d: B1-B8 met, B9 met (code inspection only), B10-B14 met, B15 met (by design, not re-tested), B16 met (code inspection, no VoiceOver capture), B17-B20 met.

  • Code, Medium (b6d21b4): re-registering the same folder while its removal close was in flight got silently retired with it (registration ids are path-keyed, so ⇧⌘N on that folder named the entry the retire was about to delete). Disposition: fixed in 950f4ae. CreateWorkspace refuses a folder whose removal is in flight (workspace.remove_in_flight), remove_workspace refuses a project whose creation is in flight (workspace.create_in_flight), and a creation that lands anyway cancels the removal with workspace.remove_cancelled so the close's late answer authorizes nothing. Tests adding_a_folder_while_its_removal_closes_panes_is_refused_and_a_landed_add_cancels_it and removing_a_project_whose_creation_is_in_flight_is_refused. Both reviewers confirmed the fix on the re-review of 950f4ae.
  • Found live, before the reviews (fixed in b6d21b4): removing the project that held the focused checkout left pane.projection_unavailable on every sync ("Selected pane w1:p3 is not available for the selected checkout") and an empty Overview. The retire path now drops the focus and pane selection with the project, as consume_restore_hint does after a Herdr restart; test removing_the_focused_project_moves_focus_off_its_closed_panes, live re-check in the rebuilt app (bravo came forward with w2:p1).
  • No Fix now item remains at 680ef9d (Fidelity and Code both "None").

Agent Review: Follow-up Improvements

Advisory, outside the current contract:

  • Code: spawn_worktree_close / spawn_workspace_close (herdr-core/src/worktree_control.rs) never release their in-flight marker if runtime.lock() returns Err (a poisoned mutex, pre-existing pattern shared by every worker callback); fix once across them, e.g. unwrap_or_else(PoisonError::into_inner).
  • Code: project_base_branches (herdr-core/src/model.rs) is never pruned when a registration is removed (pre-existing gap); retire_workspace_registration is now the natural place.
  • Code: catalog_roots / worktree_catalog stay transiently stale after a removal until the next sync (deliberate, avoids git under the lock; self-heals via resync_navigator_focus).
  • Code: no snapshot field mirrors workspace_removals_in_flight, so the row shows nothing while the close runs (PRD non-goal: no progress UI).
  • Fidelity: B9 (no Pinned section in remote navigation) holds because the remote wire never sends pinned and the DTO defaults to false; there is no dedicated test or screenshot for the remote path.
  • Fidelity: B16 (VoiceOver) is plausible by construction (standard Button/Menu/Alert, the pre-existing HideSectionLabel) but was not captured with VoiceOver.
  • Fidelity: the three new set_error calls pass retryable: false; nothing in the shell keys the banner on it today.
  • Fidelity: the in-flight refusals in 950f4ae are not itemized as a B-line; they serve D-11 ("no half-removed state") and contradict no decision, flagged for traceability.

Delivery Staging

  • Mode: pr
  • Branch: prd/hide-sidebar-pinning (delivery config names gen-prd/hide-sidebar-pinning; the verified head is what is pushed)
  • Base: main (0 behind at 11f1aa8)
  • Staging include: default allowlist
  • Staging exclude: default volatile paths

Changed Paths Planned For This PR

  • DESIGN.md
  • design/hide.pen
  • docs/BROWSER_PANES.md
  • docs/PERFORMANCE_TESTING.md
  • docs/README.md
  • herdr-core/src/files.rs
  • herdr-core/src/live.rs
  • herdr-core/src/model.rs
  • herdr-core/src/persistence.rs
  • herdr-core/src/project_context.rs
  • herdr-core/src/runtime.rs
  • herdr-core/src/runtime/editor.rs
  • herdr-core/src/runtime/events.rs
  • herdr-core/src/runtime/projects.rs
  • herdr-core/src/runtime/session.rs
  • herdr-core/src/runtime/tests.rs
  • herdr-core/src/runtime/tests/agents_settings_remote.rs
  • herdr-core/src/runtime/tests/editor_preview.rs
  • herdr-core/src/runtime/tests/editor_reopen.rs
  • herdr-core/src/runtime/tests/projects.rs
  • herdr-core/src/runtime/tests/session_navigation.rs
  • herdr-core/src/session_sync/replica.rs
  • herdr-core/src/sidebar.rs
  • herdr-core/src/workspace.rs
  • herdr-core/src/worktree_control.rs
  • herdr-core/tests/ffi_contract.rs
  • macos/Sources/HerdrMacOS/BrowserPaneOpener.swift
  • macos/Sources/HerdrMacOS/CoreBridge.swift
  • macos/Sources/HerdrMacOS/CoreBridgeEditorSnapshot.swift
  • macos/Sources/HerdrMacOS/CoreBridgeSnapshot.swift
  • macos/Sources/HerdrMacOS/CoreBridgeWorkspaceSnapshot.swift
  • macos/Sources/HerdrMacOS/EditorViewerOverlay.swift
  • macos/Sources/HerdrMacOS/HerdrApp.swift
  • macos/Sources/HerdrMacOS/HideEnvironment.swift
  • macos/Sources/HerdrMacOS/HideMainView.swift
  • macos/Sources/HerdrMacOS/HideSidebar.swift
  • macos/Sources/HerdrMacOS/HideTheme.swift
  • macos/Sources/HerdrMacOS/PDFDocumentView.swift
  • macos/Sources/HerdrMacOS/RightPanel.swift
  • macos/Sources/HerdrMacOS/ShellMenuCommand.swift
  • macos/Sources/HerdrMacOS/ShellModel.swift
  • macos/Sources/HerdrMacOS/ShellModelNavigation.swift
  • macos/Sources/HerdrMacOS/ShellRootView.swift
  • macos/Sources/HerdrMacOS/SidebarList.swift
  • macos/Sources/HerdrMacOS/SidebarPresentation.swift
  • macos/Sources/HerdrMacOS/WorkspaceOutlinePresentation.swift
  • macos/Sources/HerdrMacOS/WorkspaceOutlineView.swift
  • macos/Sources/HerdrMacOS/WorktreeTasks.swift
  • macos/Tests/HerdrMacOSTests/BrowserPaneOpenerTests.swift
  • macos/Tests/HerdrMacOSTests/EditorPreviewTabPresentationTests.swift
  • macos/Tests/HerdrMacOSTests/PDFDocumentViewTests.swift
  • macos/Tests/HerdrMacOSTests/RightPanelPresentationTests.swift
  • macos/Tests/HerdrMacOSTests/SidebarPresentationTests.swift
  • macos/Tests/HerdrMacOSTests/WorkspaceOutlineEditingTests.swift
  • macos/Tests/HerdrMacOSTests/WorkspaceOutlinePresentationTests.swift
  • macos/Tests/HerdrMacOSTests/WorktreeTaskTests.swift
  • plugins/browser/browser-pane.mjs
  • plugins/browser/browser-pane.test.mjs
  • scripts/check-core-bridge-structure.py
  • scripts/pen-token-map.json

Risks, Rollback, And Human Review

  • Runtime mutex: the pane close runs on the herdr-core-workspace-close thread and re-enters the runtime once with the result; under the lock the removal path mutates snapshot vectors and queues the off-lock state save; removal counts ride the existing per-sync summary pass (one pass over the checkout pane lists, local registrations only). The in-flight checks compare stored registration paths and never canonicalize under the lock.
  • Ownership: Herdr owns pane existence, so the registration is retired only after Herdr confirms every pane is gone (confirmation_state over session.snapshot); the pin is core-owned UI state persisted to the app state file.
  • Herdr contract: pane.close and session.snapshot only, both in contracts/herdr-api.schema.json for the pinned v0.9.1 (check-herdr-contract.sh --schema-only passes against the installed binary).
  • Failure path: close timeout or refusal → workspace.remove_failed ("… The project stays registered; remove it again to close the panes that remain."); no live connection with panes → same kind, "needs a live Herdr connection"; add during removal → workspace.remove_in_flight; remove during add → workspace.create_in_flight; add landing during removal → workspace.remove_cancelled; pin of an unregistered id → workspace.pin_unregistered. Diagnostics: workspace.pinned|unpinned|unregistered, remove.close_requested with pane ids, workspace.create.refused_during_removal.
  • Rollback: revert the merge commit; the persisted pinned flag is #[serde(default)] on both sides, so a build without it reads the state file unchanged and a build with it reads an older file as unpinned.
  • Not run: a Herdr close timeout or refusal in the live app (unit-tested only); a remote device's rows (no remote target in the isolated setup); the (N running agents) dialog copy live (fixtures ran plain shells; covered by removalPromptNamesThePanesAndAgentsItCloses); VoiceOver.
  • Diff note: "Changed Paths Planned" below lists the whole span from the run's baseline 2c3c39b, which includes the paths that arrived with the origin/main merge (Open PDFs in the file viewer and add Explorer open items for the default app and a browser pane #107 and Open Explorer single clicks in a replaceable preview tab #108: BrowserPaneOpener, PDFDocumentView, WorkspaceOutline*, editor preview tab files, docs/BROWSER_PANES.md, plugins/browser, herdr-core/src/files.rs, ffi_contract.rs). The review diff against main is git diff origin/main...HEAD (31 source files + design/hide.pen).

AI tooling

  • 사람이 직접 작성 - [ ] 일부를 AI 도구로 작성 - [x] 대부분을 AI 도구로 작성

손으로 확인한 것: every live observation above was made on the running dev app and read from screenshots and herdr pane list / ps output, not inferred from code.

…ts registration

A registration carries a pinned flag that survives a relaunch and loads
unpinned from an older state file. The project sort keeps device first,
then pinned, then activity, and a pinned project is exempt from the
device's inactive fold. workspace_pin_set moves the row in place,
refuses an unregistered id, and treats the same value as a no-op.

remove_workspace no longer refuses a project with open panes. It sends
pane.close for every pane in the project's checkouts from a worker
outside the runtime mutex and removes the registration only once Herdr
confirms them gone; a timeout keeps the registration and reports
workspace.remove_failed, and a retry continues from the panes that
remain. The snapshot carries the pane and running-agent counts the
confirmation names.
…l dialogs on the Screen / Sidebar / Projects board

The board gains a Pinned 2 state beside the pin 0 project fold state,
the shared row menu with Pin/Unpin and Remove project…, and both
removal dialogs, all as refs of the existing section, project row and
fold masters. The Scratch boards are deleted: the sidebar pinning
scratch is now this board, and the Overview restructure scratch that
rode in with the branch base lives on design/overview-scratch-2026-09-19.
DESIGN.md's Projects and checkout context section carries the Pinned
section rules, the shared row menu, the persisted pin, the fold
exemption and the remove flow that closes panes before the
registration goes; the documentation map and the performance guide
name the new owners and regression tests.
…nd confirm removal with the core's pane counts

The sidebar splits the core's ordered projects into a Pinned section,
drawn only while a project is pinned, and the activity list whose
header now counts the rest. Registered project rows offer Pin/Unpin
and Remove project… from both the ⋯ menu and a new context menu; a
temporary folder row offers neither. The removal alert reads the
pane and running-agent counts the core reports and names them in the
message and the destructive button, keeping the registration-only
copy for a project without panes.
The Projects list drew the Pinned section and the activity section as two
ForEach groups, so pinning a project removed its row from one and inserted
it into the other, and the List kept its scroll offset past the new header.
Section headers are now rows of one list, so a pinned project moves in
place, and the list reveals the Pinned header when it first appears.
Removing the project that held the focused checkout left the shell on a
checkout no catalog carried; every sync then reported the closed pane as
unavailable instead of showing the next project. The retire path now drops
the focus and pane selection with the project, the way a Herdr restart
does, so the next checkout comes forward.

The removal gate counts only local registrations: a remote tree arrives
freshly projected on every sync, and a count written into it read as a
change on every tick. The row menu offers Pin and Remove project only for
a local registration, which is the only kind the core can act on.
A registration id is keyed by the folder, so a folder added back while
`Remove project…` was still waiting for Herdr named the entry the retire
was about to delete, and the confirmation then removed the operator's
re-added project without a word. The create event now refuses a folder
whose removal is in flight, removal refuses a project whose first pane is
still being opened, and a creation that lands anyway cancels the removal
and says so, so the project it opened a pane in stays registered.

The confirm button node in the registration-only dialog frame on the
design canvas is named after its content.
@yansfil
yansfil merged commit 958aad8 into main Sep 19, 2026
7 of 9 checks passed
@yansfil
yansfil deleted the prd/hide-sidebar-pinning branch September 19, 2026 13:10
yansfil added a commit that referenced this pull request Sep 20, 2026
## Summary

- The Overview is one list: the project's worktrees as groups, each
holding the agents working in it, under a stat strip of derived project
facts. The Git ancestry graph, the two inspectors, the summary rows, the
Tasks/Git toggle and the Needs You bar are gone, with their graph
tokens, lane colours, canvas variables,
`overview_select`/`overview_changes` events and `history` snapshot
field.
- Stat strip: row 1 is always `N GB on disk` (opens the existing disk
popover) and `⑂ N open PRs` (opens the existing GitHub popover, zero
drawn); row 2 holds `<base> ↓N behind origin` and `N merged to clean up`
only when there is something to act on. One glyph language everywhere: a
number, `…` while reading, `?` when unreadable, absence when not
applicable; reasons live in tooltips and popovers.
- Group header: `▾ ⎇ branch` on the left, opening the workspace; a mono
micro line `<N files|Clean> · <↑a ↓b> · <size> · <#PR>` on the right
with zero sides omitted, behind in the warning colour, and the pull
request chip as the bundled octicon in its state colour. The `N files`
chip opens that checkout on History through one core event,
`overview_open_section`. Long branch names truncate on the left.
- Rows: mark · badge · name · task · `↗`, a click shows the pane; a
delegated child is indented `↳` under its parent, and a child working in
another worktree stands in its own group with `↳ from <parent> · <parent
branch>`. An empty group reads `No agent · Start agent…`; the header
menu's `New agent here ▸ Terminal only / Claude / Codex` and that row
share the new `agent_start_in_checkout` core event, which creates a tab
in the checkout's workspace through the existing task-operation slot and
starts the provider on the `startAgentInCreatedPane` path.
- Order is fixed: primary checkout, then linked worktrees oldest first
by the `.git/worktrees/<name>` creation time (new `created_at_unix_ms`),
then the `› Inactive N` fold sharing the sidebar's state. Search matches
name, task and branch and keeps rows with their group header.
`behind_upstream` rides the existing `rev-list --left-right --count
@{u}...HEAD` call, so no git process was added.
- The Changes tab is labelled History; its body is unchanged (PR 2).
DESIGN.md, ARCHITECTURE.md, PERFORMANCE_TESTING.md, README.md,
CONTRIBUTING.md and the workflow review carry the new contract; the
Overview gate scripts assert the new states; the unused
`HideDisclosureStyle` is removed.

## Result

A reviewer can open the Overview of any registered project and see the
list described above, click a row to show its pane, click the header to
open the workspace, click `N files` to land on History for that
checkout, open the disk and GitHub popovers and the cleanup sheet from
the strip, start an agent in a worktree from the header menu or the
empty-group row, search, and fold Inactive. A plain folder project shows
only its size. When Herdr is unreachable the caption `⚡ Live task status
unavailable; showing the last known agents` sits above the search and
the last rows stay clickable.

Not included: the History body (PR 2, `right-panel-history`), any fetch
(behind is read only), and any change to the sidebar or the pane header.

## Screenshots / Demo

No inline images. The captures are registered run artifacts under
`agents/runs/right-panel-overview/artifacts/live/shots/` (local-only by
repository rule, AGENTS.md "Evidence Belongs Outside The Repository"),
and they show the workstation's user and host name in the terminal
prompt, which this public repository must not carry; there was no
user-attachment upload channel from this session. What each shows is
written out under Evidence, and the design target is the `Screen / Panel
/ Overview`, `Screen / Overview / States` and `Screen / Overview /
Actions` boards in `design/hide.pen`.

## Human Review Focus

Proven by the recorded evidence: the strings and layout of every state
on a six-worktree fixture (Git project with an origin two commits ahead,
dirty and ahead worktrees, two merged, one long branch name, a plain
folder project), row click, header click, files chip to History,
popovers and sheet, `New agent here ▸ Claude` creating a tab and
starting the agent, search keep and no-match, the Inactive fold, the
disconnected caption, and the reader cost (0 git commands over 60 s
idle; 67 commands in about 1 s per detected change).

Still for a reviewer:
- Product interpretation: the subtitle omits `· M inactive` at zero
(design rule 13, no explicit PRD line); a group's chevron folds its rows
and shares the sidebar's collapsed set, an affordance the PRD did not
spell out; a search lists a matching inactive checkout as a header line
among the groups and hides the fold while searching.
- Copy: the disconnected caption wraps to two lines at the default panel
width; `Clear search` uses the regular text button.
- Risky files: `herdr-core/src/runtime/projects.rs`
(`agent_start_in_checkout` picks the session workspace from the
checkout's visible tabs, then any tab, and refuses without a live
connection) and `herdr-core/src/worktree_control.rs`
(`create_checkout_tab` chooses `tab.create` when the checkout has a
Herdr workspace and `workspace.create` otherwise).
- Not exercised live: the pull request chip and the `⑂ N` count with a
signed-in `gh` (the fixture has no GitHub remote; covered by
`OverviewPresentationTests`), the header and row context menus (SwiftUI
context menus could not be opened through accessibility in the
background; item lists and order are asserted by
`menusListTheAgreedItemsInOrder`), `Reveal in sidebar`, `Copy pane id`,
`Close pane…`, and `Delete worktree…` from the Overview.
- Question: should an inactive checkout that still holds a delegated
child pane (the fixture's `prd/hide-orchestrator…`) be inactive at all?
The Overview mirrors the sidebar's classification, so the child appears
nowhere in the Overview while its parent's group shows only the sibling.

## Product And Scope Result

- PRD: agents/prd/right-panel-overview/prd.md
- Implementation state:
/Users/hoyeonlee/projects/herdr-ide/agents/runs/right-panel-overview/state.json
- Verification report:
/Users/hoyeonlee/projects/herdr-ide/agents/runs/right-panel-overview/verification-report.json
(status: PASS)
- Verification summary:
/Users/hoyeonlee/projects/herdr-ide/agents/runs/right-panel-overview/verification-report.md

## Actual Tests

- S1: GREEN - `bash scripts/verify-cargo.sh test` (cwd: ., exit 0)
- S2: GREEN - `bash scripts/verify-swift.sh test` (cwd: ., exit 0)
- S3: GREEN - `bash scripts/verify-cargo.sh lint` (cwd: ., exit 0)

## Actual Observations

- agents/runs/right-panel-overview/artifacts/live/timing-summary.md
(log, observed 2026-09-19T15:30:25.776Z, sha256
7bbfceeb9c7e684f8ea0556d874e7405a8f412704ec3efb6f37c890857cf2cde):
GIT_TRACE on the dev app, passes grouped by 1 s gaps
-
agents/runs/right-panel-overview/artifacts/live/shots/03-overview-orchestra.png
(screenshot, observed 2026-09-19T15:30:42.031Z, sha256
dc011bd35741a54d9303c4d53767f5523f767c8ac93e87cc2c8d3649e3d9a66b):
peekaboo exact-window background capture of the dev app window
-
agents/runs/right-panel-overview/artifacts/live/shots/10-relaunch-inactive-order.png
(screenshot, observed 2026-09-19T15:30:42.408Z, sha256
f6cb2c6ede9cfd94cfc1392f01826b4e369bd02651747f872485e7b8299f3922):
peekaboo exact-window background capture of the dev app window
-
agents/runs/right-panel-overview/artifacts/live/shots/11-folder-project.png
(screenshot, observed 2026-09-19T15:30:42.771Z, sha256
2d0356d603b3739f02411f1bf5f3eef2f88313934fa3f84a4054e05f6926b237):
peekaboo exact-window background capture of the dev app window
-
agents/runs/right-panel-overview/artifacts/live/shots/05-search-review.png
(screenshot, observed 2026-09-19T15:30:43.118Z, sha256
99dfd889dee5dd02b786a759ea311e077479b69c90076a2c2a15343d0e2cd4fa):
peekaboo exact-window background capture of the dev app window
-
agents/runs/right-panel-overview/artifacts/live/shots/06-search-no-match.png
(screenshot, observed 2026-09-19T15:30:43.473Z, sha256
23cf5ade2910aaac8af48e6389d7c7cb673c42e98aa864d3212ad3296bc1186c):
peekaboo exact-window background capture of the dev app window
-
agents/runs/right-panel-overview/artifacts/live/shots/07-row-click-focuses-pane.png
(screenshot, observed 2026-09-19T15:30:43.822Z, sha256
7aeb4d7f0c07ddb1aba6331902cb3c8fa5eb262a17c754249ffb60410148407f):
peekaboo exact-window background capture of the dev app window
-
agents/runs/right-panel-overview/artifacts/live/shots/08-files-chip-opens-history.png
(screenshot, observed 2026-09-19T15:30:44.169Z, sha256
3d545b80a4f903ecd0832419b1101f493650f2238981e4206b7e5adeca8bf790):
peekaboo exact-window background capture of the dev app window
-
agents/runs/right-panel-overview/artifacts/live/shots/12-start-agent-menu.png
(screenshot, observed 2026-09-19T15:30:44.525Z, sha256
c9ad5fb43bb1503b1a5942a04c105a0bb2e971f877a4d170cdcfc42b858f19f6):
peekaboo exact-window background capture of the dev app window
-
agents/runs/right-panel-overview/artifacts/live/shots/13-agent-started-in-gamma.png
(screenshot, observed 2026-09-19T15:30:44.868Z, sha256
f05b8c11d862f31d73900a5704cb92edeef72730a978fc2d6c1f22581f32417e):
peekaboo exact-window background capture of the dev app window
-
agents/runs/right-panel-overview/artifacts/live/shots/14-disk-popover.png
(screenshot, observed 2026-09-19T15:30:45.202Z, sha256
4916606e48fe7bb99c7946c22a7b06dddf5cf9ab571b54ebe12024f0ce7faeaa):
peekaboo exact-window background capture of the dev app window
-
agents/runs/right-panel-overview/artifacts/live/shots/15-cleanup-sheet.png
(screenshot, observed 2026-09-19T15:30:45.555Z, sha256
39ba767d5409e50de55b11f247cce805986df774d182463eb072d6647d50d900):
peekaboo exact-window background capture of the dev app window
-
agents/runs/right-panel-overview/artifacts/live/shots/16-disconnected.png
(screenshot, observed 2026-09-19T15:30:45.917Z, sha256
6a811148eb1de19baa65f7f704e4a003f9bcbe634e404e6b2124eb557e56beb1):
peekaboo exact-window background capture of the dev app window

## Deterministic Verification

- Deterministic verification: PASS
- PRD SHA:
f1d4434cdadeb687c25e136efa2bcb7f7955a3634c05de6d44f8bf2680f934c1
- Base SHA: 958aad8
- Head SHA: 2c3b6ab
- Source fingerprint:
d41d3ba8829835e7d8d9139c96d03437b25cb7fd5aba71d570befc8876290c1c
- Generated: 2026-09-19T15:47:12.243Z
- Agent reviews are visible advisory notes produced by native runtime
subagents.

## Agent Review: Fix Now

Fidelity and Code reviews ran for head 34b5f65 and again for 2c3b6ab
(same tree as 98bebf5). Both raised one finding, fixed in 2c3b6ab:
- `WorktreeMenuPolicy.overviewHeaderItems`
(`macos/Sources/HerdrMacOS/WorktreeTasks.swift`) was dead code whose
order disagreed with B12/D-10 and with the menu the view builds;
deleted. The menu's order is stated once, by
`OverviewPresentation.headerMenuItems`, and asserted by
`menusListTheAgreedItemsInOrder`.
Also folded in from the Code review's follow-ups: the inert
`#[serde(default)]` on the Serialize-only
`WorktreeSnapshot.behind_upstream` removed; the
`check-right-panel-sections.sh` header comment says History. Re-review
at 2c3b6ab: Fix now `None` from both reviewers.

## Agent Review: Follow-up Improvements

From the Fidelity review, for a human to confirm rather than change now:
- `OverviewPresentation.subtitle` omits `· M inactive` at zero rather
than drawing `0 inactive` (design rule 13; the PRD gives only a nonzero
example).
- The per-group chevron folds a group's rows and shares the sidebar's
collapsed set; not in B1..B24, reuses existing state.
From the Code review:
- Header chips are identified positionally in
`ForEach(Array(chips.enumerated()), id: \.offset)`; fine for a stateless
row, worth a stable id if chips ever gain per-chip state.
Reviewer on the Overview's inactive classification: a checkout holding
only a delegated child pane counts as inactive in the sidebar and so in
the Overview, which hides that child from every group; the answer
belongs to the sidebar's rule, not this PR.

## Delivery Staging

- Mode: unknown
- Branch: unknown
- Base: main
- Staging include: default allowlist
- Staging exclude: default volatile paths

## Changed Paths Planned For This PR

- CONTRIBUTING.md
- DESIGN.md
- design/agent-workflow-review.md
- design/hide.pen
- docs/ARCHITECTURE.md
- docs/PERFORMANCE_TESTING.md
- docs/README.md
- herdr-core/src/git_history.rs
- herdr-core/src/live.rs
- herdr-core/src/model.rs
- herdr-core/src/reader.rs
- herdr-core/src/runtime.rs
- herdr-core/src/runtime/events.rs
- herdr-core/src/runtime/projects.rs
- herdr-core/src/runtime/tests/projects.rs
- herdr-core/src/worktree_behavior_tests.rs
- herdr-core/src/worktree_control.rs
- herdr-core/src/worktrees.rs
- macos/Sources/HerdrMacOS/CheckoutOverview.swift
- macos/Sources/HerdrMacOS/CoreBridgeSnapshot.swift
- macos/Sources/HerdrMacOS/CoreBridgeWorkspaceSnapshot.swift
- macos/Sources/HerdrMacOS/GitWorktreesPresentation.swift
- macos/Sources/HerdrMacOS/HideDisclosureStyle.swift
- macos/Sources/HerdrMacOS/HideSidebar.swift
- macos/Sources/HerdrMacOS/HideTheme.swift
- macos/Sources/HerdrMacOS/OverviewGitTree.swift
- macos/Sources/HerdrMacOS/OverviewPresentation.swift
- macos/Sources/HerdrMacOS/ShellModel.swift
- macos/Sources/HerdrMacOS/SidebarList.swift
- macos/Tests/HerdrMacOSTests/ChangesPresentationTests.swift
- macos/Tests/HerdrMacOSTests/OverviewPresentationTests.swift
- macos/Tests/HerdrMacOSTests/SidebarPresentationTests.swift
- scripts/check-git-worktree-states.sh
- scripts/check-hide-components.mjs
- scripts/check-right-panel-sections.sh
- scripts/check-worktree-catalog-presentation.sh
- scripts/design-control-policy.json
- scripts/pen-foundations.mjs
- scripts/pen-token-map.json
- scripts/tests/design-controls.test.mjs

## Risks, Rollback, And Human Review

- Risk: `agent_start_in_checkout` is a new live write path (tab.create
or workspace.create, then the shell's `startAgentInCreatedPane`); a
failure lands in the task-operation slot as the same error the worktree
sheet already shows, and a missing live connection is refused before any
slot is taken.
- Risk: the reader pass reads two counts from one `rev-list --left-right
--count` where it read one before; the parse takes both numbers or none,
and a parse failure reads as `?`, never as zero (`parse_left_right`,
`behind_upstream_is_absent_without_an_upstream_and_counts_the_fetched_side`).
- Rollback: revert the merge commit; the UI state file gains no new key,
and a saved `right_panel_section` of `changes` still opens the same
section under its new label.
- Not run: the pull request chip and open-PR count against a signed-in
`gh`; the Overview context menus, `Reveal in sidebar`, `Copy pane id`,
`Close pane…` and `Delete worktree…` in the native app (item lists and
wiring are covered by tests and by the shared `closePaneFromHeader` /
`requestDeleteWorktree` paths the sidebar already uses).
- Follow-up: PR 2 (`right-panel-history`) replaces the History body.

## Related

- PRD: `agents/prd/right-panel-overview/prd.md` (right-panel-overview,
D-01..D-19, B1..B24)
- Follows PR #109 (sidebar pinning) and PR #101 (agent row redesign); PR
2 of this restructure is `right-panel-history`.

## Review focus

- **사람이 판단할 것**: the subtitle omits `· M inactive` at zero; the
per-group chevron folds rows and shares the sidebar's collapsed set; a
matching inactive checkout appears as a header line during search;
whether a checkout holding only a delegated child should count as
inactive (the Overview follows the sidebar's answer).
- **위험한 파일**: `herdr-core/src/runtime/projects.rs`
(`agent_start_in_checkout`, `overview_open_section`, the folder
`disk_request`), `herdr-core/src/worktree_control.rs`
(`create_checkout_tab`), `herdr-core/src/worktrees.rs` (`upstream()` now
parses two counts), `macos/Sources/HerdrMacOS/CheckoutOverview.swift`
(the whole surface is new).
- **리뷰어에게 묻는 것**: is `Terminal only / Claude / Codex` the right submenu
order, given the New worktree sheet lists providers the same way?

## Risk surface

- **Runtime mutex**: nothing new runs under `Mutex<Runtime>`;
`behind_upstream` and `created_at_unix_ms` are read in the existing
`WorktreeReader` worker pass, and `agent_start_in_checkout` spawns its
worker thread outside the lock like `create_worktree`.
- **Snapshot wire**: two new fields on the revisioned `rest` worktree
rows, both `Option`, both absent when not applicable; `history` and
`inspected_checkout_path` leave the snapshot.
- **Ownership**: the row click, header click and `overview_open_section`
change core-owned focus and section and tell Herdr afterwards, as the
sidebar does; `agent_start_in_checkout` waits for Herdr's created pane
through the task-operation slot before the shell starts the provider.
- **Herdr contract**: only `tab.create` and `workspace.create`, both
already in `contracts/herdr-api.schema.json` and already built by
`wire.rs`.
- **Failure path**: an unknown checkout or section answers
`overview.unknown_checkout` / `overview.unknown_section` in the error
slot; an agent start without a live connection reports `start an agent:
a live Herdr connection is required` in the task-operation slot; an
unreadable count draws `?` with the reason in its tooltip; every
diagnostic goes to `core.jsonl`.
- **High-frequency path**: no added git process per pass (one `rev-list`
per worktree as before, the upstream one only where an upstream exists);
`created_at_unix_ms` is one `stat` per linked worktree; idle adds
nothing (0 git commands over 60 s with the Overview visible).

## Evidence

- **확인한 것**: `bash scripts/verify-cargo.sh test` (19 test binaries, 574
core tests), `bash scripts/verify-swift.sh test` (493 tests, 10 in
`OverviewPresentationTests`), `bash scripts/verify-cargo.sh lint`, `node
scripts/check-design-contract.mjs` (141 mapped canvas values), `node
--test scripts/tests/design-controls.test.mjs` (7), and every gate in
CONTRIBUTING.md including the four rewritten Overview gates and
`check-herdr-contract.sh --schema-only`. Live: dev build against an
isolated Herdr 0.9.1 server (own HOME/XDG, private socket,
`HERDR_SESSION=rpo-live`) with a six-worktree fixture whose origin is
two commits ahead of main, three shim agents with `parent_pane` tokens,
and a plain folder project; twelve background exact-window captures
registered in the run record cover the grouped list with both strip
rows, the unfolded Inactive fold with left-truncated branch name, the
folder project's single size cell, search keep and no-match, row click,
files chip to History, the Start agent menu and the agent it started,
the disk popover, the cleanup sheet and the disconnected caption. Reader
cost with `GIT_TRACE`: 0 git commands over 60 s idle at 0.9% CPU; ten
edits three seconds apart across three worktrees produced one 67-command
pass of 0.89-1.0 s each at 1.8% CPU.
- **확인하지 못한 것과 그 이유**: the pull request chip and a numeric `⑂ N open
PRs` (the isolated HOME has no `gh` login and the fixture has no GitHub
remote; drawn from unit fixtures only); the header and row context
menus, `Reveal in sidebar`, `Copy pane id`, `Close pane…`, `Delete
worktree…` (SwiftUI context menus do not open through background
accessibility actions and foreground input was not used against the
operator's desktop); VoiceOver reading order beyond the accessibility
labels the AX dump shows (`sasu, Idle, prd/right-panel-overview`;
`feature/gamma, clean, 1 ahead, 4 behind, 20 KB`).
- **화면 증거**: see Screenshots / Demo; the captures stay in the local run
record because they carry the workstation's user and host name.

## AI tooling

- [ ] 사람이 직접 작성  - [ ] 일부를 AI 도구로 작성  - [x] 대부분을 AI 도구로 작성

**손으로 확인한 것**: the twelve live captures were read one by one against the
PRD's strings and the `Screen / Panel / Overview` board; the
verification report, the two native reviews and the git trace were read
in full.
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.

1 participant