Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not open chat for doc/edit commands #1678

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Starting from `0.2.0`, Cody is using `major.EVEN_NUMBER.patch` for release versi

- Fixup: Updated the fixup create task to just use the previous command text. [pull/1615](https://github.com/sourcegraph/cody/pull/1615)
- Chat: Opening files from the new chat panel will now show up beside the chat panel instead of on top of the chat panel. [pull/1677](https://github.com/sourcegraph/cody/pull/1677)
- Command: Fixed an issue that opened a new chat window when running `/doc` and `/edit` commands from the command palette. [pull/1678](https://github.com/sourcegraph/cody/pull/1678)

### Changed

Expand Down
6 changes: 4 additions & 2 deletions vscode/src/chat/chat-view/ChatManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ export class ChatManager implements vscode.Disposable {
return
}

// If chat view is not needed, run the recipe via sidebar chat
if (!openChatView) {
// If chat view is not needed, run the recipe via sidebar chat without creating a new panel
const isDefaultEditCommands = ['/doc', '/edit'].includes(humanChatInput)
if (!openChatView || isDefaultEditCommands) {
await this.sidebarChat.executeRecipe(recipeId, humanChatInput, source)
return
}

// Else, open a new chanel panel and run the command in the new panel
const chatProvider = await this.getChatProvider()
if (!openChatView || !this.chatPanelsManager) {
await this.sidebarChat.executeRecipe(recipeId, humanChatInput, source)
Expand Down