Repository navigation
Conversation
5a50ba0 to
c3cde97
Compare
Greptile SummaryThis PR turns the Non-Orca worktrees dialog into the unified home for managing both kinds of non-Orca worktrees — agent scratch (
Confidence Score: 5/5Safe to merge; the core visibility model, rollback paths, and authoritative-list guard are well-exercised by unit and e2e tests, with only minor behavioural edge cases in the undo-import path worth revisiting. The change is tightly scoped to the visibility dialog and its supporting logic, with no new IPC channels, no new dependencies, and path handling that goes exclusively through existing cross-platform helpers. The two new repo settings are validated at both the IPC and RPC boundaries mirroring the existing pattern. The bulk switch guards against acting on a non-authoritative snapshot and rolls back all touched fields on a failed refresh. The e2e spec exercises the full round-trip and caught at least one bug (the bulk label) during development. The two minor findings are edge cases in the undo-import flow and an unnecessarily broad rollback, neither of which affects the primary recovery or visibility guarantees. Files Needing Attention: new-external-worktrees-inbox-actions.ts (undoExternalWorktreeImportPaths baseline gap) and non-orca-worktree-switch-actions.ts (show-path rollback over-writes unchanged list fields)
|
| Filename | Overview |
|---|---|
| src/renderer/src/components/sidebar/WorktreeVisibilityDialog.tsx | Substantially rewritten dialog: adds per-kind sections (agent scratch + other), authoritative-list gating with retry, primer guide, and per-row toggle/bulk switch actions; actionState error not cleared on dialog reopen (noted in prior threads) |
| src/renderer/src/components/sidebar/non-orca-worktree-switch-actions.ts | New bulk-switch action with authoritative-list guard, per-kind import purge, baseline merge, and rollback on failed refresh; rollback for the show path over-writes unchanged list fields unnecessarily |
| src/renderer/src/components/sidebar/non-orca-worktree-visibility-candidates.ts | New selectors for agent/other worktree rows and summaries; correctly uses detected ownership rather than path heuristics, and separates legacy/selected-checkout rows from both switches |
| src/renderer/src/components/sidebar/new-external-worktrees-inbox-actions.ts | Adds undoExternalWorktreeImportPaths; correctly preserves baseline for paths previously judged via inbox, but paths imported only through the dialog have no baseline entry and will re-appear in the inbox after undo |
| src/renderer/src/components/sidebar/reveal-project-actions-menu.ts | New utility that synthesizes a pointerdown event to open Radix dropdown and then rAF-polls for the visibility menu item; correctly handles the keyboard fallback path and the guided-row hover-lock cleanup via MutationObserver |
| src/shared/external-worktree-inbox.ts | Adds getHiddenImportableExternalWorktrees and refactors getNewExternalWorktreeInboxWorktrees to surface agent scratch independently of the non-Orca visibility prompt gate |
| src/shared/worktree-ownership.ts | agent-scratch now answers to effectiveAgentWorktreeVisibility rather than always returning false; exports the new helper for use in the dialog |
| tests/e2e/non-orca-worktree-visibility.spec.ts | New e2e spec covering the full round-trip: setting cannot reveal agent worktrees, dialog recovers them, sidebar shows one kind while other stays hidden, hiding kind drops the import exception |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Dialog opens] --> B[fetchWorktrees requireAuthoritative]
B --> C{refresh ok?}
C -- yes --> D[listState = ready\nbulk buttons enabled]
C -- no --> E[listState = failed\nbulk buttons disabled\nRetry shown]
D --> F{User action}
F --> G[Row toggle\nshow/hide]
F --> H[Bulk switch\nShow all / Hide all]
G --> I{intent}
I -- show --> J[importNewExternalWorktreeInboxPaths\nadd to importedPaths]
I -- hide --> K[undoExternalWorktreeImportPaths\nremove from importedPaths\nbaseline unchanged]
H --> L{detected\nauthoritative?}
L -- no, hide --> M[Refuse with error\nno writes]
L -- yes or show --> N[setNonOrcaWorktreeKindVisibility\nupdate setting\npurge kind imports if hide\nbaseline kind paths if hide]
N --> O[fetchWorktrees requireAuthoritative]
O --> P{refresh ok?}
P -- yes --> Q[setSwitchState null\ndone]
P -- no --> R[Rollback all fields\nshow error]
K --> S[fetchWorktrees requireAuthoritative]
J --> S
S --> T{refresh ok?}
T -- yes --> U[setInboxState null]
T -- no --> V[rollback importedPaths\nshow error]
Reviews (2): Last reviewed commit: "i18n(worktrees): say the switch hides in..." | Re-trigger Greptile
📝 WalkthroughWalkthroughAdded independent visibility policies for agent-scratch and other non-Orca worktrees. Added shared classification, inbox filtering, persistence, IPC validation, and renderer state handling. Replaced the visibility dialog with categorized bulk and per-worktree controls. Updated inbox actions, project-menu recovery, localized strings, and end-to-end coverage. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (3)
src/renderer/src/components/sidebar/NonOrcaWorktreeSection.tsx (1)
50-57: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMark the state icons as decorative.
EyeandEyeOffduplicate the adjacentstateLabeltext. Addaria-hidden="true"so assistive technology does not announce them. The codebase already does this for other decorative icons, for example inNewExternalWorktreesInboxLine.tsx.♻️ Proposed change
- {anyShown ? <Eye className="size-4" /> : <EyeOff className="size-4" />} + {anyShown ? ( + <Eye className="size-4" aria-hidden="true" /> + ) : ( + <EyeOff className="size-4" aria-hidden="true" /> + )}src/renderer/src/components/sidebar/WorktreeVisibilityDialog.test.tsx (1)
273-297: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse the
EXTERNAL_PATHconstant instead of the duplicated literal.Lines 277 and 294 repeat
'/elsewhere/manual', which is already defined asEXTERNAL_PATH. Use the constant so a change to the fixture path stays consistent.♻️ Proposed change
- importedExternalWorktreePaths: [SCRATCH_PATH, '/elsewhere/manual'] + importedExternalWorktreePaths: [SCRATCH_PATH, EXTERNAL_PATH]agentWorktreeVisibility: 'hide', - importedExternalWorktreePaths: ['/elsewhere/manual'], + importedExternalWorktreePaths: [EXTERNAL_PATH], externalWorktreeInboxBaselinePaths: [SCRATCH_PATH]src/renderer/src/components/sidebar/reveal-project-actions-menu.ts (1)
41-50: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueThe observer can stay attached after the row is detached.
clearGuidedRowWhenMenuClosesobservesdoc.bodywithsubtree: trueand disconnects only when the visibility item disappears. If the project header unmounts while the menu is still open, the observer keeps running on every body mutation. Consider disconnecting whenrow.isConnectedis false as well.♻️ Proposed change
const observer = new MutationObserver(() => { - if (doc.querySelector(`[${PROJECT_ACTIONS_VISIBILITY_ITEM_ATTRIBUTE}]`)) { + if (row.isConnected && doc.querySelector(`[${PROJECT_ACTIONS_VISIBILITY_ITEM_ATTRIBUTE}]`)) { return }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d19dd5f0-aa67-4eb6-a686-01f417a7e89d
📥 Commits
Reviewing files that changed from the base of the PR and between 16c5526 and c3cde97a87b7febf4e30fd661d3e871a811c3cc8.
📒 Files selected for processing (41)
docs/non-orca-worktree-visibility.mdsrc/main/ipc/repos.tssrc/main/persistence.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/client-ui-schemas.tssrc/main/runtime/rpc/methods/repo-update-schema.tssrc/preload/api-types.tssrc/renderer/src/assets/main.csssrc/renderer/src/components/sidebar/ImportedWorktreesVisibilityLine.tsxsrc/renderer/src/components/sidebar/NewExternalWorktreesInboxLine.test.tsxsrc/renderer/src/components/sidebar/NewExternalWorktreesInboxLine.tsxsrc/renderer/src/components/sidebar/NonOrcaWorktreeRowList.tsxsrc/renderer/src/components/sidebar/NonOrcaWorktreeSection.tsxsrc/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/WorktreeVisibilityDialog.test.tsxsrc/renderer/src/components/sidebar/WorktreeVisibilityDialog.tsxsrc/renderer/src/components/sidebar/new-external-worktrees-inbox-actions.test.tssrc/renderer/src/components/sidebar/new-external-worktrees-inbox-actions.tssrc/renderer/src/components/sidebar/new-external-worktrees-inbox-candidates.test.tssrc/renderer/src/components/sidebar/new-external-worktrees-inbox-candidates.tssrc/renderer/src/components/sidebar/non-orca-worktree-switch-actions.test.tssrc/renderer/src/components/sidebar/non-orca-worktree-switch-actions.tssrc/renderer/src/components/sidebar/non-orca-worktree-visibility-candidates.test.tssrc/renderer/src/components/sidebar/non-orca-worktree-visibility-candidates.tssrc/renderer/src/components/sidebar/repo-header-action-button-class.tssrc/renderer/src/components/sidebar/reveal-project-actions-menu.test.tssrc/renderer/src/components/sidebar/reveal-project-actions-menu.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/store/slices/repos.tssrc/renderer/src/store/slices/ui.tssrc/shared/external-worktree-inbox.test.tssrc/shared/external-worktree-inbox.tssrc/shared/external-worktree-visibility.tssrc/shared/types.tssrc/shared/worktree-ownership.test.tssrc/shared/worktree-ownership.tstests/e2e/non-orca-worktree-visibility.spec.ts
|
Thanks both. Every point was checked against the code rather than taken on trust; here is what happened to each. Taken (2e5bc71d6)
Refuted, with evidence
Left alone on purpose
|
|
Tip For best results, initiate chat on the files or code changes.
The localization changes address both reported issues. The revised English wording removes the deletion implication, and the aligned catalogs preserve that meaning. I withdraw the I also withdraw the 🐇 ✅ ✏️ Learnings added
You are interacting with an AI system. |
|
All four rebuttals hold up:
The translation fixes are the right call too: correcting Korean alone while Nothing outstanding from my side. This looks ready. Tip: You can customize Greptile's behavior for this repo with |
|
When this change rolls out, I still have to use the old version, as the newer Orca does not show Claude worktrees |
|
Taking a look! |
…rktrees are recoverable (stablyai#10324) Worktrees under <repo>/.claude/worktrees are classified agent-scratch and shouldShowWorktree hides them before the visibility branch, so the "Show non-Orca worktrees" toggle cannot reveal them by design (stablyai#9388). The only reveal path is an explicit import into importedExternalWorktreePaths, but nothing ever offered scratch for import, leaving them unreachable. Add isImportableExternalWorktree (excludes only orca-managed and the selected checkout) and getHiddenImportableExternalWorktrees, and use them in getNewExternalWorktreeInboxWorktrees so scratch reaches the inbox. Let scratch bypass both the visibility-mode gate and the first-run prompt gate: neither governs scratch, and the prompt flag is only written by the import card, which never renders for a scratch-only repo. Discovery suppression and the inbox baseline still apply. getHiddenExternalWorktrees, the import card and the visibility dialog are left untouched: the card's only action flips externalWorktreeVisibility, which by design can never reveal scratch.
Keeping a discovered worktree hidden was a one-way door for agent scratch. The inbox baseline suppressed the notification, the repo-wide toggle can never reveal scratch by design (stablyai#9388), and the dialog reported nothing was there, so the worktree became unreachable from the UI. The visibility dialog now owns both kinds of non-Orca worktrees, each with the same anatomy: a repo switch that also covers worktrees created later, and a collapsible per-worktree list to show or hide one at a time. Agent worktrees answer to their own opt-in setting, so the non-Orca toggle still never reveals them; a shared test pins that guarantee. Hiding a whole kind drops that kind's explicit exceptions, otherwise an exception would outrank the switch that was just set, and both switches roll back if the refresh that follows them fails. Both switches also need an authoritative listing, because hiding derives the purge and the decision ledger from it. On a host Orca cannot reach, the dialog says so and offers a retry instead of purging against an empty list. Worktrees a legacy repo shows whatever the setting are left out of a kind's counts, since no switch on this screen can move them. A row counts as an exception when the visibility rule without imports would hide it, not when its path sits in the recorded list, because that list can lag behind reality. Row-level actions reuse the inbox import path so behavior and rollback stay identical, and the recovery list ignores the inbox baseline on purpose: the baseline suppresses a notification, it must not block recovery. The sidebar notices now speak the same vocabulary as the dialog and link straight into it instead of naming a menu. docs/non-orca-worktree-visibility.md writes down the model, the stablyai#9388 guarantee, and the exception rules. Supersedes stablyai#11730 and consolidates the overlapping work in stablyai#10560 (the agent visibility setting, whose field name and rollback shape are kept) and
… worktrees Three of the five catalogs read as if hiding a kind removed the worktrees themselves: es "borra los worktrees", zh "会清除...工作树", ko "워크트리도 해제됩니다". They were faithful to an English source that said "clears the worktrees you had shown individually", so the fix belongs in the source. Also puts the Chinese count labels in verb-first order, matching the sibling "已显示 N 个中的 M 个" already in that block.
…hema file client-ui-schemas.ts sat exactly at the 300-line ceiling, so the visibility field this branch adds pushed it over. The two workspace-cleanup schemas were file-local, so moving them changes no public surface.
|
Maybe better solution will be to set a mask of agent worktrees that shoud be hidden for project? |
I tried integrating it into the existing product logic, but I think it's a good idea, we can add configurable paths that allow to ignore or include all worktrees in a dir and sub-dirs. We can put it inside the general settings screen or in the "Manage non-Orca working directories" screen. Let's wait for @brennanb2025's opinion to know if this PR will be merged or not first |
2e5bc71 to
7b5de7c
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 180471b1-e596-4f96-93f4-15757ea78eb7
📒 Files selected for processing (42)
docs/non-orca-worktree-visibility.mdsrc/main/ipc/repos.tssrc/main/persistence.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/client-ui-schemas.tssrc/main/runtime/rpc/methods/client-workspace-cleanup-schemas.tssrc/main/runtime/rpc/methods/repo-update-schema.tssrc/preload/api-types.tssrc/renderer/src/assets/main.csssrc/renderer/src/components/sidebar/ImportedWorktreesVisibilityLine.tsxsrc/renderer/src/components/sidebar/NewExternalWorktreesInboxLine.test.tsxsrc/renderer/src/components/sidebar/NewExternalWorktreesInboxLine.tsxsrc/renderer/src/components/sidebar/NonOrcaWorktreeRowList.tsxsrc/renderer/src/components/sidebar/NonOrcaWorktreeSection.tsxsrc/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/WorktreeVisibilityDialog.test.tsxsrc/renderer/src/components/sidebar/WorktreeVisibilityDialog.tsxsrc/renderer/src/components/sidebar/new-external-worktrees-inbox-actions.test.tssrc/renderer/src/components/sidebar/new-external-worktrees-inbox-actions.tssrc/renderer/src/components/sidebar/new-external-worktrees-inbox-candidates.test.tssrc/renderer/src/components/sidebar/new-external-worktrees-inbox-candidates.tssrc/renderer/src/components/sidebar/non-orca-worktree-switch-actions.test.tssrc/renderer/src/components/sidebar/non-orca-worktree-switch-actions.tssrc/renderer/src/components/sidebar/non-orca-worktree-visibility-candidates.test.tssrc/renderer/src/components/sidebar/non-orca-worktree-visibility-candidates.tssrc/renderer/src/components/sidebar/repo-header-action-button-class.tssrc/renderer/src/components/sidebar/reveal-project-actions-menu.test.tssrc/renderer/src/components/sidebar/reveal-project-actions-menu.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/store/slices/repos.tssrc/renderer/src/store/slices/ui.tssrc/shared/external-worktree-inbox.test.tssrc/shared/external-worktree-inbox.tssrc/shared/external-worktree-visibility.tssrc/shared/types.tssrc/shared/worktree-ownership.test.tssrc/shared/worktree-ownership.tstests/e2e/non-orca-worktree-visibility.spec.ts
🚧 Files skipped from review as they are similar to previous changes (34)
- src/preload/api-types.ts
- src/renderer/src/store/slices/repos.ts
- src/renderer/src/components/sidebar/new-external-worktrees-inbox-candidates.test.ts
- src/main/runtime/orca-runtime.ts
- src/main/runtime/rpc/methods/repo-update-schema.ts
- src/main/ipc/repos.ts
- src/renderer/src/components/sidebar/repo-header-action-button-class.ts
- src/renderer/src/components/sidebar/NewExternalWorktreesInboxLine.test.tsx
- src/renderer/src/components/sidebar/NonOrcaWorktreeRowList.tsx
- src/renderer/src/components/sidebar/reveal-project-actions-menu.test.ts
- src/renderer/src/components/sidebar/new-external-worktrees-inbox-candidates.ts
- src/shared/worktree-ownership.test.ts
- src/renderer/src/components/sidebar/non-orca-worktree-visibility-candidates.test.ts
- src/renderer/src/components/sidebar/new-external-worktrees-inbox-actions.test.ts
- src/renderer/src/store/slices/ui.ts
- src/shared/external-worktree-inbox.test.ts
- src/renderer/src/assets/main.css
- src/shared/worktree-ownership.ts
- src/main/persistence.ts
- src/renderer/src/i18n/locales/es.json
- src/shared/types.ts
- src/shared/external-worktree-visibility.ts
- src/renderer/src/components/sidebar/NewExternalWorktreesInboxLine.tsx
- src/renderer/src/components/sidebar/ImportedWorktreesVisibilityLine.tsx
- src/renderer/src/components/sidebar/WorktreeList.tsx
- src/renderer/src/components/sidebar/NonOrcaWorktreeSection.tsx
- src/renderer/src/components/sidebar/new-external-worktrees-inbox-actions.ts
- src/renderer/src/components/sidebar/non-orca-worktree-switch-actions.ts
- src/shared/external-worktree-inbox.ts
- src/renderer/src/components/sidebar/non-orca-worktree-visibility-candidates.ts
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/components/sidebar/non-orca-worktree-switch-actions.test.ts
|
|
||
| How Orca decides whether a worktree it did not create appears in the sidebar, and which surface | ||
| can change that decision. Builds on the analysis in #10560 (agent scratch needs an opt-in) and | ||
| #11275 (a hidden worktree needs a per-path way back). |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep #11275 in the paragraph.
Line 5 starts an unintended Markdown heading. Move the issue reference to line 4, or prefix line 5 with normal prose.
Proposed fix
-How Orca decides whether a worktree it did not create appears in the sidebar, and which surface
-can change that decision. Builds on the analysis in `#10560` (agent scratch needs an opt-in) and
-#11275 (a hidden worktree needs a per-path way back).
+How Orca decides whether a worktree it did not create appears in the sidebar, and which surface
+can change that decision. Builds on the analysis in `#10560` (agent scratch needs an opt-in) and `#11275`
+(a hidden worktree needs a per-path way back).📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| #11275 (a hidden worktree needs a per-path way back). | |
| How Orca decides whether a worktree it did not create appears in the sidebar, and which surface | |
| can change that decision. Builds on the analysis in `#10560` (agent scratch needs an opt-in) and `#11275` | |
| (a hidden worktree needs a per-path way back). |
🧰 Tools
🪛 markdownlint-cli2 (0.23.2)
[warning] 5-5: No space after hash on atx style heading
(MD018, no-missing-space-atx)
Source: Linters/SAST tools
Me too. It's easier use old orca version than change agent flow for everybody. |
b4101b5 to
7b5de7c
Compare
|
Thanks for this work — #13652 landed the focused recovery and visibility behavior. The remaining per-source and custom-location UI is documented there as a follow-up, so this PR is now superseded. |
Summary
Keeping a discovered worktree hidden was a one-way door for agent worktrees. The inbox baseline suppressed the notification, the repo-wide non-Orca toggle can never reveal agent scratch by design (#9388), and the visibility dialog reported nothing was there, so the worktree became unreachable from the UI while it sat on disk. Found by manual testing: create two
.claude/worktrees/*worktrees, clickKeep hiddenon the inbox, and the first one is gone for good.The
Non-Orca worktreesdialog becomes the permanent home for both kinds, with the same anatomy on each side:Show all/Hide all) that also covers worktrees created later,Manage individuallylist to show or hide one worktree at a time,Partly shown,1 of 3 shown) instead of claiming all or nothing.Agent worktrees get their own opt-in repo setting, so the non-Orca toggle still never reveals them; a shared test pins that guarantee. Hiding a whole kind drops that kind's explicit exceptions, otherwise an exception would outrank the switch that was just set. Both switches roll back if the refresh that follows them fails, so a stale list never reads as a successful flip.
Both switches also need an authoritative listing before they act, because hiding derives the exception purge and the notification ledger from that very list. On a host Orca cannot reach, the dialog says so and offers a retry, and the switches stay disabled, rather than purging the wrong paths against an empty list.
A one-shot primer explains the two kinds in plain words and stays reachable from a
What is this?button after dismissal. The two sidebar notices now speak the same vocabulary as the dialog (Show/Show all, no filled button), show repo-relative paths, cap their preview at three rows, and link straight into the dialog instead of naming a menu the app never labels that way.docs/non-orca-worktree-visibility.mdwrites down the model: two kinds by path, one setting each, per-path exceptions that outrank both, and the notification ledger that must never gate recovery.This PR carries the commit from #11730 so everything reviews in one place, and consolidates two overlapping open PRs (see Notes).
Fix #10324
Screenshots
Sidebar notice. Newly discovered worktrees, with repo-relative paths, a three-row preview cap, and a recovery pointer whose only link is
here. Clicking it reveals the project actions menu rather than naming a button that stays hidden until hover.Where it lives. The entry the sidebar notice points at. Clicking
herein the notice opens this menu on the project row, which also reveals the⋯button that stays hidden until hover, so the path is learned rather than described.First open. The primer names the two kinds in plain words, then each kind gets the same anatomy: a repo switch that also covers worktrees created later, and a collapsible per-worktree list.
After
Got it. The primer is replaced by aWhat is this?button in the header, and both lists are expanded. Paths render repo-relative, or absolute when the worktree lives outside the checkout.Mixed state. One agent worktree was shown individually, so the section reports
Partly shown in sidebar,1 of 2 shown, and offersHide allbecause something is on screen. Each row carries the action that matches its own state, while the other kind is fully shown by its switch.Testing
pnpm lintpnpm typecheckpnpm testpnpm buildDetails, because two of those boxes need context:
pnpm test: the full suite was run: 18 files fail on this machine, none of them in this diff's area, and every cause was confirmed rather than assumed. 13 of the 18 pass when re-run in isolation and only fail under full-suite parallel load (node-pty, ssh, plugin and gitea integration). The remaining 5 are environmental: a globaltag.gpgsign trueturns three fixtures' lightweight tags into annotated ones that demand a message (fatal: no tag message?), an inheritedGIT_CONFIG_COUNT=2in the shell makes a relay handler emit 4 where the test expects 2, and a macOS helper fixture misses a temp pid file. Zero failures insrc/rendererorsrc/shared. Targeted verification: 609 files / 5521 tests green acrosssrc/renderer/src/components/sidebar,src/renderer/src/i18nandsrc/shared.pnpm build:build:electron-vite(the desktop bundle) passes.build:nativewas not run locally.tests/e2e/non-orca-worktree-visibility.spec.ts, adapted from feat(worktrees): import a single hidden worktree from the visibility dialog #11275) that walks the whole path in the real app: the setting cannot reveal an agent worktree, the dialog recovers one, the sidebar shows it while the other kind stays hidden, and hiding the kind drops the exception. Green withpnpm exec playwright test tests/e2e/non-orca-worktree-visibility.spec.ts --config tests/playwright.config.ts --project=electron-headless --workers=1.AI Review Report
Reviewed with Claude Opus across the dimensions CONTRIBUTING asks for.
metaKeyhazard and no modifier labels to drift. No path string is built or split by hand: comparisons go throughnormalizeRuntimePathForComparisonand the repo-relative display usesrelativePathInsideRoot, both of which already handle Windows drive letters, UNC and WSL aliases. No shell invocation. Layout uses tokens and shadcn primitives only, so light and dark both come frommain.css.requireAuthoritative: trueand rolls back on failure, so a slow or failing remote cannot leave the UI claiming a flip that did not land. The dialog refetches on open rather than trusting a cached snapshot, and rendersChecking…instead ofNone in this repo.while a fallback snapshot is in play. When that refetch fails it says so and offers a retry, and the bulk switches stay disabled for as long as the list is untrustworthy, because hiding a kind reads the purge and the ledger off that list. Row actions reuse the existing inbox action, so they inherit its rollback..claude/worktrees,.gsd-workspaces) come from the existing shared matcher; no provider-specific naming was introduced and no git provider logic is touched.min-w-0, so a long unbreakable path blew the dialog wider than its own panel; a help affordance was duplicated per section for a rule that belongs to the screen; and two locale entries had drifted from their inline defaults, which silently wins at runtime because the catalog takes precedence. A drift sweep over every touched file now reports zero.Three further adversarial rounds were then run, each with two independent reviewers reading the branch cold. Round one raised nine issues, all fixed: the exception purge re-derived ownership from
repo.pathwhile main anchors its matcher at every live checkout, so scratch created inside another worktree was misfiled and purged; a failed rollback dropped a discovery opt-out; the bulk switches never wrote their decision ledger, so the inbox re-announced what the user had just put away; a plural noun was composed before interpolation; the two sections derived their state differently; the guided-reveal observer could outlive its menu. Round two found that the bulk switches still acted on a non-authoritative snapshot, which reopened the purge bug on a failing remote, and that two catalog keys had been missed in the four non-English locales. Round three, run against a majors-only bar, came back empty from both reviewers.Security Audit
externalWorktreeVisibilityguard. The new persisted UI flag is a boolean in the ui-state schema, which a type-level parity check enforces againstPersistedUIState.importedExternalWorktreePathsis never pruned when a worktree disappears from disk, so recreating the same path stays visible without asking again. Documented as a deliberate non-goal; worth revisiting if it surprises users.Notes
agentWorktreeVisibilityand its rollback shape are kept here. feat(worktrees): import a single hidden worktree from the visibility dialog #11275 (@5hseok) added per-path recovery from this dialog; its sharper exception detection is kept, namely asking whether the rule without imports would hide the row rather than trusting the recorded path list. Neither of them handles the interaction between the two mechanisms, which is the bug where hiding a kind left previously imported worktrees visible. If maintainers prefer to land either of those first, this branch rebases onto it with a textual conflict rather than a conceptual one.unknown-legacyworktrees whatever the setting says, which no switch on this screen can change. Those rows are therefore left out of a kind's counts, on the principle that a section must never report a state its own button cannot produce, nor offer aHide allthat hides nothing.externalWorktreeVisibilitystill cannot reveal an agent worktree for either of its values, and a shared test asserts it. Agent worktrees answer only to their own opt-in setting, an explicit exception, or being the selected checkout. Both defaults stay hidden.Show alland nothing offered to hide what was on screen. The label now answers to the visible state.npm_config_build_from_source=true pnpm rebuild node-ptyin a fresh worktree, a globaltag.gpgsign truebreaks three tag fixtures (two release scripts and the plugin installer), and an inheritedGIT_CONFIG_COUNTbreaks a relay env assertion. All pre-existing and unrelated to this diff; a separate PR hardens those fixtures.