sourcegraph / cody

AI that knows your entire codebase
https://cody.dev
Apache License 2.0
2.25k stars 215 forks source link

Make mention chips open links #4630

Closed thenamankumar closed 1 week ago

thenamankumar commented 2 weeks ago

closes: https://linear.app/sourcegraph/issue/CODY-2503/make-mention-chips-link-to-the-uri-on-pressing-cmd-click

This PR makes the mention chips redirect to the item URI when the user presses CMD(mac) + click.

In case the URI is a file, it opens it in a new tab. Otherwise, it opens the external link in the browser.

Test plan

Demo: https://www.loom.com/share/e4e7bd04fe744f4aafac43461a68ea5e?sid=6afa205a-6e66-4232-a25b-80b2ec4fc26d

toolmantim commented 1 week ago

I wonder how people would discover this feature? 🤔 If it's via the changelog/blog post, we should mention in here in the PR description what the keyboard shortcut is for Windows/Linux too (is it Alt?).

Perhaps once #4580 is merged we can look at mentioning "cmd click" in the chip tooltip, or we add a "..." button that appears on hover on the chip, that gives you a context menu with an "Open file" item that also shows the keyboard shortcut.