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

Add homepage content switcher for mobile screens #716

Merged
merged 4 commits into from
Jan 28, 2022

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Jan 26, 2022

Fixes

Fixes #709 by @obulat

Description

This PR adds the content type switcher buttons to the homepage that are used on mobile screen. They are hidden on larger screen using tailwind utilities.
@panchovm , I don't know what the hover styles should be for the buttons.

Testing Instructions

Run the app, open the homepage on a narrow screen, and try changing the content types, and searching for different content types.

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.

@obulat obulat added 🟧 priority: high Stalls work on the project or its dependents ✨ goal: improvement Improvement to an existing user-facing feature 🕹 aspect: interface Concerns end-users' experience with the software labels Jan 26, 2022
@obulat obulat requested a review from fcoveram January 26, 2022 04:18
@obulat obulat requested a review from a team as a code owner January 26, 2022 04:18
@obulat obulat self-assigned this Jan 26, 2022
@obulat obulat requested review from zackkrida and dhruvkb January 26, 2022 04:18
Copy link

@fcoveram fcoveram left a comment

Choose a reason for hiding this comment

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

It looks great ✨ I just noticed the following:

  1. Margin-right of content icon is 8px, it should be 4px.
  2. Padding-right of content button is 8px, it should be 12px to look balanced.
  3. Hover should look like Active state. Sorry for not adding it to Design Libary, I will do it now.

@obulat obulat requested a review from fcoveram January 27, 2022 08:20
Copy link

@fcoveram fcoveram left a comment

Choose a reason for hiding this comment

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

Two comments:

I am not seeing the hover style. When pointer is over the button, this does not change its style.

The Active Focus style needs to add a 1px white border inside. I added the component into the Design Library.

CleanShot 2022-01-27 at 09 39 15@2x

@obulat obulat requested a review from fcoveram January 27, 2022 16:06
@obulat
Copy link
Contributor Author

obulat commented Jan 27, 2022

@panchovm , could it be that you still have the old code that did not have hover interactions?

Here is a gif of mouse interactions:
buttons-mouse

And here is a gif of keyboard interactions:
buttons-keyboard

I am not sure when the Active Focus should be applied. Is it when I hover on a button that is selected (black)?

@fcoveram
Copy link

I just checked and I am seeing the last commit. The button does not change when pointer goes over it, just when I clicked on it gets the dark background. Here is my pointer passing over the buttons without click.

And the Active Focus style is when you place the focus over a selected element by keyboard navigation focus. The gif you attached is correct.

@zackkrida
Copy link
Member

@panchovm could you try git pull one more time and see if anything changes? I am also seeing the correct hover state.

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.

Looks nice and is better than having no content switcher, so LGTM!

I do wonder from an a11y perspective if this needs to simulate or use a radio group, since we have multiple buttons that change a single value. We can look into that in a subsequent PR.

@fcoveram
Copy link

I ran the pull and it shows Already up to date, then ran the dev and I am still seeing the same. If it works correctly then skip my observation.

@zackkrida
Copy link
Member

@panchovm that's useful information, we'll wait for others to test and see if we can replicate the behavior you're seeing. Just because it works for Olga and I doesn't mean it's working. Could always be a browser or system issue.

A reminder as well, the primary use case for this component is mobile, where hover states are not present.

@obulat
Copy link
Contributor Author

obulat commented Jan 28, 2022

I do wonder from an a11y perspective if this needs to simulate or use a radio group, since we have multiple buttons that change a single value. We can look into that in a subsequent PR.

Definitely agree, sorry for missing this a11y point. Issue created: WordPress/openverse#627

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.

LGTM! The hover styles work fine for me... I wonder what's going on with @panchovm's local 🤔 It worked in Safari, Chrome and Firefox for me.

src/components/VContentSwitcher/VContentTypeButton.vue Outdated Show resolved Hide resolved
Co-authored-by: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com>
@obulat obulat dismissed fcoveram’s stale review January 28, 2022 15:38

Agreed on this with @panchovm.

@obulat obulat merged commit 0cfb85d into main Jan 28, 2022
@obulat obulat deleted the add/homepage_content_switcher branch January 28, 2022 15:38
rbadillap added a commit that referenced this pull request Feb 2, 2022
* main: (73 commits)
  Make audio/image pages without ids show a 404 (#768)
  Fix logo button paddings and simplify implementation (#767)
  Fix global audio rtl close placement (#780)
  Check for `null` localStorage explicitly (#763)
  Truncate global audio text to two lines (#773)
  New image details page (#682)
  Switch to path-based i18n routing (#701)
  Enable source maps in production (#755)
  Remove Jamendo and Wikimedia Commons from audio meta sources (#747)
  Use jed1x json format to correctly handle pluralization (#753)
  Fix logo color on error page layout (#752)
  Add homepage content switcher for mobile screens (#716)
  Add inline-start border to filters on desktop (#748)
  Fix header items not fitting in (#718)
  Expose `close` to popover content via slot props (#736)
  Truncate row layout audio titles (#735)
  Stop blocking on analytics requests (#715)
  Style links globally (#727)
  Refactor the usage of i18n result count computation (#707)
  Use `VPopover` for the content report form (#719)
  ...
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: improvement Improvement to an existing user-facing feature 🟧 priority: high Stalls work on the project or its dependents
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add content switcher to the mobile homepage
4 participants