Page MenuHomePhabricator

[SW] Offer "copy to clipboard" shortcut for short links
Open, Needs TriagePublicFeature

Description

As a Wikidata Query Service user I want to have a simple way to copy the short URL in order to have a smoother user experience.

Problem:
Currently, on the Wikidata Query Service to copy a short URL to a query or to a query result you must:

  • Click the link button
  • Wait for the link to load
  • Stay hovered over the link button
  • Highlight the link
  • Copy the link

As you have to manually select the text of the URL, which isn't clickable, you also can't use the browser's built-in "Copy link" feature either.

Solution:
An immediate copy of the link when clicking the link, and notifying the user that the link is copied.

Screenshot:

image.png (1×1 px, 94 KB)

BDD
GIVEN a user has created a query
AND wants to share a shorter version of the URL to it
WHEN they click the short URL trigger button
THEN the short URL is immediately copied
AND the user receives a heads-up from the system indicating that the URL has been copied, together with the content of said URL

Acceptance criteria:

  • There is a one-click option to copy a short URL on the Wikidata Query Service

Event Timeline

Gehel moved this task from Incoming to GUI on the Wikidata-Query-Service board.
Gehel added subscribers: Lydia_Pintscher, Gehel.

@Lydia_Pintscher : this seems to be a feature request for the WDQS UI. I'll let you direct it to the right place.

This has actually been bugging me as well...
We need UX input on how to best go about this.

Tech note: for the old TinyURL shortcut method (still the default for third-party installs, I think?), there’s not much we can do here: that’s actually implemented via an iframe, and we can’t access its contents or style it in any way IIRC. But for w.wiki URL shortening, there should be no such issue, and we should be able to turn that into a link and/or add a clipboard button without problems I think. (Unless we’re very keen on maintaining visual consistency with the TinyURL method.)

Right now you have to manually select the text of the URL, which isn't clickable

FWIW, until we implement something better in this task: triple-clicking works fairly well for me so far.

A possible solutions to this could be: 1. An immediate copy of the link when clicking the link, and notifying the user that the link is copied. 2. A button to copy the link

I believe the former solution (copying the short URL when the link icon is clicked) is probably the optimal one. The latter approach introduces an extra button when there's already one that could perform the necessary action. Regardless of the technical approach we choose to take (something to be explored), we probably should do the following:

GIVEN a user has created a query
AND wants to share a shorter version of the URL to it
WHEN they click the short URL trigger button
THEN the short URL is immediately copied
AND the user receives a heads-up from the system indicating that the URL has been copied, together with the content of said URL

I quickly used Chrome dev tools to create an example of how this would look using the existing pop-up, but the visual components of the solution might be different depending on the technical solution we choose:

Screenshot 2024-02-28 at 19.45.56.png (1×1 px, 98 KB)

On the other hand, it looks like the current iframe doesn't entirely disappear on blur. The popup's arrow remains visible until a new interaction takes place on the page. Would be ideal to solve this small issue since we're looking into it:

Screenshot 2024-02-28 at 19.14.56.png (246×278 px, 13 KB)

(cc: @Arian_Bozorg)

Sarai-WMDE renamed this task from Offer "copy to clipboard" shortcut for short links to [SW] Offer "copy to clipboard" shortcut for short links.Mar 5 2024, 9:11 AM