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

All results grid #618

Merged
merged 66 commits into from
Jan 21, 2022
Merged

All results grid #618

merged 66 commits into from
Jan 21, 2022

Conversation

zackkrida
Copy link
Member

@zackkrida zackkrida commented Jan 18, 2022

Fixes

Fixes #146 by @zackkrida

Description

Todos

  • Nuxt link around audio boxes prevents use of play/pause button
  • Load more button doesn't work 😱
  • Prevent refetching images/audio when navigating to the audio/image endpoints, if the search query doesn't change
  • Client-side searches fetch media twice! 😨
  • Header loading state appears incorrect while loading results
  • Reduce the column count when the filter sidebar is open
  • Tests 😢

Random information

  • I'm using a seeded pseudo random number generator so that the randomness of audio result placement amongst the images is consistent based on the search result set. The 'seed' (think of it as a unique hash that makes our random number generator produce the same series of numbers each time it is called) is a string of the first and last result IDs for the search.
    • This means that some audio results aren't shown from the initial batch until 'load more' is clicked. Think about it: say a search returned 10k image results and 10k audio results, we'd have 20 images and 20 audio tracks on the first result page, which wouldn't look very good per the design. Instead, the amount of audio results we show is somewhat arbitrary. I think this is an acceptable user experience.
  • We need to do a major audit of state management in Openverse. There's quite a mix of local state, prop drilling, parent components accessing the store and passing values to children as props, and so on, that's inconsistent and unpredictable. Here I chose to access the store directly in the grid component, knowing we can refactor later.
  • I tried to make as little modifications to support the "all" view in the store, actions, and mutations as possible.

Screenshots

CleanShot 2022-01-17 at 22 17 12@2x
CleanShot 2022-01-17 at 22 17 03@2x
CleanShot 2022-01-17 at 22 18 46@2x

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.

zackkrida and others added 30 commits December 15, 2021 09:43
* Add VHeader stub
Rename VSearchBar and VSearchButton and move to VHeader
Add VLogoLoader to VHeader and adjust header styles

* Extract search route handling into composable, set Logo loading when fetching

* Update pnpm lockfile

* Add VFilterButton (#489)

Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Zack Krida <zackkrida@pm.me>

* Add searchbar to header (#491)

Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Zack Krida <zackkrida@pm.me>

* Update references to `InputField` to point to `VInputField` (#586)

* New 404 page (#583)

Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com>

Co-authored-by: Zack Krida <zackkrida@pm.me>
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Dhruv Bhanushali <dhruv_b@live.com>
Co-authored-by: Krystle Salazar <krystle.salazar@automattic.com>
The media store query.mediaType is null for video, so it's not possible to use it as a key to look up results in the store
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
Co-authored-by: Olga Bulat <obulat@gmail.com>
@zackkrida zackkrida added 🌟 goal: addition Addition of new feature 🕹 aspect: interface Concerns end-users' experience with the software 🟥 priority: critical Must be addressed ASAP labels Jan 18, 2022
@zackkrida zackkrida requested review from dhruvkb and obulat January 18, 2022 10:26
@zackkrida zackkrida changed the base branch from main to prod January 18, 2022 14:00
@zackkrida zackkrida changed the base branch from prod to main January 18, 2022 14:01
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.

This is looking really good so far. Visually there's only a couple minor bugs. From an accessibility perspective however, there are some significant bugs with the audio result component.

Audio results need to be composite items with the play/pause button removed from the default tab order. Currently tabbing through each result is fine until you hit an audio result which will tab from the result link into the play/pause button before moving on to the next result. The tab order should just be each result. This happens both with and without VoiceOver activated.

Without VoiceOver, there's also something in the tab order between the filters button in the header and the first "See all ..." content button, but I'm not sure what it is. I couldn't get the same thing to happen in Safari with VoiceOver so I don't think it's an sr-only piece of text or something like that, but it might be.

With VoiceOver, the audio results are not announcing their title. I think this would be fixed with the composite items as I believe they require aria-label which would announce the title.

Long audio titles need to be truncated:

Captura de Tela 2022-01-18 às 10 55 54

The license icon box on the images cuts into the rounded corners. It just needs the lower-start corner to be rounded.

Captura de Tela 2022-01-18 às 10 56 44

The bottom corners of audio results are not rounded:

Captura de Tela 2022-01-18 às 10 57 38

src/components/ImageGrid/ImageGrid.vue Outdated Show resolved Hide resolved
@zackkrida
Copy link
Member Author

Thank you for the audio suggestions @sarayourfriend! I'll prioritize those.

obulat and others added 4 commits January 18, 2022 11:18
* Refactor all fetching to use getters more

* Disable failing tests

* Revert index/key rename in image cell v-for

Co-authored-by: Zack Krida <zackkrida@pm.me>
Add a wrapper to FETCH_MEDIA to simplify fetching all content
@zackkrida zackkrida merged commit f9f549b into main Jan 21, 2022
@zackkrida zackkrida deleted the all-grid branch January 21, 2022 05:45
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: addition Addition of new feature 🟥 priority: critical Must be addressed ASAP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display audio and images together on the "all results" page
5 participants