Skip to content

Permalink button should copy the link to clipboard on click

Release notes

Copy URL to clipboard on "Permalink" button click.

Problem to solve

When a user clicks on the "Permalink" button on a file view there are high chances he want to copy this link to share it to someone else.

We can save him clicks and keyboard shortcuts by copying directly the content inside its clipboard.

Proposal

When the user clicks on the "Permalink" button GitLab will:

  1. Update the link in the address bar (already done)
  2. Copy link content in the clibpoard
  3. Display a toat message to say that the content is copied in the clipboard, alternatively the button message may be updated briefly to "Copied"

We may as well update the button with a small shiny icon that will highlight the fact that the link will be copied to the clipboard.

Intended users

Any user with code knowledge:

Feature Usage Metrics

We cannot really measure if the user paste the copied content so I do not think we could have relevant metrics.

Alternatively we can split the button in 2 with a zone that will solely update the url (as now) and a zone that will copy to clipboard, we could then report both metrics and compare.

Does this feature require an audit event?

I do not think so