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

Fix global layout issues #849

Merged
merged 5 commits into from
Feb 14, 2022
Merged

Fix global layout issues #849

merged 5 commits into from
Feb 14, 2022

Conversation

zackkrida
Copy link
Member

@zackkrida zackkrida commented Feb 10, 2022

Fixes

Fixes #825

Description

This PR makes some cleanup to the main layout logic of every page:

  • Ensures the header and main content area are the first two child elements of our primary grid container, by grouping the locale banner, cc banner, and header into a div.
  • Only applies our grid layout above the medium breakpoint
  • Removes a hardcoded min-width: 300px from the html element
  • Uses viewport width units to fix some flexbox behavior in the header, where using 100% width allowed the header to grow beyond the device width.
  • Hides header logo text and content switcher label on extremely small screens via a new xs breakpoint. Time to make Openverse work on smart watches 😄
  • Unrelated bugfix: Localizes the header logo link properly

In addition to fixing the layout bugs, this should put us in a better position while @panchovm works on additional header revisions.

Testing Instructions

View on an actual mobile device and by resizing your desktop browser 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.

@zackkrida zackkrida requested a review from a team as a code owner February 10, 2022 12:57
@zackkrida zackkrida added 🕹 aspect: interface Concerns end-users' experience with the software 🛠 goal: fix Bug fix 🟧 priority: high Stalls work on the project or its dependents labels Feb 10, 2022
@zackkrida zackkrida changed the title init Fix global layout issues Feb 10, 2022
@zackkrida zackkrida requested a review from obulat February 10, 2022 13:03
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.

Code looks good so far and seems to work fine on desktop. Getting weird message-less and stack-trace-less errors on mobile browser though, so will continue debugging to see if I can find the cause of that.

@zackkrida
Copy link
Member Author

@sarayourfriend I did just push some cleanup, fyi. Small tweaks to mobile.

@sarayourfriend
Copy link
Contributor

Still getting the same mysterious error 😞 It prevents the JS on the page from running at all.

@zackkrida
Copy link
Member Author

Suuuper weird, I don't see anything that would cause that!

@sarayourfriend
Copy link
Contributor

It's the same on Firefox for Android and mobile Safari 🤔 I'll keep trying to debug.

@sarayourfriend
Copy link
Contributor

It appears to be an issue on main actually.

@@ -1,7 +1,7 @@
<template>
<VButton
as="NuxtLink"
to="/"
:to="localePath('/')"
Copy link
Contributor

Choose a reason for hiding this comment

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

Great catch!

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.

Since the issue that Sara mentioned is unrelated to these changes this LGTM 👍

Comment on lines +114 to +116
// Logic for displaying the filter sidebar and search results
// as independently-scrolling sections.
.main {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for documenting the grid logic!

@zackkrida zackkrida requested a review from obulat February 11, 2022 20:46
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.

The layout works perfectly!

overflow: hidden;
}

.main > * {
.main > *:not(:empty) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding :not(:empty) is such a great solution to all the teleports taking up grid areas when empty!

@zackkrida zackkrida merged commit bbccc36 into main Feb 14, 2022
@zackkrida zackkrida deleted the fix-grid branch February 14, 2022 13:19
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
Development

Successfully merging this pull request may close these issues.

About page is broken
4 participants