Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 629e1cfe955c37494143d221f86340366b1e48a9 and 43b6476. 📒 Files selected for processing (12)
💤 Files with no reviewable changes (8)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe PR adds git-root resolution for local repositories and uses the resolved root when adding local git repos. It also threads a selected folder path through project-add completion into default-checkout activation, queues an initial CWD for the primary terminal tab, clears queued values during tab cleanup, and uses per-pane CWD resolution for terminal file-link handling. 🚥 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 |
629e1cf to
43b6476
Compare
…e first terminal in the subfolder (#6336) (#6574) Add Project → Browse folder on a monorepo subfolder (e.g. /tmp/monorepo/packages/web) stored the subfolder as Repo.path because isGitRepo() uses `git rev-parse --is-inside-work-tree`, which is true for any subdirectory. Authoritative worktree resolution then snapped activation back to the repo root, so the import identity mismatched and the first terminal landed at the repo root rather than the selected subfolder. Canonicalize local git imports to the actual repo root via getGitRepoRoot() (mirroring the SSH import path that snaps to check.rootPath, including its post-resolution dedup), and preserve the user-selected subfolder as a one-shot initial terminal cwd consumed only by the first activation-created pane. Selecting the repo root applies no override, and re-importing a subfolder of an existing project dedupes. Supersedes community PR #6362. Fixes #6336 Co-authored-by: Rod Boev <[email protected]>
|
Thank you for this fix, @rodboev! 🙏 Your approach — canonicalizing local Git imports to the repo root and preserving the selected subfolder as a one-shot initial terminal cwd — was exactly right. I took this over to rebase it onto current That landed in #6574, which has now been merged to Closing this one as superseded by #6574 — but the design and implementation here were yours. Thanks again for the thorough work, including the regression tests for the pane-scoped cwd leaks. 🐋 |
…e first terminal in the subfolder (stablyai#6336) (stablyai#6574) Add Project → Browse folder on a monorepo subfolder (e.g. /tmp/monorepo/packages/web) stored the subfolder as Repo.path because isGitRepo() uses `git rev-parse --is-inside-work-tree`, which is true for any subdirectory. Authoritative worktree resolution then snapped activation back to the repo root, so the import identity mismatched and the first terminal landed at the repo root rather than the selected subfolder. Canonicalize local git imports to the actual repo root via getGitRepoRoot() (mirroring the SSH import path that snaps to check.rootPath, including its post-resolution dedup), and preserve the user-selected subfolder as a one-shot initial terminal cwd consumed only by the first activation-created pane. Selecting the repo root applies no override, and re-importing a subfolder of an existing project dedupes. Supersedes community PR stablyai#6362. Fixes stablyai#6336 Co-authored-by: Rod Boev <[email protected]>
Summary
When Add Project imports a folder inside a larger Git worktree, Orca currently stores that child path as the repo path, then snaps the project back to the real worktree root during authoritative worktree resolution. The result is a mismatched import identity and a first terminal that lands at the repo root instead of the folder the user picked.
This change fixes both sides of that flow:
The project stays Git-rooted for worktree, file-tree, and source-control behavior. Only the initial terminal landing context changes.
Closes #6336.
No visual change
Testing
pnpm lintpnpm typecheckpnpm testpnpm buildFocused validation completed in this session:
pnpm exec vitest run --config config/vitest.config.ts src/main/git/repo-detection.test.ts src/main/ipc/repos-remote.test.ts src/renderer/src/components/sidebar/AddProjectFromFolderDialog.test.tsx src/renderer/src/components/sidebar/project-added-default-checkout.test.ts src/renderer/src/lib/worktree-activation.test.ts src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.test.ts src/renderer/src/components/terminal-pane/terminal-link-handlers.test.tspnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/terminal-link-handlers.test.ts src/renderer/src/store/slices/store-cascades.test.tspnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.test.ts src/renderer/src/components/terminal-pane/terminal-link-handlers.test.ts src/renderer/src/store/slices/store-cascades.test.tspnpm run typecheck:nodepnpm run typecheck:webAI Review Report
Security Audit
cdcommand.Notes
This keeps contained Git imports as Git projects. It does not convert them into folder workspaces, and it does not persist the selected subfolder beyond the first activation-created terminal. The final branch also tightens pane-scoped file-link cwd handling so later panes, inherited splits, and orphan-tab replacement do not reuse a stale one-shot cwd.