Repository navigation
Show worktree option only for Git group folders - #125280
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 7:02 PM ET / 23:02 UTC. ClawSweeper reviewWhat this changesThis PR shows the Worktree choice in session-group defaults only when the selected folder is confirmed as a Git repository, with stale-request and unavailable-inspection handling. Merge readinessCurrent main still always exposes Local and Worktree, so this member-authored, maintainer-labeled PR remains necessary. The implementation and supplied UI proof support the behavior; a maintainer should accept the intentional persisted-default change before merge. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI sidebar saves a working directory and environment default for future sessions in a group. It asks the Gateway whether the directory is a Git repository, then presents either Local alone or a Local/Worktree selector. flowchart LR
A[Session group defaults] --> B[Control UI sidebar]
B --> C[Gateway folder and repository check]
C --> D{Repository status}
D -->|Git| E[Local or Worktree selector]
D -->|Not Git| F[Local environment]
D -->|Unavailable or stale| G[Retry and disabled save]
E --> H[Saved defaults for future sessions]
F --> H
Decision needed
Why: Source and proof establish the behavior, but accepting this persisted-default migration is a maintainer product and compatibility choice. Before merge
Agent review detailsSecurityNone. PR surfaceSource +442, Tests +138. Total +580 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep repository classification at the existing Gateway/UI boundary and merge only after accepting that confirmed non-Git folders clear a saved Worktree preference. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect report; the supplied recordings and E2E directly demonstrate the proposed Git, non-Git, unavailable, and retry behaviors. Is this the best way to solve the issue? Yes for the implementation boundary: it reuses the existing repository-status protocol and shared connection lifecycle. The remaining decision is whether the persisted-default migration is desired. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against daafb2bf5c0e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
53ff45b to
9b7dd04
Compare
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* feat(ui): show worktrees only for Git group folders * feat(ui): enrich group environment picker * fix(ui): preserve worktree defaults on probe errors * fix(ui): reject stale group repository probes * test(ui): type repository inspection helper
New behavior
Session-group defaults now offer a worktree only when the selected working directory is a Git repository.
Visual proof
Before — direct base
pr125280-before-direct-base.webm
What this shows: The direct-base modal always exposes Local/Worktree, including for the initial non-Git folder, and uses the older working-directory layout.
State: Direct
mainbase; syntheticClient workgroup;/home/peternon-Git folder followed by/home/peter/client-workGit folder; 1280×900 Chromium recording.After — this PR
pr125280-after-rich-full-width-dropdown.webm
What this shows: The initial non-Git folder resolves to static Local. Choosing the synthetic Git folder reveals the full-width rich Environment dropdown, including the Local and Worktree descriptions, and Worktree can be selected without shifting the modal.
State: PR branch; same synthetic group, folders, mock Gateway, viewport, and interaction as the direct-base recording.
Unavailable inspection safeguard
What this shows: A temporary repository-inspection failure cannot overwrite a saved Worktree default: Save is disabled and Retry is available.
How to verify
Implementation note
Folder and repository requests use the session capability's Gateway connection generation. Real reconnects invalidate stale results, while unrelated session refreshes do not make the worktree option disappear.