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

Fix app layout issues #1257

Merged
merged 47 commits into from
May 10, 2022
Merged

Fix app layout issues #1257

merged 47 commits into from
May 10, 2022

Conversation

zackkrida
Copy link
Member

@zackkrida zackkrida commented Apr 11, 2022

Fixes

Fixes #1214
Fixes #1060
Fixes #1043
Fixes #845

Description

Switches Openverse's frontend to use a truly-sticky header, an actual fixed sidebar, and removes code to hide overflow in parent containers.

Also fixes the mobile header issues by adding w-full to the search input, which overrides the automatic size="20" applied to unsized inputs!

Testing Instructions

Visit the site and observe the filter sidebar, mobile filter popup, and mobile header. If you're on MacOS please try with different scrollbar settings:

CleanShot 2022-04-14 at 17 16 23@2x

You can search 'scrollbar' in system preferences to find those controls. Additionally, please test on mobile devices, the smallest you can find, to make sure that all header elements fit within the viewport without any icons cutting off.

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 zackkrida requested a review from a team as a code owner April 11, 2022 20:38
@zackkrida zackkrida marked this pull request as draft April 11, 2022 20:39
@openverse-bot openverse-bot added 🕹 aspect: interface Concerns end-users' experience with the software 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon labels Apr 11, 2022
@zackkrida
Copy link
Member Author

zackkrida commented Apr 11, 2022

@WordPress/openverse-frontend please review this when you can. The one thing I haven't fixed here, that I would love someone to look into, is fixing the header scroll detection code which is used to change the header layout on mobile.

Ready for review!

class="filters py-8 px-10 min-h-full md:bg-dark-charcoal-06"
data-testid="filters-list"
>
<div class="filters py-8 px-10" data-testid="filters-list">
Copy link
Member Author

Choose a reason for hiding this comment

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

Styles specific to the search filter sidebar have been moved up in the component tree.

src/layouts/default.vue 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.

I have triple scroll bar: two vertical and one horizontal :(
Screen Shot 2022-04-14 at 6 02 57 PM

@zackkrida zackkrida marked this pull request as ready for review April 14, 2022 21:17
@sarayourfriend
Copy link
Contributor

Something here has broken the body scroll lock for the filters modal on mobile (but not the search type switcher 🤔)

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 exciting!

Couple of issues I'm noticing:

  1. Filter sidebar has a scrollbar on desktop widths when the translation banner is visible
  2. When both banners are open the header is so big it obscures almost half the screen on mobile devices
    Screen Shot 2022-04-15 at 06 59 22
  3. There is horizontal scroll on smaller viewports in the filter and search type modals
  4. On smaller viewports the header wraps, I'm not sure what the right solution there is, but maybe the search type switcher button isn't truncating as expected? 🤔
    Screen Shot 2022-04-15 at 07 01 04
  5. The mobile global audio player is behaving quite strangely. It's not actually meant to show on the single result page anyway. Some of this may be caused by mysterious horizontal scrolling on the audio single results page but other aspects of it (like the global audio player not sticking to the bottom of the screen) are unique to this branch.
    Screen Shot 2022-04-15 at 07 02 38

Comment on lines 67 to 71
watch([isMainContentScrolled], ([isMainContentScrolled]) => {
isHeaderScrolled.value = isMainContentScrolled
})
watch([mainContentY], ([mainContentY]) => {
scrollY.value = mainContentY
watch([windowY], ([windowY]) => {
scrollY.value = windowY
Copy link
Contributor

Choose a reason for hiding this comment

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

These can probably be computeds if you want to update them.

@zackkrida
Copy link
Member Author

Great review @sarayourfriend, thank you! I think I can fix this stuff 😄

@obulat
Copy link
Contributor

obulat commented May 10, 2022

I'm confused why those xs screenshots of the attribution tabs changed width 🤔

I think that it was caused by the main being wider than the screen width, and it was overflowing horizontally. At least, when I set main to use class="w-screen", all of the component started fitting into the xs screen, and it seems nothing else broke.

@obulat
Copy link
Contributor

obulat commented May 10, 2022

The changes in the latest PRs:

  • the SearchBar search button was set not to shrink. This stops the search button from being too narrow on small screens.
  • main width is set to 100vh (Tailwind w-screen class). This stops the app from being too wide for the xs screens. This fixes the media reuse visual regression tests, and also makes sure that everything fits into the screen on xs breakpoint.
  • Mobile header vertical padding is set to the smaller py-3 value to match the mockups.

I think this PR is ready to be merged 🚀

@obulat obulat self-requested a review May 10, 2022 11:55
@zackkrida
Copy link
Member Author

zackkrida commented May 10, 2022

@obulat

main width is set to 100vh (Tailwind w-screen class). This stops the app from being too wide for the xs screens. This fixes the media reuse visual regression tests, and also makes sure that everything fits into the screen on xs breakpoint.

w-screen does not account for the width of a visible scrollbar, so it adds horizontal scrolling when scrollbars are set to visible, like on Windows.

Trying w-full instead, I believe the tests still pass. I'll do w-screen md:w-full. As far as I know there are no mobile browsers which display vertical scrollbars. There's likely a child misbehaving that's causing the expansion on small sizes that I'll also investigate if time permits.

@sarayourfriend
Copy link
Contributor

As far as I know there are no mobile browsers which display vertical scrollbars. There's likely a child misbehaving that's causing the expansion on small sizes that I'll also investigate if time permits.

Note that that's just a stopgap. I regularly use Openverse under the md breakpoint on my laptop (with visible scrollbars).

@zackkrida
Copy link
Member Author

zackkrida commented May 10, 2022

@sarayourfriend a full, non stop-gap fix for this is applied, and the Playwright tests are passing.

Copy link
Member

@krysal krysal left a comment

Choose a reason for hiding this comment

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

Such a huge improvement here. I love that the header doesn't make two lines when is scrolled on mobile anymore! :)

#1212 is still an unresolved issue, but that could be addressed apart. Great work here!

@zackkrida
Copy link
Member Author

Ah you're right @krysal #1212 isn't related to this PR. Thanks for the review!

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: medium Not blocking but should be addressed soon
Projects
None yet
5 participants