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

bug: external file warning when clicking files included via @ in new chat UI #1819

Closed
toolmantim opened this issue Nov 20, 2023 · 3 comments · Fixed by #1919
Closed

bug: external file warning when clicking files included via @ in new chat UI #1819

toolmantim opened this issue Nov 20, 2023 · 3 comments · Fixed by #1919
Assignees
Labels
bug Something isn't working chat/commands Chat and Commands clients/vscode

Comments

@toolmantim
Copy link
Contributor

Version

0.16.0

Describe the bug

Clicking file attachment tokens in the chat transcript causes VS Code to show a warning about an external application wanting to open the file:

Screenshot 2023-11-20 at 2 27 37 pm

Expected behavior

No warning would be shown

Additional context

No response

@toolmantim toolmantim added bug Something isn't working clients/vscode labels Nov 20, 2023
@toolmantim toolmantim added this to the dec/chat-ux-improvements milestone Nov 20, 2023
@abeatrix
Copy link
Contributor

abeatrix commented Nov 20, 2023

Not a bug? This is because of a new setting added by vs code and the setting can only be configured by users for security reason:
https://code.visualstudio.com/updates/v1_84#_confirmation-for-opening-protocol-links

When a protocol link for a file or workspace opens in VS Code, a dialog will now ask for confirmation:

@abeatrix abeatrix added the chat/commands Chat and Commands label Nov 20, 2023
@abeatrix abeatrix self-assigned this Nov 20, 2023
@toolmantim
Copy link
Contributor Author

@abeatrix would it be possible to send a message/command instead of using the vscode://file URI and avoid it?

@abeatrix
Copy link
Contributor

@toolmantim Yea that worked! Here is the PR: #1919

abeatrix added a commit that referenced this issue Nov 28, 2023
CLOSE: #1819

This PR replace the vscode links with custom protocol for the file links
in chat view.

- Replace the vscode file links with a custom "cody.chat.open.file"
command protocol when displaying file names in chat. This allows
handling file opening in a more customizable way without the error
message described in the issue.


## Test plan

<!-- Required. See
https://docs.sourcegraph.com/dev/background-information/testing_principles.
-->

Run the /explain command, and then click on the link after the @ sign:



https://github.com/sourcegraph/cody/assets/68532117/fdf7cad2-5eb3-48c5-926a-88fb56b751b3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chat/commands Chat and Commands clients/vscode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants