Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Update license explanation tooltip #850

Merged
merged 33 commits into from
Feb 22, 2022
Merged

Update license explanation tooltip #850

merged 33 commits into from
Feb 22, 2022

Conversation

dhruvkb
Copy link
Member

@dhruvkb dhruvkb commented Feb 10, 2022

Fixes

Fixes #761 by @Ad-Mk
Fixes #423 by @obulat
Fixes #541 by @panchovm

Description

This PR

  • adds icons and explanation for deprecated CC licenses
  • uses VPopover to render license explanations
  • refactors old components using defineComponent and 'V-' prefix
  • replaces hardcoded data in store with calculated data

Testing Instructions

  1. Check out the PR and run the dev server.
  2. Search for any term and open the filter sidebar.
  3. Check that the license explanation appears inside the bounds of the window.

Checklist

  • My pull request has a descriptive title (not a vague title like Update index.md).
  • My pull request targets the default branch of the repository (main) or a parent feature branch.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added or updated tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

@dhruvkb dhruvkb added 🟧 priority: high Stalls work on the project or its dependents 🛠 goal: fix Bug fix 🕹 aspect: interface Concerns end-users' experience with the software labels Feb 10, 2022
@dhruvkb dhruvkb requested a review from a team as a code owner February 10, 2022 13:49
src/store/search.js Outdated Show resolved Hide resolved
Copy link
Contributor

@obulat obulat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great improvement!

There are a couple of things that don't match the mockups:

  • there is not 'Cross' close button at the top right corner
  • the heading font size should be 14px

Co-authored-by: Olga Bulat <[email protected]>
Copy link
Contributor

@sarayourfriend sarayourfriend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the deprecated license icons! That's a great addition 🎉

Navigating to an image result from the search page results in the app crashing. It does work if you reload the result page directly in SSR though. This appears to be an issue with media.license being undefined instead of a string.

In addition to what Olga pointed out, there's a couple other issues I noticed:

  1. Keyboard navigation is mostly fine, but we should change the initial focus element to be the license explanation text rather than the Read more link
  2. On mobile, opening the filters really messes with the layout of the filters on the page. It's also difficult to close the popover by tapping outside of it, which is probably more a Popover bug than it is an issue with this PR. I tested the popover component on mobile in Storybook and they worked fine, tapping outside of the popover closed it as expected. I'm wondering if there's some edge case with mobile Safari where tapping inside a fieldset doesn't register a regular click event or something? I can't reproduce it in Firefox for Android (neither the interaction issue nor the layout issue).

Here's a screenshot of the layout issue on mobile Safari. Note the license buttons are pushed all the way next to the license text.
IMG_1564

src/components/VFilters/VFilterChecklist.vue Outdated Show resolved Hide resolved
src/components/VFilters/VFilterChecklist.vue Outdated Show resolved Hide resolved
src/components/VLicenseElements.vue Outdated Show resolved Hide resolved
@sarayourfriend
Copy link
Contributor

aria-hidden is being applied on the entire license element explanation, not just the decorative icon.

The icon should have role="presentation" rather than aria-hidden, that's my bad for the incorrect recommendation.

Otherwise this is looking good.

:size="isSmall ? 5 : 6"
:icon-path="icons[element]"
/>
<span class="sr-only">{{ element.toUpperCase() }}</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For pdm and cc0 or any other "single element licenses/marks" this can be left out as it's redundant with the heading of the popover.

@dhruvkb
Copy link
Member Author

dhruvkb commented Feb 22, 2022

@sarayourfriend please review this PR. If all's okay, I'll resolve the conflicts and merge it.

@sarayourfriend
Copy link
Contributor

sarayourfriend commented Feb 22, 2022

I don't currently have access to VoiceOver or NVDA so if someone else can test that it would be ideal. Based on the code changes the problems I was concerned about should be addressed so I'm removing my request for changes.

I'll work on setting up a Windows VM this week so I can continue testing NVDA and start testing JAWS as well.

@sarayourfriend sarayourfriend dismissed their stale review February 22, 2022 13:00

Changes applied

@fcoveram
Copy link

I noticed two things:

  1. I do not see the tooltip when pointer is over the question icon
  2. The question icon should change to dark-charcoal in hover.

Here is the mockup for reference and a screenshot of expected implementation. The component is from the WordPress Design Library.

CleanShot 2022-02-22 at 10 38 57@2x

@sarayourfriend
Copy link
Contributor

sarayourfriend commented Feb 22, 2022

I do not see the tooltip when pointer is over the question icon

We don't currently have a component to handle tooltips. Can we implement this feature in a separate PR? This one is already really long running. The icon does have an aria-label so it's accessible for screen readers at least.

The main reason I'd like to push the tooltip into a separate issue/PR is that tooltips have their own set of complicated a11y considerations that would probably delay this PR even more than it's already been. Whomever implements the tooltip component will need to do some research into the best practices for them. I think it can be implemented using the VPopover or its composables but the a11y requirements are slightly different (especially around focus handling and disclosure interactions).

@fcoveram
Copy link

Absolutely, that makes sense. Putting my comment aside, excellent work @dhruvkb, as always ✨

@obulat
Copy link
Contributor

obulat commented Feb 22, 2022

We could add a tooltip like that by adding title attribute, but I'm not sure how accessible it is. Both the title and the button label seem to be read.

@sarayourfriend
Copy link
Contributor

We could add a tooltip like that by adding title attribute, but I'm not sure how accessible it is. Both the title and the button label seem to be read.

IIRC SRs behave slightly differently when there's both title and aria-label, some read the title, some read the label, some do other funky things to I think.

@sarayourfriend
Copy link
Contributor

@panchovm can you verify if this PR happens to fix the issues you filed in #759?

@zackkrida zackkrida self-requested a review February 22, 2022 16:23
@zackkrida
Copy link
Member

Here's a video of VoiceOver in Safari, using keyboard navigation. Please turn the sound on for the full experience.
It seems that:

  • the close button is focused by default in the popover
  • the popover contents are not read to the user
CleanShot.2022-02-22.at.11.22.00-converted.mp4

@sarayourfriend
Copy link
Contributor

@zackkrida I think those are meant to be addressed in a separate issue as discussed in this conversation #850 (comment) (you need to expand the resolved conversation to see it).

Copy link
Member

@zackkrida zackkrida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I've tried to read through the (extensive) history of updates since I approved this, and I believe everything is done. I created a new issue for the high-priority bug of screen readers not announcing the popover contents: #987

@zackkrida
Copy link
Member

@panchovm if you have an opportunity today, could you test this pull request and then open it on your iPad? You should see a permalink like http://172.16.227.1:8443/ that will allow you to open the app running on your computer on your iPad.

We have a theory that this pull request fixes the issue you were seeing in #759

If @dhruvkb has merged this before you get to do this, you can test it with the main branch. Thank you!

@dhruvkb dhruvkb merged commit cb1954f into main Feb 22, 2022
@dhruvkb dhruvkb deleted the licence_popover branch February 22, 2022 20:24
@dhruvkb
Copy link
Member Author

dhruvkb commented Feb 22, 2022

@panchovm I merged this pretty quickly because it was repeatedly developing conflicts. You can test this on your iPad by directly opening search-staging.

@fcoveram
Copy link

I tested it on my iPad on Firefox and Safari and the header bug (#759) has gone. It works perfectly. Excellent work ✨

obulat added a commit that referenced this pull request Feb 23, 2022
* Rename AudioDetails (#892)

* Rename AudioDetails folder

* Fix store access

* Revert conversion to Composition API

* Revert conversion to defineComponent

* Update pot

* Use v-show instead of v-if for width-based condition (#884)

* Use v-show instead of v-if for width-based condition

Use v-show instead of v-if to fix server-client mismatch

* Fix waveform not loading on SSR

* Split CI into discrete jobs (#981)

* Split CI into discrete jobs

* Update outdated POT file

* Skip writing POT file if the only thing changing is the date

* Format yaml

* Add yaml to lint staged

* Get locales when setting up node env

* Cram it all into a single workflow

* Add getting translations

* Update license explanation tooltip (#850)

Co-authored-by: Zack Krida <[email protected]>
Co-authored-by: sarayourfriend <[email protected]>

* Fix attribution HTML glyph reference and fix historical usages as well (#990)

* Fix attribution HTML glyph reference and fix historical usages as well

* Add missing license parts

* Add note to explain directory structure

* Refactor media services (#867)

* Create a single media-service data fetching object

* Move slug creation from media service to the api service

* Use typing data from #868

* Update src/constants/media.js

Co-authored-by: sarayourfriend <[email protected]>

* Apply suggestions from code review

Co-authored-by: sarayourfriend <[email protected]>

* edit api-service styles; format

* fix decode-media-data type import

* Return decoded data from the media services

Co-authored-by: sarayourfriend <[email protected]>

* Make active media setup store and add unit tests

* Commit the lock file

* Fix merge problems

Co-authored-by: sarayourfriend <[email protected]>
Co-authored-by: Dhruv Bhanushali <[email protected]>
Co-authored-by: Zack Krida <[email protected]>
obulat added a commit that referenced this pull request Mar 3, 2022
* Install Pinia

* Update the active media store to use Pinia

* Delete the Vuex store

* Update type definition and use it

* Document the store composition variable

* Fix a lint error that Prettier did not catch locally

* Use `~` instead of `@` in imports

* Update the nav store to use Pinia

* Rename store

* Make mutation payload fields non-nullable

* Fix leftover incorrect usage of the active media store

* Make active media setup store and add unit tests (#997)

* Rename AudioDetails (#892)

* Rename AudioDetails folder

* Fix store access

* Revert conversion to Composition API

* Revert conversion to defineComponent

* Update pot

* Use v-show instead of v-if for width-based condition (#884)

* Use v-show instead of v-if for width-based condition

Use v-show instead of v-if to fix server-client mismatch

* Fix waveform not loading on SSR

* Split CI into discrete jobs (#981)

* Split CI into discrete jobs

* Update outdated POT file

* Skip writing POT file if the only thing changing is the date

* Format yaml

* Add yaml to lint staged

* Get locales when setting up node env

* Cram it all into a single workflow

* Add getting translations

* Update license explanation tooltip (#850)

Co-authored-by: Zack Krida <[email protected]>
Co-authored-by: sarayourfriend <[email protected]>

* Fix attribution HTML glyph reference and fix historical usages as well (#990)

* Fix attribution HTML glyph reference and fix historical usages as well

* Add missing license parts

* Add note to explain directory structure

* Refactor media services (#867)

* Create a single media-service data fetching object

* Move slug creation from media service to the api service

* Use typing data from #868

* Update src/constants/media.js

Co-authored-by: sarayourfriend <[email protected]>

* Apply suggestions from code review

Co-authored-by: sarayourfriend <[email protected]>

* edit api-service styles; format

* fix decode-media-data type import

* Return decoded data from the media services

Co-authored-by: sarayourfriend <[email protected]>

* Make active media setup store and add unit tests

* Commit the lock file

* Fix merge problems

Co-authored-by: sarayourfriend <[email protected]>
Co-authored-by: Dhruv Bhanushali <[email protected]>
Co-authored-by: Zack Krida <[email protected]>

* fix possibly undefined

* Add tests and other small fixes

* Update nuxt.config.ts

Co-authored-by: Zack Krida <[email protected]>

* Move converted modules to /stores/ and add unit tests

* Fix linting error

* Update nuxt.config.ts

Co-authored-by: sarayourfriend <[email protected]>

* Add changes from review

* Register component

* Make properties readonly

* Remove dublicates

Co-authored-by: Olga Bulat <[email protected]>
Co-authored-by: sarayourfriend <[email protected]>
Co-authored-by: Zack Krida <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🕹 aspect: interface Concerns end-users' experience with the software 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents
Projects
None yet
5 participants