Skip to content

Commit

Permalink
fix: missing icons for Inline Chat (#320)
Browse files Browse the repository at this point in the history
RE: #321

PR includes following minor changes:

- Fixed missing icons for inline chat. Issue was that we have moved the
output directory from `dist` to `dist/webview`, so we were not able to
get the correct icon path
- Update error message for Inline Touch RE
https://sourcegraph.slack.com/archives/C03CSAER9LK/p1689715497272569


## Test plan

<!--
All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles

Some examples:

// Just a doc change
none - docs change

// Unit tests got your back?
Unit tests

// Tested it manually and CI will also pitch in?
Manually tested and CI
-->

Inline Chat Before:

![Image](https://user-images.githubusercontent.com/68532117/254704544-35af4abf-9a04-487e-860b-04a4d3900bda.png)
![Screenshot 2023-07-19 at 8 20 39
AM](https://github.com/sourcegraph/cody/assets/68532117/dda01ca1-254b-4fc7-90a8-e74d0a5277e5)

Inline Chat After:

![image](https://github.com/sourcegraph/cody/assets/68532117/7af97b99-85bb-4867-a6cf-8495f8da8ec4)

![image](https://github.com/sourcegraph/cody/assets/68532117/bd4c68a1-6a01-48ce-8e0c-267d91ed2aad)
  • Loading branch information
abeatrix committed Jul 19, 2023
1 parent 3e7df36 commit 79f34b8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Starting from `0.2.0`, Cody is using `major.EVEN_NUMBER.patch` for release versi

- Insert at Cusor now inserts the complete code snippets at cursor position. [pull/282](https://github.com/sourcegraph/cody/pull/282)
- Minimizing the change of Cody replying users with response related to the language-uage prompt. [pull/279](https://github.com/sourcegraph/cody/pull/279)
- Inline Chat: Add missing icons for Inline Chat and Inline Fixups decorations. [pull/320](https://github.com/sourcegraph/cody/pull/320)

### Changed

Expand Down
2 changes: 1 addition & 1 deletion vscode/src/services/InlineAssist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function getSingleLineRange(line: number): vscode.Range {
*/
export function getIconPath(speaker: string, extPath: string): vscode.Uri {
const extensionPath = vscode.Uri.file(extPath)
const webviewPath = vscode.Uri.joinPath(extensionPath, 'dist')
const webviewPath = vscode.Uri.joinPath(extensionPath, 'dist/webviews')
return vscode.Uri.joinPath(webviewPath, speaker === 'cody' ? 'cody.png' : 'sourcegraph.png')
}

Expand Down
11 changes: 8 additions & 3 deletions vscode/src/services/InlineController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,15 @@ export class InlineController {
this.selectionRange = initRange
this.thread = null
}

/**
* Display error message when Cody is unable to complete a request
*/
public async error(): Promise<void> {
this.reply('Request failed. Please close this and try again.', 'error')
if (this.currentTaskId) {
const fixupInProgress = this.currentTaskId.length > 0
const requestType = fixupInProgress ? 'fix/touch request' : 'request'
const msg = 'Please provide Cody with more details and try again.'
this.reply(`Cody was unable to complete your ${requestType}. ${msg}`, 'error')
if (fixupInProgress) {
await this.stopFixMode(true)
}
}
Expand Down

0 comments on commit 79f34b8

Please sign in to comment.