argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
14.56k stars 3.12k forks source link

UI: Open custom `links` in new tab or with router navigation depending on address #13114

Open agilgur5 opened 1 month ago

agilgur5 commented 1 month ago

Summary

The custom Links feature allows you to specify links in various places in the UI, but does not currently specify how to open the link.

It does allow Ctrl+Click to open in new tab as is standard in the browser, but some users would prefer that be the default, per https://github.com/argoproj/argo-workflows/discussions/12605#discussioncomment-9469587, https://github.com/argoproj/argo-workflows/issues/11112#issuecomment-1746988447, and this Slack thread.

Similarly, per https://github.com/argoproj/argo-workflows/issues/11112#issuecomment-1558714545, some users would want internal link to load via router navigation instead of reloading the whole page.

In the Slack thread, I suggested:

We might want to auto-detect internal vs external links and make external ones open in a new tab by default.

Use Cases

  1. If you link to a Logs provider from the Logs Viewer, you might want to open that in a new tab by default
  2. If you link to a specific filter in the Workflows List, you might want that to use router navigation to change the filter without reloading the page
  3. ... and similar ...

Implementation Details

  1. Check if the link URL matches the UI's URL (consider hostname, subdomain, and base href), if so, use router navigation
  2. If not, open in a new tab by default

Message from the maintainers:

Love this feature request? Give it a 👍. We prioritise the proposals with the most 👍.

agilgur5 commented 1 month ago

Possibly something for @Adrien-D to tackle?