Repository navigation
fix(openFolder): set NSOpenPanel directoryURL to focused pane's working directory - #2039
BillionClaw wants to merge 1 commit into
Conversation
|
@BillionClaw is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
|
To use Codex here, create a Codex account and connect to github. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR adds conditional preset directory configuration to folder selection dialogs in two files. When opening a folder via the palette or file menu, the Changes
Possibly related PRs
Poem
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Greptile SummaryThis PR fixes the
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant MenuOrPalette as Menu / Command Palette
participant TabManager as TabManager
participant Workspace as selectedWorkspace
participant NSOpenPanel
User->>MenuOrPalette: ⌘O / palette.openFolder
MenuOrPalette->>TabManager: selectedWorkspace?.currentDirectory
TabManager->>Workspace: currentDirectory (shell integration)
Workspace-->>MenuOrPalette: "/path/to/cwd" (or nil/empty)
MenuOrPalette->>NSOpenPanel: Create panel (canChooseDirectories=true)
alt cwd is non-nil and non-empty
MenuOrPalette->>NSOpenPanel: directoryURL = URL(fileURLWithPath: cwd)
else cwd absent
Note over NSOpenPanel: Falls back to ~/Documents (macOS default)
end
NSOpenPanel-->>User: Present file picker at cwd
User->>NSOpenPanel: Select folder
NSOpenPanel->>TabManager: addWorkspace(workingDirectory: url.path)
Reviews (1): Last reviewed commit: "fix(openFolder): set NSOpenPanel directo..." | Re-trigger Greptile |
|
Thanks for the contribution! This has been addressed by #2034 which was just merged. |
Summary
What changed? Set the
directoryURLproperty onNSOpenPanelbefore presenting it for the⌘OOpen Folder action, so the file picker opens at the selected workspace's working directory instead of the macOS default ~/Documents.Why?
NSOpenPaneldefaults to ~/Documents whendirectoryURLis not set. By readingactiveTabManager.selectedWorkspace?.currentDirectory(ortabManager.selectedWorkspace?.currentDirectoryin the command palette path), the panel now opens at a contextually relevant location.Testing
directoryURLfrom the workspace's current directory before callingrunModal().currentDirectoryis populated from the focused pane's shell integration and used as the fallback when set.Files changed
Sources/cmuxApp.swift: menu File → Open Folder (⌘O) pathSources/ContentView.swift: command palettepalette.openFolderpathReview Trigger
Summary by cubic
Open Folder now starts in the focused workspace’s working directory instead of ~/Documents. We set NSOpenPanel.directoryURL from the selected workspace’s currentDirectory in both the File → Open Folder (⌘O) and command palette actions.
Written for commit 27beb34. Summary will update on new commits.
Summary by CodeRabbit