Repository navigation
Show attached worktrees in folder workspace sidebar - #5289
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR implements workspace lineage tracking to link folder workspaces with their attached worktrees. It adds a new 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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: 12
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
docs/folder-workspace-attached-worktrees-plan.md (1)
703-703: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winDelete the stray
703token at the end of the file.Line 703 appears to be an accidental artifact and renders as noise in the document.
src/renderer/src/store/slices/worktrees.ts (1)
1709-1769: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winClear
activeWorkspaceKeywhen deleting the active worktree.
removeWorktreeclearsactiveWorktreeIdbut notactiveWorkspaceKey. After deleting the active row, the store can keep a dangling active workspace key and later reads consume stale context.💡 Suggested fix
@@ - const removedActiveWorktree = s.activeWorktreeId === worktreeId + const removedActiveWorktree = s.activeWorktreeId === worktreeId + const activeScope = s.activeWorkspaceKey ? parseWorkspaceKey(s.activeWorkspaceKey) : null + const clearActiveWorkspaceKey = + removedActiveWorktree || + (activeScope?.type === 'worktree' && activeScope.worktreeId === worktreeId) @@ activeWorktreeId: removedActiveWorktree ? null : s.activeWorktreeId, + activeWorkspaceKey: clearActiveWorkspaceKey ? null : s.activeWorkspaceKey, activeTabId: s.activeTabId && tabIds.has(s.activeTabId) ? null : s.activeTabId,src/main/runtime/orca-runtime.ts (2)
8983-9059: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winRevalidate the parent before persisting lineage.
This helper writes both lineage rows from the
ResolvedWorkspaceParentsnapshot captured before the Git/SSH create path runs. If that parent workspace disappears during create, we persist dangling lineage instead of degrading to a warning. Re-resolve the parent here, or immediately before calling this helper, and skip persistence withLINEAGE_PARENT_NOT_FOUNDwhen it no longer exists.
12853-12863: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winHydration still misses
workspaceLineage.
listWorkspaceLineage()goes throughhydrateInferredWorktreeLineage(), but that hydrator only backfillssetWorktreeLineage(...). That leaves inferred or migrated parentage visible inlineagewhile the dedicatedworkspaceLineagepayload stays empty, sosrc/renderer/src/store/slices/worktrees.tsnever populatesworkspaceLineageByChildKeyfor those children.Also applies to: 12871-12874
🧹 Nitpick comments (2)
src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsx (1)
44-46: 📐 Maintainability & Code Quality | ⚡ Quick winAdd a short why-comment for the lineage instance-id gate.
The instance-id filter is a non-obvious design constraint; add a one-liner explaining why mismatched child instances are dropped.
As per coding guidelines, "When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."
Source: Coding guidelines
src/main/persistence.ts (1)
3628-3633: 🗄️ Data Integrity & IntegrationWorktree-parent lineage cleanup is intentionally omitted.
removeWorktreeMetaonly deletesworkspaceLineageByChildKey[worktreeWorkspaceKey(worktreeId)](when the removed worktree is the child). When a parent worktree disappears, runtime keeps the children’s workspace lineage for the “Missing parent” repair UI (pruneLineageForMissingRepoWorktreesupdates the missing parent’sinstanceIdbut does not delete the child lineage). Optional: add a unit test covering “parent worktree removed preserves child workspaceLineage”.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: bfe40bd1-18f7-49a9-b27a-e81679074763
📥 Commits
Reviewing files that changed from the base of the PR and between d538549 and 9682c767f8fa70846bed35c44dee04ff50bf2f5d.
📒 Files selected for processing (43)
docs/folder-workspace-attached-worktrees-plan.mdsrc/cli/handlers/worktree-lineage-summary.tssrc/cli/handlers/worktree.tssrc/cli/help.tssrc/cli/index.test.tssrc/cli/specs/core.tssrc/main/ipc/worktree-remote.tssrc/main/ipc/worktrees.tssrc/main/persistence.test.tssrc/main/persistence.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/worktree-schemas.tssrc/main/runtime/rpc/methods/worktree.test.tssrc/main/runtime/rpc/methods/worktree.tssrc/preload/api-types.tssrc/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsxsrc/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsxsrc/renderer/src/components/right-sidebar/activity-bar-buttons.tsxsrc/renderer/src/components/right-sidebar/index.tsxsrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.tssrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.tssrc/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsxsrc/renderer/src/components/sidebar/WorktreeCard.affiliate-list-mode.test.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/components/sidebar/WorktreeCardMeta.tsxsrc/renderer/src/components/sidebar/WorktreeCardReviewDetailSection.tsxsrc/renderer/src/components/sidebar/WorktreeContextMenu.tsxsrc/renderer/src/components/sidebar/worktree-card-meta-types.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/right-sidebar-route.tssrc/renderer/src/store/slices/settings.tssrc/renderer/src/store/slices/worktree-helpers.tssrc/renderer/src/store/slices/worktrees.test.tssrc/renderer/src/store/slices/worktrees.tssrc/renderer/src/web/web-preload-api.tssrc/shared/constants.tssrc/shared/runtime-types.tssrc/shared/types.ts
| - Parent workspace: `/Users/thebr/orca/workspaces/orca/butterfish` | ||
| - Parent branch: `brennanb2025/multi-repo-agent-plan` | ||
| - Parent purpose: v1 multi-repo folder workspaces | ||
| - Planning workspace: `/Users/thebr/orca/workspaces/orca/folder-workspace-attached-worktrees-plan` | ||
| - Planning branch: `brennanb2025/folder-workspace-attached-worktrees-plan` |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Remove machine-specific absolute paths from the committed design doc.
Line 7 and Line 10 embed a local filesystem path with a user identifier. Please replace with neutral placeholders (for example, /path/to/...) so the doc is portable and does not expose personal machine details.
| const activeWorktreeId = useAppStore((s) => s.activeWorktreeId) | ||
| const folderWorkspaces = useAppStore((s) => s.folderWorkspaces) | ||
| const workspaceLineageByChildKey = useAppStore((s) => s.workspaceLineageByChildKey) | ||
| const worktreesByRepo = useAppStore((s) => s.worktreesByRepo) | ||
| const repos = useAppStore((s) => s.repos) | ||
|
|
||
| const activeScope = parseWorkspaceKey(activeWorktreeId ?? '') | ||
| const folderWorkspace = | ||
| activeScope?.type === 'folder' | ||
| ? folderWorkspaces.find((workspace) => workspace.id === activeScope.folderWorkspaceId) | ||
| : undefined |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Use activeWorkspaceKey (not activeWorktreeId) to resolve the active folder workspace.
This panel derives folder scope from activeWorktreeId, which can drift from workspace-scoped state and incorrectly fall into the “unavailable” branch while a folder workspace is active.
Proposed fix
export default function FolderWorkspaceWorktreesPanel(): React.JSX.Element {
const activeWorktreeId = useAppStore((s) => s.activeWorktreeId)
+ const activeWorkspaceKey = useAppStore((s) => s.activeWorkspaceKey)
const folderWorkspaces = useAppStore((s) => s.folderWorkspaces)
@@
- const activeScope = parseWorkspaceKey(activeWorktreeId ?? '')
+ const activeScope = parseWorkspaceKey(activeWorkspaceKey ?? activeWorktreeId ?? '')| <DetailHeader | ||
| icon={<ReviewIcon review={review} className="size-3" />} | ||
| label={`${reviewLabel} #${review.number}`} |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Missing internationalization for the review label.
The header label on line 53 uses a template literal instead of translate() with interpolation. This is inconsistent with the pattern in WorktreeCardMeta.tsx (e.g., lines 205-209 for "Issue #{{value0}}").
Suggested fix
<DetailHeader
icon={<ReviewIcon review={review} className="size-3" />}
- label={`${reviewLabel} #${review.number}`}
+ label={translate(
+ 'auto.components.sidebar.WorktreeCardReviewDetailSection.reviewHeader',
+ '{{value0}} #{{value1}}',
+ { value0: reviewLabel, value1: review.number }
+ )}
actions={📝 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.
| <DetailHeader | |
| icon={<ReviewIcon review={review} className="size-3" />} | |
| label={`${reviewLabel} #${review.number}`} | |
| <DetailHeader | |
| icon={<ReviewIcon review={review} className="size-3" />} | |
| label={translate( | |
| 'auto.components.sidebar.WorktreeCardReviewDetailSection.reviewHeader', | |
| '{{value0}} #{{value1}}', | |
| { value0: reviewLabel, value1: review.number } | |
| )} |
| "aiVaultSessionHistory": "Agents", | ||
| "folderWorkspaces": "Workspaces" |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Localize the new sidebar copy.
These additions are still English in ja.json, so the new right-sidebar tab and panel will render mixed-language UI for Japanese users.
💡 Suggested fix
- "aiVaultSessionHistory": "Agents",
- "folderWorkspaces": "Workspaces"
+ "aiVaultSessionHistory": "エージェント",
+ "folderWorkspaces": "ワークスペース"
...
- "unavailable": "Workspaces are only shown for folder workspaces.",
- "label": "Workspaces",
- "description": "Shows worktrees attached to this folder workspace.",
- "countOne": "1 workspace created here",
- "countMany": "{{value0}} workspaces created here",
- "emptyTitle": "No attached worktrees yet",
- "emptyCopy": "Worktrees created from this folder workspace will appear here."
+ "unavailable": "ワークスペースはフォルダーワークスペースでのみ表示されます。",
+ "label": "ワークスペース",
+ "description": "このフォルダーワークスペースに関連付けられたワークツリーを表示します。",
+ "countOne": "ここで作成されたワークスペース 1 件",
+ "countMany": "ここで作成されたワークスペース {{value0}} 件",
+ "emptyTitle": "添付されたワークツリーはまだありません",
+ "emptyCopy": "このフォルダーワークスペースから作成されたワークツリーがここに表示されます。"Also applies to: 9223-9230
bed4daf to
5a5f0f4
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
docs/folder-workspace-attached-worktrees-plan.md (1)
7-10: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick winRemove the machine-specific absolute paths.
These paths leak a local username/workspace layout and make the doc non-portable. Replace them with neutral placeholders.
🧹 Nitpick comments (2)
docs/folder-workspace-attached-worktrees-plan.md (1)
683-691: 📐 Maintainability & Code Quality | ⚡ Quick winAlign the first shippable slice with the implemented sidebar direction.
This section still reads like the older repo-group nesting plan, but the PR summary says the shipped slice centers the right-sidebar Workspaces panel. Updating this list will keep the design doc from steering contributors toward the wrong implementation path.
src/main/runtime/rpc/methods/worktree.ts (1)
36-39: 🚀 Performance & Scalability | ⚡ Quick winConsider parallelizing independent async calls.
The two store read operations can execute concurrently since they fetch independent data structures. This would reduce the overall handler latency, particularly beneficial for a method that appears to be called during workspace panel refresh.
⚡ Proposed optimization
- handler: async (_params, { runtime }) => ({ - lineage: await runtime.listWorktreeLineage(), - workspaceLineage: await runtime.listWorkspaceLineage() - }) + handler: async (_params, { runtime }) => { + const [lineage, workspaceLineage] = await Promise.all([ + runtime.listWorktreeLineage(), + runtime.listWorkspaceLineage() + ]) + return { lineage, workspaceLineage } + }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 130e74d7-c6f8-4e51-abb2-25290444771b
📥 Commits
Reviewing files that changed from the base of the PR and between 9682c767f8fa70846bed35c44dee04ff50bf2f5d and bed4daf5caeb3f5a9b059ca6d6ebe48420213aa6.
📒 Files selected for processing (43)
docs/folder-workspace-attached-worktrees-plan.mdsrc/cli/handlers/worktree-lineage-summary.tssrc/cli/handlers/worktree.tssrc/cli/help.tssrc/cli/index.test.tssrc/cli/specs/core.tssrc/main/ipc/worktree-remote.tssrc/main/ipc/worktrees.tssrc/main/persistence.test.tssrc/main/persistence.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/worktree-schemas.tssrc/main/runtime/rpc/methods/worktree.test.tssrc/main/runtime/rpc/methods/worktree.tssrc/preload/api-types.tssrc/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsxsrc/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsxsrc/renderer/src/components/right-sidebar/activity-bar-buttons.tsxsrc/renderer/src/components/right-sidebar/index.tsxsrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.tssrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.tssrc/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsxsrc/renderer/src/components/sidebar/WorktreeCard.affiliate-list-mode.test.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/components/sidebar/WorktreeCardMeta.tsxsrc/renderer/src/components/sidebar/WorktreeCardReviewDetailSection.tsxsrc/renderer/src/components/sidebar/WorktreeContextMenu.tsxsrc/renderer/src/components/sidebar/worktree-card-meta-types.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/right-sidebar-route.tssrc/renderer/src/store/slices/settings.tssrc/renderer/src/store/slices/worktree-helpers.tssrc/renderer/src/store/slices/worktrees.test.tssrc/renderer/src/store/slices/worktrees.tssrc/renderer/src/web/web-preload-api.tssrc/shared/constants.tssrc/shared/runtime-types.tssrc/shared/types.ts
✅ Files skipped from review due to trivial changes (2)
- src/cli/help.ts
- src/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (35)
- src/renderer/src/store/right-sidebar-route.ts
- src/main/runtime/rpc/methods/worktree.test.ts
- src/renderer/src/components/right-sidebar/activity-bar-buttons.tsx
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/store/slices/settings.ts
- src/shared/runtime-types.ts
- src/renderer/src/store/slices/worktree-helpers.ts
- src/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.ts
- src/renderer/src/web/web-preload-api.ts
- src/renderer/src/components/sidebar/WorktreeCard.affiliate-list-mode.test.tsx
- src/preload/api-types.ts
- src/shared/constants.ts
- src/cli/specs/core.ts
- src/cli/handlers/worktree-lineage-summary.ts
- src/main/runtime/rpc/methods/worktree-schemas.ts
- src/cli/handlers/worktree.ts
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/components/right-sidebar/index.tsx
- src/renderer/src/store/slices/worktrees.test.ts
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/components/sidebar/WorktreeCardReviewDetailSection.tsx
- src/main/ipc/worktree-remote.ts
- src/main/persistence.test.ts
- src/renderer/src/components/sidebar/WorktreeContextMenu.tsx
- src/shared/types.ts
- src/main/ipc/worktrees.ts
- src/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.ts
- src/renderer/src/components/sidebar/WorktreeCard.tsx
- src/main/persistence.ts
- src/renderer/src/i18n/locales/es.json
- src/cli/index.test.ts
- src/main/runtime/orca-runtime.test.ts
- src/renderer/src/store/slices/worktrees.ts
- src/renderer/src/components/sidebar/WorktreeCardMeta.tsx
- src/main/runtime/orca-runtime.ts
5a5f0f4 to
58554ac
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
docs/folder-workspace-attached-worktrees-plan.md (4)
201-201: 📐 Maintainability & Code Quality | 💤 Low valueFix sentence fragment to clarify the subject.
Line 201 reads "parentInstanceId can be omitted..." but lacks a clear subject introducing the idea. Reword to make the sentence complete and direct.
✏️ Proposed fix
- `parentInstanceId` can be omitted in the first version because folder workspace IDs are durable and not path-derived. + For folder workspace parents, `parentInstanceId` can be omitted in the first version because folder workspace IDs are durable and not path-derived.
345-345: 📐 Maintainability & Code Quality | 💤 Low valueRephrase to avoid split infinitive.
Line 345 contains "visually host child rows," which splits the infinitive "to host." Move the adverb to improve clarity.
✏️ Proposed fix
- This is attractive because `WorktreeCard` already knows how to visually host child rows. + This is attractive because `WorktreeCard` already knows how to host child rows visually.
559-559: 📐 Maintainability & Code Quality | 💤 Low valueAdd hyphen to compound modifier.
Line 559 should use a hyphenated compound adjective "folder-attached" before "groups" for grammatical consistency.
✏️ Proposed fix
- 1. Update reveal logic to expand folder attached groups. + 1. Update reveal logic to expand folder-attached groups.
561-561: 📐 Maintainability & Code Quality | 💤 Low valueReduce repetitive sentence starters in Phase 6.
Lines 559–561 begin three successive sentences with "Update," which reduces readability. Vary the sentence structure for better flow.
✏️ Proposed fix
1. Update reveal logic to expand folder attached groups. -2. Update `renderRowContainsWorktree` so folder-attached groups can reveal children. -3. Update pending reveal scroll behavior for folder parent render rows. +2. Modify `renderRowContainsWorktree` so folder-attached groups can reveal children. +3. Enhance pending reveal scroll behavior for folder parent render rows.src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsx (1)
44-46: 📐 Maintainability & Code Quality | ⚡ Quick winAdd a short “why” comment for the
childInstanceIdguard.This stale-lineage protection is non-obvious; a one-line rationale here would reduce future regressions.
As per coding guidelines, "When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0a2f1c11-fbcd-4b35-a0d9-7ce284216c81
📥 Commits
Reviewing files that changed from the base of the PR and between bed4daf5caeb3f5a9b059ca6d6ebe48420213aa6 and 58554acb63d8ffed7daa484e2b815750006e1e37.
📒 Files selected for processing (43)
docs/folder-workspace-attached-worktrees-plan.mdsrc/cli/handlers/worktree-lineage-summary.tssrc/cli/handlers/worktree.tssrc/cli/help.tssrc/cli/index.test.tssrc/cli/specs/core.tssrc/main/ipc/worktree-remote.tssrc/main/ipc/worktrees.tssrc/main/persistence.test.tssrc/main/persistence.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/worktree-schemas.tssrc/main/runtime/rpc/methods/worktree.test.tssrc/main/runtime/rpc/methods/worktree.tssrc/preload/api-types.tssrc/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsxsrc/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsxsrc/renderer/src/components/right-sidebar/activity-bar-buttons.tsxsrc/renderer/src/components/right-sidebar/index.tsxsrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.tssrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.tssrc/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsxsrc/renderer/src/components/sidebar/WorktreeCard.affiliate-list-mode.test.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/components/sidebar/WorktreeCardMeta.tsxsrc/renderer/src/components/sidebar/WorktreeCardReviewDetailSection.tsxsrc/renderer/src/components/sidebar/WorktreeContextMenu.tsxsrc/renderer/src/components/sidebar/worktree-card-meta-types.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/right-sidebar-route.tssrc/renderer/src/store/slices/settings.tssrc/renderer/src/store/slices/worktree-helpers.tssrc/renderer/src/store/slices/worktrees.test.tssrc/renderer/src/store/slices/worktrees.tssrc/renderer/src/web/web-preload-api.tssrc/shared/constants.tssrc/shared/runtime-types.tssrc/shared/types.ts
✅ Files skipped from review due to trivial changes (1)
- src/cli/help.ts
🚧 Files skipped from review as they are similar to previous changes (35)
- src/shared/constants.ts
- src/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsx
- src/main/runtime/rpc/methods/worktree.ts
- src/renderer/src/store/right-sidebar-route.ts
- src/renderer/src/components/right-sidebar/activity-bar-buttons.tsx
- src/renderer/src/components/sidebar/worktree-card-meta-types.ts
- src/shared/runtime-types.ts
- src/renderer/src/web/web-preload-api.ts
- src/renderer/src/store/slices/settings.ts
- src/renderer/src/components/right-sidebar/index.tsx
- src/main/runtime/rpc/methods/worktree.test.ts
- src/preload/api-types.ts
- src/renderer/src/components/sidebar/WorktreeCard.affiliate-list-mode.test.tsx
- src/main/runtime/rpc/methods/worktree-schemas.ts
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/i18n/locales/es.json
- src/main/ipc/worktrees.ts
- src/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.ts
- src/cli/handlers/worktree-lineage-summary.ts
- src/renderer/src/components/sidebar/WorktreeCardReviewDetailSection.tsx
- src/renderer/src/store/slices/worktree-helpers.ts
- src/cli/specs/core.ts
- src/shared/types.ts
- src/renderer/src/i18n/locales/zh.json
- src/renderer/src/components/sidebar/WorktreeContextMenu.tsx
- src/renderer/src/store/slices/worktrees.test.ts
- src/main/ipc/worktree-remote.ts
- src/cli/handlers/worktree.ts
- src/renderer/src/components/sidebar/WorktreeCardMeta.tsx
- src/renderer/src/components/sidebar/WorktreeCard.tsx
- src/main/persistence.ts
- src/cli/index.test.ts
- src/renderer/src/store/slices/worktrees.ts
- src/main/runtime/orca-runtime.ts
|
|
||
| This planning workspace was created as a child of: | ||
|
|
||
| - Parent workspace: `/Users/thebr/orca/workspaces/orca/butterfish` |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Remove machine-specific absolute paths from the committed design doc (duplicate from previous review).
Lines 7 and 10 contain local filesystem paths with a user identifier (/Users/thebr/...). This exposes personal machine details in a committed document and prevents the doc from being portable across environments.
Replace with neutral placeholders such as /path/to/workspace or relative path references.
🔒 Proposed fix
- Parent workspace: `/Users/thebr/orca/workspaces/orca/butterfish`
+ Parent workspace: `/path/to/orca/workspaces/orca/butterfish`
- Planning workspace: `/Users/thebr/orca/workspaces/orca/folder-workspace-attached-worktrees-plan`
+ Planning workspace: `/path/to/orca/workspaces/orca/folder-workspace-attached-worktrees-plan`Also applies to: 10-10
58554ac to
6d6d7f4
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
docs/folder-workspace-attached-worktrees-plan.md (1)
7-7: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick winRemove machine-specific absolute paths from the committed design doc.
Lines 7 and 10 embed a local filesystem path with a user identifier (
/Users/thebr/...). This exposes personal machine details in a committed document and prevents the doc from being portable across environments. A prior review already flagged this; please replace with neutral placeholders.🔒 Proposed fix
- Parent workspace: `/Users/thebr/orca/workspaces/orca/butterfish` + Parent workspace: `/path/to/orca/workspaces/orca/butterfish` - Planning workspace: `/Users/thebr/orca/workspaces/orca/folder-workspace-attached-worktrees-plan` + Planning workspace: `/path/to/orca/workspaces/orca/folder-workspace-attached-worktrees-plan`Also applies to: 10-10
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d33705ec-1d4f-490d-8634-5a38b49ce38f
📥 Commits
Reviewing files that changed from the base of the PR and between 58554acb63d8ffed7daa484e2b815750006e1e37 and 6d6d7f4b66325dd1a1889fa4a3b37e0d1acdc6ad.
📒 Files selected for processing (43)
docs/folder-workspace-attached-worktrees-plan.mdsrc/cli/handlers/worktree-lineage-summary.tssrc/cli/handlers/worktree.tssrc/cli/help.tssrc/cli/index.test.tssrc/cli/specs/core.tssrc/main/ipc/worktree-remote.tssrc/main/ipc/worktrees.tssrc/main/persistence.test.tssrc/main/persistence.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/worktree-schemas.tssrc/main/runtime/rpc/methods/worktree.test.tssrc/main/runtime/rpc/methods/worktree.tssrc/preload/api-types.tssrc/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsxsrc/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsxsrc/renderer/src/components/right-sidebar/activity-bar-buttons.tsxsrc/renderer/src/components/right-sidebar/index.tsxsrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.tssrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.tssrc/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsxsrc/renderer/src/components/sidebar/WorktreeCard.affiliate-list-mode.test.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/components/sidebar/WorktreeCardMeta.tsxsrc/renderer/src/components/sidebar/WorktreeCardReviewDetailSection.tsxsrc/renderer/src/components/sidebar/WorktreeContextMenu.tsxsrc/renderer/src/components/sidebar/worktree-card-meta-types.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/right-sidebar-route.tssrc/renderer/src/store/slices/settings.tssrc/renderer/src/store/slices/worktree-helpers.tssrc/renderer/src/store/slices/worktrees.test.tssrc/renderer/src/store/slices/worktrees.tssrc/renderer/src/web/web-preload-api.tssrc/shared/constants.tssrc/shared/runtime-types.tssrc/shared/types.ts
✅ Files skipped from review due to trivial changes (3)
- src/renderer/src/i18n/locales/ko.json
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (35)
- src/renderer/src/components/sidebar/worktree-card-meta-types.ts
- src/renderer/src/components/right-sidebar/activity-bar-buttons.tsx
- src/main/runtime/rpc/methods/worktree.ts
- src/renderer/src/store/right-sidebar-route.ts
- src/shared/constants.ts
- src/renderer/src/web/web-preload-api.ts
- src/cli/help.ts
- src/renderer/src/store/slices/worktree-helpers.ts
- src/renderer/src/store/slices/settings.ts
- src/shared/runtime-types.ts
- src/preload/api-types.ts
- src/renderer/src/components/right-sidebar/index.tsx
- src/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.ts
- src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsx
- src/renderer/src/components/sidebar/WorktreeContextMenu.tsx
- src/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.ts
- src/cli/handlers/worktree-lineage-summary.ts
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/components/sidebar/WorktreeCard.affiliate-list-mode.test.tsx
- src/main/ipc/worktrees.ts
- src/cli/specs/core.ts
- src/main/runtime/rpc/methods/worktree-schemas.ts
- src/cli/index.test.ts
- src/cli/handlers/worktree.ts
- src/renderer/src/components/sidebar/WorktreeCardReviewDetailSection.tsx
- src/main/runtime/rpc/methods/worktree.test.ts
- src/renderer/src/store/slices/worktrees.test.ts
- src/main/persistence.test.ts
- src/renderer/src/components/sidebar/WorktreeCardMeta.tsx
- src/renderer/src/store/slices/worktrees.ts
- src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsx
- src/renderer/src/components/sidebar/WorktreeCard.tsx
- src/shared/types.ts
- src/main/runtime/orca-runtime.test.ts
- src/main/runtime/orca-runtime.ts
6d6d7f4 to
6fd98c1
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
docs/folder-workspace-attached-worktrees-plan.md (2)
206-214: 📐 Maintainability & Code Quality | ⚡ Quick winRewrite this compatibility section to match the current lineage contract.
It still frames
worktreeLineageByIdas the primary shape, but the current contracts already exposeWorkspaceLineagekeyed by child workspace and record it directly. Update the doc so it describes the existing model instead of a future migration path.
687-691: 📐 Maintainability & Code Quality | ⚡ Quick winAlign the first-shippable-slice section with the right-sidebar scope.
This still says the first slice is repo-group sidebar nesting, but the PR objective is the folder-workspace right-sidebar “Workspaces” panel. Please update this section so the documented first slice matches the implementation target.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: c3f41a3e-6779-4fc9-9c79-8f19586bcf19
📥 Commits
Reviewing files that changed from the base of the PR and between 6d6d7f4b66325dd1a1889fa4a3b37e0d1acdc6ad and 6fd98c18849ead6e4669b9e3292ad1317c51a8c4.
📒 Files selected for processing (43)
docs/folder-workspace-attached-worktrees-plan.mdsrc/cli/handlers/worktree-lineage-summary.tssrc/cli/handlers/worktree.tssrc/cli/help.tssrc/cli/index.test.tssrc/cli/specs/core.tssrc/main/ipc/worktree-remote.tssrc/main/ipc/worktrees.tssrc/main/persistence.test.tssrc/main/persistence.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/worktree-schemas.tssrc/main/runtime/rpc/methods/worktree.test.tssrc/main/runtime/rpc/methods/worktree.tssrc/preload/api-types.tssrc/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsxsrc/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsxsrc/renderer/src/components/right-sidebar/activity-bar-buttons.tsxsrc/renderer/src/components/right-sidebar/index.tsxsrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.tssrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.tssrc/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsxsrc/renderer/src/components/sidebar/WorktreeCard.affiliate-list-mode.test.tsxsrc/renderer/src/components/sidebar/WorktreeCard.tsxsrc/renderer/src/components/sidebar/WorktreeCardMeta.tsxsrc/renderer/src/components/sidebar/WorktreeCardReviewDetailSection.tsxsrc/renderer/src/components/sidebar/WorktreeContextMenu.tsxsrc/renderer/src/components/sidebar/worktree-card-meta-types.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/right-sidebar-route.tssrc/renderer/src/store/slices/settings.tssrc/renderer/src/store/slices/worktree-helpers.tssrc/renderer/src/store/slices/worktrees.test.tssrc/renderer/src/store/slices/worktrees.tssrc/renderer/src/web/web-preload-api.tssrc/shared/constants.tssrc/shared/runtime-types.tssrc/shared/types.ts
✅ Files skipped from review due to trivial changes (4)
- src/cli/specs/core.ts
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/i18n/locales/es.json
- src/renderer/src/i18n/locales/ko.json
🚧 Files skipped from review as they are similar to previous changes (38)
- src/renderer/src/store/slices/settings.ts
- src/shared/constants.ts
- src/main/runtime/rpc/methods/worktree.test.ts
- src/renderer/src/components/sidebar/worktree-card-meta-types.ts
- src/renderer/src/components/right-sidebar/activity-bar-buttons.tsx
- src/shared/runtime-types.ts
- src/renderer/src/web/web-preload-api.ts
- src/renderer/src/components/right-sidebar/right-sidebar-panel-content.tsx
- src/renderer/src/store/slices/worktree-helpers.ts
- src/renderer/src/store/right-sidebar-route.ts
- src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsx
- src/cli/handlers/worktree-lineage-summary.ts
- src/renderer/src/components/sidebar/WorktreeCard.affiliate-list-mode.test.tsx
- src/main/runtime/rpc/methods/worktree.ts
- src/main/persistence.test.ts
- src/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.tsx
- src/renderer/src/components/sidebar/WorktreeContextMenu.tsx
- src/renderer/src/components/sidebar/WorktreeCardReviewDetailSection.tsx
- src/main/runtime/rpc/methods/worktree-schemas.ts
- src/cli/help.ts
- src/preload/api-types.ts
- src/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.ts
- src/main/ipc/worktrees.ts
- src/renderer/src/store/slices/worktrees.test.ts
- src/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.ts
- src/renderer/src/i18n/locales/ja.json
- src/renderer/src/components/right-sidebar/index.tsx
- src/renderer/src/i18n/locales/zh.json
- src/cli/index.test.ts
- src/renderer/src/components/sidebar/WorktreeCardMeta.tsx
- src/shared/types.ts
- src/main/ipc/worktree-remote.ts
- src/renderer/src/components/sidebar/WorktreeCard.tsx
- src/main/runtime/orca-runtime.test.ts
- src/main/persistence.ts
- src/renderer/src/store/slices/worktrees.ts
- src/cli/handlers/worktree.ts
- src/main/runtime/orca-runtime.ts
Co-authored-by: Orca <[email protected]>
6fd98c1 to
28540d1
Compare
…orkspace-attached-worktrees-plan # Conflicts: # src/renderer/src/i18n/locales/en.json # src/renderer/src/i18n/locales/es.json # src/renderer/src/i18n/locales/ja.json # src/renderer/src/i18n/locales/ko.json # src/renderer/src/i18n/locales/zh.json
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
…orkspace-attached-worktrees-plan # Conflicts: # src/cli/handlers/worktree.ts # src/cli/help.ts # src/cli/specs/core.ts # src/main/persistence.test.ts # src/renderer/src/components/sidebar/WorktreeCard.tsx # src/renderer/src/i18n/locales/en.json # src/renderer/src/lib/worktree-activation.ts # src/renderer/src/store/slices/settings.ts # src/renderer/src/store/slices/worktree-nav-history.ts # src/renderer/src/store/slices/worktrees.ts
…orkspace-attached-worktrees-plan # Conflicts: # src/renderer/src/i18n/locales/en.json
…a worktree set `orca worktree set --parent-worktree folder:<id>` now records workspace lineage for an existing worktree, mirroring what `worktree create` already accepts. The set path resolves the parent through the lineage controller's workspace-aware resolver; a folder parent writes workspace lineage only (replacing any worktree parent) and must share the worktree's execution host. Worktree parents are unchanged. This is the 'manual attach' item deferred by the folder-workspace attached-worktrees design (stablyai#5289).
…rkspace A worktree whose workspace lineage names a folder workspace as parent now renders nested under that folder's row in every Group by mode — including inside status and PR lanes (cross-status nesting) — instead of as a row of its own. The folder card gains the same child chip and collapse toggle worktree lineage parents have. Pinned children keep their pinned placement, and children of a folder that is not rendered stay visible as ordinary rows. This is the sidebar-nesting follow-up the folder-workspace design (stablyai#5289) deferred as 'future enhancement'.
Co-authored-by: Orca <[email protected]>
Summary
Adds folder-workspace lineage for created worktrees and a folder-workspace-only right-sidebar Workspaces panel that shows attached child worktrees as regular read-only WorktreeCards.
This includes:
WorkspaceLineagealongside legacy worktree lineageparentWorkspace/ folder-parent lineageDesign / review outcome
Design doc path:
docs/folder-workspace-attached-worktrees-plan.md.Design review and implementation completeness passes were run before implementation/review. The final implementation follows the reviewed “right sidebar cards first” slice; deeper left-sidebar nesting remains intentionally out of scope.
Implementation notes / deviations
capture.source: active-workspace.git worktree add; post-create lineage recording fail-softs if a parent disappears during a race.worktree.lineageList.Completeness verification
A read-only completeness verifier confirmed the required slice was present: panel copy, persistence cleanup, runtime env lineage capture, CLI parent-workspace paths, panel filtering/sorting, and affiliate WorktreeCard behavior.
Code review loop
Multiple two-at-a-time review rounds were run. Actionable findings were fixed, including:
lineageListRPC test falloutFinal scoped review round: both reviewers returned CLEAN on the last parent-validation fix.
Tests
pnpm run typecheckpnpm run lintsrc/main/persistence.test.tssrc/main/runtime/orca-runtime.test.tssrc/main/runtime/rpc/methods/worktree.test.tssrc/cli/index.test.tssrc/renderer/src/store/slices/worktrees.test.tssrc/renderer/src/components/right-sidebar/right-sidebar-activity-visibility.test.tssrc/renderer/src/components/right-sidebar/FolderWorkspaceWorktreesPanel.test.tsxsrc/renderer/src/components/sidebar/WorktreeCard.affiliate-list-mode.test.tsxgit diff --checkpnpm run build:cli(Brennan-test pass)pnpm build:relay(SSH pass)Brennan-test-changes
Verdict after local pass: local/Electron behavior worked, but SSH validation was required before land.
Local/Electron evidence:
demo-project--parent-workspaceSSH validation
Verdict:
land.Evidence:
/work/demo-projectrepo used via skill-approved local bundle fallback after GitHub clone required authlinux-arm64, native deps installed, relay started successfullyworktree.createcreated/work/orca-ssh-test-1781303005-childon branchrefs/heads/orca-ssh-test-1781303005-childworktree.lineageListreturned workspace lineage from the remote child worktree to the folder workspacegit worktree list --porcelainandgit branch --listmatched the created path/branch/headLINEAGE_PARENT_NOT_FOUNDwith expected guidanceAssumptions / residual risk
folder_workspace_path_scope_not_foundconsole errors after deleting the temp folder workspace; the create/panel path was clean and cleanup succeeded, but this is worth watching if similar cleanup noise appears elsewhere.Made with Orca 🐋