Use project cwd when opening draft threads without a worktree path#183
Merged
Merged
Conversation
- Pass resolved `openInCwd` from ChatView into OpenInPicker - Fall back to project `cwd` when draft thread has no `worktreePath` - Add browser test covering Open action for draft-only snapshot
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openInCwdfromChatViewintoChatHeader/OpenInPickerso editor open actions no longer depend on thread/project lookups inside the picker.activeThread.worktreePathand fall back toactiveProject.cwdwhen computing the open path.OpenInPickerclick/shortcut handlers and button disabled state to useopenInCwddirectly.shellOpenInEditoris sent with project cwd when no worktree path exists.Testing
opens the project cwd for draft threads without a worktree pathinapps/web/src/components/ChatView.browser.tsx.bun lint.bun typecheck.bun run test.Note
Medium Risk
Adjusts the path used for native
shell.openInEditoractions (button + shortcut) and could change behavior for some thread/project edge cases, though the change is small and covered by a new browser test.Overview
Ensures the Open in editor action works for local draft threads that don’t yet have a
worktreePathby computing anopenInCwdinChatView(worktreePathfallback to projectcwd) and passing it down toChatHeader/OpenInPicker.OpenInPickerno longer does its own thread/project store lookups; its click handler, keyboard shortcut handler, and disabled state now rely solely onopenInCwd.Adds a browser test that mounts a draft-only thread (no server threads in snapshot), clicks Open, and asserts a
shellOpenInEditorWS request is sent with the projectcwd(including test harness support to capture WS requests and reset draft store state between tests).Written by Cursor Bugbot for commit 19d5853. This will update automatically on new commits. Configure here.
Note
Route Chat header Open control to use the draft thread worktree path or fall back to the project cwd when calling
api.shell.openInEditorin ChatView.tsxIntroduce
openInCwdinChatViewand pass it throughChatHeadertoOpenInPicker, which now callsapi.shell.openInEditorwith that cwd and disables the control when null; add tests that capture WebSocket RPCs and verify the cwd fallback behavior.📍Where to Start
Start with
ChatViewcomputingopenInCwdin ChatView.tsx, then follow its propagation throughChatHeadertoOpenInPicker.Macroscope summarized 19d5853.