Repository navigation
fix(floating-workspace): persist Markdown tab renames - #11398
Conversation
Greptile SummaryThis PR fixes Floating Workspace Markdown tab renames by (1) returning
Confidence Score: 5/5Safe to merge; the change is narrowly scoped to the floating workspace rename path and shared serialization helper, leaving SSH, runtime, and folder-workspace paths untouched. The root-cause fix is a single constant comparison with no side-effects on other workspace types. The serialization queue is race-free within the JavaScript event loop. Queue cleanup is correct for all chain depths. The upgraded isSameDirectoryEntryRename uses realpath identity before falling back to case-fold and fails closed on non-ENOENT errors. Tests cover Unicode aliases, concurrent clobber prevention, error recovery, symlink-parent keying, and the full persist-across-restart E2E flow. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/main/destination-serialized-local-rename.ts | New module implementing per-parent-directory serialized rename; queue logic is correct and handles concurrent callers, errors, and cleanup without races or memory leaks. |
| src/shared/filesystem-rename-collision.ts | Replaces case-fold-only same-entry detection with realpath-based identity check; correctly falls back to case-fold for dangling symlinks and fails closed on non-ENOENT realpath errors. |
| src/renderer/src/components/right-sidebar/file-explorer-operation-owner.ts | Adds early-return for FLOATING_TERMINAL_WORKTREE_ID before workspace-key parsing, resolving the root cause of the rename regression; existing SSH/runtime/folder-workspace paths are unaffected. |
| src/main/ipc/filesystem-mutations.ts | Delegates local rename to renameLocalPathSerializedByDestination; SSH rename path is unchanged; path authorization still runs before the serialized call. |
| src/main/runtime/orca-runtime-files.ts | Same delegate pattern as IPC mutations; SSH branch is unaffected; local rename now uses shared serialized helper. |
| tests/e2e/floating-tab-rename.spec.ts | E2E tests covering concurrent clobber prevention, Unicode alias serialization (macOS-only), and full persist-across-restart flow via two Electron launches. |
Reviews (3): Last reviewed commit: "fix(filesystem): canonicalize rename par..." | Re-trigger Greptile
📝 WalkthroughWalkthroughFloating worktree file explorer operations now resolve to the local host through a dedicated ownership path. Local rename operations now use destination-parent serialization with canonical path handling across IPC and runtime entry points. Tests cover floating tab renaming, concurrent renames, Unicode and symlinked parent paths, case-only renames, and permission failures. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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: 1
🧹 Nitpick comments (1)
tests/e2e/floating-tab-rename.spec.ts (1)
20-24: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winBuild the temporary file path with
path.join.The separator heuristic is incorrect for valid POSIX directory names containing
\. Retrieve the directory in the page context, join it withnode:pathin the Playwright process, then passfilePathintopage.evaluate. As per coding guidelines, use path utilities such aspath.joininstead of hardcoded separators.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 45c888c5-a7fb-40e6-ad9f-2e56b65c5e90
📥 Commits
Reviewing files that changed from the base of the PR and between 363e478 and 182e221d75e2a600668d755fc9b2a46da044cf90.
📒 Files selected for processing (3)
src/renderer/src/components/right-sidebar/file-explorer-operation-generation.test.tssrc/renderer/src/components/right-sidebar/file-explorer-operation-owner.tstests/e2e/floating-tab-rename.spec.ts
ba6d27e to
498781f
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/destination-serialized-local-rename.ts (1)
8-12: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueImport the shared
isENOENTguard.This file already imports from the rename-collision module, and
src/main/ipc/filesystem-auth.tsexports the sameisENOENTguard used across filesystem code. Reusing that export here avoids another local duplicate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e9e262cb-e27c-42b6-9918-e448a587a77c
📥 Commits
Reviewing files that changed from the base of the PR and between ba6d27e99e9856ac29777406a4fbd04ff5f660fd and 498781f.
📒 Files selected for processing (5)
src/main/destination-serialized-local-rename.test.tssrc/main/destination-serialized-local-rename.tssrc/main/ipc/filesystem-mutations.test.tssrc/main/ipc/filesystem-mutations.tssrc/main/runtime/orca-runtime-files.ts
* fix(floating-workspace): route markdown renames locally * test(floating-workspace): strengthen rename regression * test(floating-workspace): verify rename restart persistence * fix(filesystem): serialize local rename destinations * fix(filesystem): serialize Unicode rename aliases * fix(filesystem): align rename locks with native aliases * fix(filesystem): canonicalize rename parent locks --------- Co-authored-by: Dzmitry Bachko <[email protected]> Co-authored-by: OrcaWin <[email protected]>
Summary
Fixes #11397.
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm test— the full suite was not run; the focused ownership suite passed with 7 tests.pnpm build— the full build was not run; Electron E2E setup rebuilt the app and bundled CLI successfully.Additional verification:
pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/right-sidebar/file-explorer-operation-generation.test.tsSKIP_BUILD=1 npx playwright test tests/e2e/floating-tab-rename.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1pnpm run check:code-quality:changedpnpm run check:max-lines-ratchetAI Review Report
The review traced the renderer rejection through
captureFileExplorerOperationGuardand identified the missing local owner forglobal-floating-terminal. It checked neighboring local, SSH, runtime, and folder-workspace routes and verified that only the synthetic Floating Workspace path changes.Cross-platform review covered macOS, Linux, and Windows, including shortcuts, labels, paths, shell behavior, and Electron-specific differences. The production change adds none of those platform-dependent behaviors. The E2E setup chooses the runtime path separator.
SSH/remote/local compatibility remains intact because normal worktree and folder-workspace routing is unchanged. Agent, integration, and Git-provider behavior is unaffected. Performance risk is negligible: ownership resolution adds one constant-time ID comparison. UI review found no visual change.
Security Audit
The review covered filename input, path handling, command execution, authentication, secrets, dependencies, and IPC. Existing rename validation, path construction, IPC authorization, and operation-generation guards remain in place. Floating Workspace Markdown storage is app-owned or explicitly user-authorized.
The change adds no commands, credentials, dependencies, IPC surface, or authorization bypass. No security follow-up is required.
Notes