ugent-library / deliver

Apache License 2.0
3 stars 0 forks source link

Add copy link button for public shareable links #35

Closed mietcls closed 1 year ago

mietcls commented 1 year ago

Story

Add copy link button for public shareable links.

Context

During user testing it was clear people had trouble with copying the shareable link at once. We need to make it more accessible.

Success criteria

Implementation suggestion

Overview: http://localhost:3000/deliver/spaces/ibl.html

Detail: http://localhost:3000/deliver/spaces/folders/folder-name.html

Button

We would employ one big button that has all the information, which is also readable to screen readers.

Overview page

Scherm­afbeelding 2023-02-07 om 18 27 45
<button class="btn btn-outline-secondary">
    <i class="if if-copy text-primary"></i>
    <span class="sr-only">Copy public shareable link</span>
    <span class="btn-text border-left pl-3 ml-3">https://deliver.ugent.be/ibl/098R4IUHWAFRS9820904-folder-name.html</span>
</button>

Detail page

Scherm­afbeelding 2023-02-07 om 18 35 05
<button class="btn btn-outline-secondary">
    <i class="if if-copy text-primary"></I>
    <span class="btn-text text-primary">Copy public shareable link</span>
    <span class="btn-text border-left pl-4 ml-4">https://deliver.ugent.be/ibl/098R4IUHWAFRS9820904-folder-name.html</span>
</button>

Success

Overview page

Scherm­afbeelding 2023-02-07 om 18 38 32

State changes:

<button class="btn btn-outline-success">
    <i class="if if-check text-success"></i>
    <span aria-live="polite">Copied link</span>
    <span class="btn-text border-left pl-3 ml-3">https://deliver.ugent.be/ibl/098R4IUHWAFRS9820904-folder-name.html</span>
</button>

Detail page

Scherm­afbeelding 2023-02-07 om 18 41 38

The alternative state is hidden in the comments.

State changes:

<button class="btn btn-outline-secondary">
  <i class="if if-check text-success"></I>
  <span class="btn-text text-success" aria-live="polite">Copied link</span>
  <span class="btn-text border-left pl-4 ml-4">https://deliver.ugent.be/ibl/098R4IUHWAFRS9820904-folder-name.html</span>
</button>

TODO

Figure out aria live button state changing (Miet)

nicolasfranck commented 1 year ago

Notes:

nics commented 1 year ago

I also like the github one better

mietcls commented 1 year ago

There are limitations in the current UI components we have that make it impossible to create it the way GitHub did it in a decent way (re: table issues etc). I could spend more time in creating it like that. This was the quickest and most durable solution for now that works in all contexts where the button is used.