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

Support command links in notifications #46571

Closed
eamodio opened this issue Mar 26, 2018 · 5 comments
Closed

Support command links in notifications #46571

eamodio opened this issue Mar 26, 2018 · 5 comments
Assignees
Labels
feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded workbench-notifications Notification widget issues
Milestone

Comments

@eamodio
Copy link
Contributor

eamodio commented Mar 26, 2018

Now that notifications support links via markdown (which should be documented), it would be great if there was support for command links.

Can probably reuse MarkdownString if these will need to be trusted in the same way as hovers.

//cc @jrieken @bpasero

@bpasero bpasero added feature-request Request for new features or functionality workbench-notifications Notification widget issues labels Mar 26, 2018
@bpasero
Copy link
Member

bpasero commented Mar 26, 2018

I am not sure about MarkdownString because that might draw the wrong assumption that notifications support any markdown. Currently we only support links (http / https) and I would stay away from opening that too much to ensure notifications always have a consistent look.

I agree though that currently the fact that links are supported is a bit magic and hidden.

@eamodio
Copy link
Contributor Author

eamodio commented Mar 26, 2018

Yeah, definitely agree on the look/styling (although bold and italic might be nice), but command links could be valuable. For example, I am adding a notice to GitLens if you have the old set of keyboard shortcuts (which are known to conflict with other keyboard layouts), and I attempted to provide a link to open the GitLens Settings editor if someone wanted to jump there.

Something like this:
image

@jrieken jrieken removed their assignment Mar 27, 2018
@eamodio
Copy link
Contributor Author

eamodio commented Sep 4, 2018

It would be great if not only command: links were supported but also registered uri handlers. I attempted to register a Uri handler to provide a link from a notification, but it looks like only http|https is supported.

@eamodio eamodio changed the title Support command links in notifications Support command/UriHandler links in notifications Sep 19, 2018
@eamodio
Copy link
Contributor Author

eamodio commented Sep 19, 2018

So if I wanted to submit a PR for this -- I assume just adding vscode and vscode-insiders to this regex would be fine. https://github.com/Microsoft/vscode/blob/b2a361e9899cd20679a7592e1050487292c9a094/src/vs/workbench/common/notifications.ts#L328

But for command: links, I know when we talked about getting them in hovers there was security concerns and MarkdownString was added with the isTrusted property. Does the same thing need to be done here? Is that the right approach?

@bpasero bpasero self-assigned this Apr 12, 2019
@bpasero bpasero added the verification-needed Verification of issue is requested label Apr 12, 2019
@bpasero bpasero changed the title Support command/UriHandler links in notifications Support commandlinks in notifications Apr 12, 2019
@bpasero bpasero changed the title Support commandlinks in notifications Support command links in notifications Apr 12, 2019
@bpasero bpasero added this to the April 2019 milestone Apr 12, 2019
@bpasero
Copy link
Member

bpasero commented Apr 12, 2019

This is now possible using the following syntax: [link name](command:<command id> "Title")

@eamodio if you still feel we should support other link handlers, I suggest you open a separate feature request.

@bpasero bpasero closed this as completed Apr 12, 2019
@sandy081 sandy081 added the verified Verification succeeded label May 7, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded workbench-notifications Notification widget issues
Projects
None yet
Development

No branches or pull requests

4 participants