Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile overlay fix: works on smaller devices #2346

Merged
merged 5 commits into from Aug 11, 2023

Conversation

dewanshDT
Copy link
Collaborator

@dewanshDT dewanshDT commented Aug 4, 2023

This is a part of mobile responsive project

Changes:
It changes the _overlays.scss file

Before:
image
overlays_scss_before

After:
overlays_scss_after

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

@lindapaiste
Copy link
Collaborator

lindapaiste commented Aug 4, 2023

It looks like there’s a vertical scroll bar in the “after” screenshot? So there’s a container around that content which needs to have a change to its height. Probably specific to the settings/preferences and not in this overlay.scss file. I know that I said to make a PR with just the overlay.scss changes so we could fix that later if you want or you could fix it now as part of this PR.

position: relative;
padding-bottom: #{25 / $base-font-size}rem;

@media (max-width: 650px) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

My first instinct was that we should centralize these breakpoints into SCSS and JS variables. Then I thought about it more and we don't necessarily need to use the same breakpoints for every component. The point at which the overlay no longer fits might be different than the point where the nav bar doesn't fit, for example. But if we want to add breakpoints to elements which are rendered as children of an overlay (like the preferences) then those would probably need to use the same breakpoints as the overlay. Curious your thoughts on this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah I agree the breakpoints does not need to be same when they are completely unrelated like the navbar and the overlay

@lindapaiste
Copy link
Collaborator

There are some specific issues with specific modals. I DON'T WANT YOU TO FIX THESE. I'm just looking things over to see where we are at. We've always said that the collection lists, etc. would be something that you worked on last only if you had time since your main focus in on the IDE. Maybe we open some issues and let other contributors handle these?

Components rendered inside <Overlay/>:

  • AddToCollectionList (list of collections) - needs a max-width, move searchbar below header.
  • AddToCollectionSketchList (list of sketches) - needs a max-width, move searchbar below header.
  • Preferences - need to remove the explicit height on the container.
  • About - Content needs rearranging. Some of the changes in added styled component to About.jsx #2342 may help.
  • Feedback -- this is in the code but not actually in the app 🙃
  • ShareModal
  • KeyboardShortcutModal - almost good but we need a max-width on the container to force long lines to wrap.
  • ErrorModal
  • CollectionCreate - form fields need a max width.

Copy link
Collaborator

@lindapaiste lindapaiste left a comment

Choose a reason for hiding this comment

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

The purpose of this PR is to make overlays fill the screen on mobile devices and you've mostly done that. The one modal-specific issue which I think is worth addressing now is the height of the "fixed height" overlay, only because that is declared in this same _overlay.scss file. Our intention is that overlays should fill the whole screen on small devices so I think that should apply here too.

/* Fixed height overlay */
.overlay--is-fixed-height .overlay__body {
height: 80vh;
}

We discussed the possibility of writing media queries "mobile first" with the mobile as the default and a min-width media query for the desktop styles. That might be good here because the height: 80vh; only applies on .overlay--is-fixed-height if the min-width query is met. If we write it desktop-first then we need two styles: height: 80vh and an override to set it back to height: 100vh; on small screens. Whereas with mobile-first we only need one style, with a selector and a media query, to apply height: 80vh. But I'll leave that up to you.

@dewanshDT
Copy link
Collaborator Author

It looks like there’s a vertical scroll bar in the “after” screenshot? So there’s a container around that content which needs to have a change to its height. Probably specific to the settings/preferences and not in this overlay.scss file. I know that I said to make a PR with just the overlay.scss changes so we could fix that later if you want or you could fix it now as part of this PR.

yeah I didn't change that due to the reason that these changes were already present in the mega PR that you made me merge in before I started working, I think that we should get that part of the PR merged in the repo, what are your suggestions on this?

@dewanshDT
Copy link
Collaborator Author

There are some specific issues with specific modals. I DON'T WANT YOU TO FIX THESE. I'm just looking things over to see where we are at. We've always said that the collection lists, etc. would be something that you worked on last only if you had time since your main focus in on the IDE. Maybe we open some issues and let other contributors handle these?

Components rendered inside <Overlay/>:

  • AddToCollectionList (list of collections) - needs a max-width, move searchbar below header.
  • AddToCollectionSketchList (list of sketches) - needs a max-width, move searchbar below header.
  • Preferences - need to remove the explicit height on the container.
  • About - Content needs rearranging. Some of the changes in added styled component to About.jsx #2342 may help.
  • Feedback -- this is in the code but not actually in the app 🙃
  • ShareModal
  • KeyboardShortcutModal - almost good but we need a max-width on the container to force long lines to wrap.
  • ErrorModal
  • CollectionCreate - form fields need a max width.

Yeah I agree, as we leave some of the issues for others to fix, we should mention them in the Issues section, also we can add the good first issue label in them

@dewanshDT
Copy link
Collaborator Author

The purpose of this PR is to make overlays fill the screen on mobile devices and you've mostly done that. The one modal-specific issue which I think is worth addressing now is the height of the "fixed height" overlay, only because that is declared in this same _overlay.scss file. Our intention is that overlays should fill the whole screen on small devices so I think that should apply here too.

/* Fixed height overlay */
.overlay--is-fixed-height .overlay__body {
height: 80vh;
}

We discussed the possibility of writing media queries "mobile first" with the mobile as the default and a min-width media query for the desktop styles. That might be good here because the height: 80vh; only applies on .overlay--is-fixed-height if the min-width query is met. If we write it desktop-first then we need two styles: height: 80vh and an override to set it back to height: 100vh; on small screens. Whereas with mobile-first we only need one style, with a selector and a media query, to apply height: 80vh. But I'll leave that up to you.

I'll check it out, I've never saw this before

@lindapaiste
Copy link
Collaborator

@dewanshDT I'd like to get this PR merged. I think we can fix the fixed height ones by changing the current CSS to this. Can you check it out?

 /* Fixed height overlay */ 
 .overlay--is-fixed-height .overlay__body { 
  @media (min-width: 651px) {
     height: 80vh; 
   }
 } 

@dewanshDT
Copy link
Collaborator Author

Yeah, just a minute

@dewanshDT
Copy link
Collaborator Author

check it out


@media (min-width: 770px) {
height: 80vh;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Now I'm playing with this and my head is exploding 🤯 but I think that height: 100vh; is actually all that we need? Because the max-height: 80%; will apply over 651px so that's the same as height: 80vh;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So I should remove the media query then?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I think so. I don't like to have code that doesn't do anything. The overlay looks good though!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done!

Copy link
Collaborator

@lindapaiste lindapaiste 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 major improvement to mobile usability!

@lindapaiste lindapaiste merged commit cade211 into processing:develop Aug 11, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants