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

fix: auto-scrolling on form pages, layout issues #2927

Merged
merged 2 commits into from Jun 19, 2023

Conversation

deboer-tim
Copy link
Collaborator

What does this PR do?

Fixing PR #2863 has exposed issues with all of the 'child form pages':

  • build/pull/run image
  • play kube
  • deploy pod
  • create pod from container

Prior to the change these pages were all reliant on scrolling to exist somewhere external and the entire page would scroll. Although it looked poor in some cases you could always get to the content. Now that we have fixed page headers and no automatic scrolling, these pages need to declare which div to autoscroll on.

While fixing this I found that two screens had prior scrolling/display issues, and controls would appear 'outside' of the background panel or partially hidden offscreen. Although they're not directly related it made sense to fix them here so that I could confirm the correct scrolling behaviour:

DeployPodToKube - The h-1/3 was causing the height calculation to be wrong and the Deploy button
was often hanging off the bottom of the panel. Use a fixed height for the editor instead.
PodCreateFromContainers - The minimum width would force unnecessary scrollbars when the window
was narrow, and float-right left the Close and Create Pod buttons hanging off the bottom of
the panel.

Screenshot/screencast of this PR

1.1 - scrollbars generally work, but on some pages always visible/not working right:
Screenshot 2023-06-19 at 11 19 58 AM

Since #2863 - broken, no scroll: :(
Screenshot 2023-06-19 at 11 26 38 AM

After:
Screenshot 2023-06-19 at 11 18 23 AM

What issues does this PR fix or reference?

N/A

How to test this PR?

Open up each page and resize the window too big or too small.

Fixing PR containers#2863 has exposed issues with all of the 'child form pages':
- build/pull/run image
- play kube
- deploy pod
- create pod from container

Prior to the change these pages were all reliant on scrolling to exist somewhere external and the
entire page would scroll. Although it often looked poor in some cases you could always get to the
content. Now that we have fixed page headers and no automatic scrolling, these pages need to
declare which div to autoscroll on.

While fixing this I found that two screens had prior scrolling/display issues, and controls
would appear 'outside' of the background panel or partially hidden offscreen. Although
they're not directly related it made sense to fix them here so that I could confirm the correct
scrolling behaviour:

DeployPodToKube - The h-1/3 was causing the height calculation to be wrong and the Deploy button
  was often hanging off the bottom of the panel. Use a fixed height for the editor instead.
PodCreateFromContainers - The minimum width would force unnecessary scrollbars when the window
  was narrow, and float-right left the Close and Create Pod buttons hanging off the bottom of
  the panel.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
@deboer-tim deboer-tim requested review from a team and benoitf as code owners June 19, 2023 15:29
@deboer-tim deboer-tim requested review from jeffmaury and cdrage and removed request for a team June 19, 2023 15:29
Copy link
Collaborator

@benoitf benoitf 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 an issue to add overflow-auto everywhere since a couple of weeks. It looks there is something broken as we should have something very simple/ easy but it looks like we're trying to do workarounds everywhere applying tons of styling

@deboer-tim
Copy link
Collaborator Author

Yeah, I was starting to think the same thing. I removed the 'unplanned scrollbars' but now every page needs to say 'auto-scroll this bit'. I think the solution is the same as what I did in SettingsPage: the NavPage should just have autoscroll on the content area.

Moves overflow-auto 'up' to the NavPage so that all child content automatically
scrolls as necessary. Moved top of search bar padding to bottom of title - this
helps child pages without search so that there is a little padding under the
title (when scrolling the content doesn't look like it hits the title).

Most child content divs require 'min-w-full and h-fit' so that the form stays
full width but only as large vertically as necessary, made this consistent.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
@deboer-tim
Copy link
Collaborator Author

Implemented this. Had to add a few missing min-w-full h-fit, but scrolling is now consistent and in one place.

@@ -46,6 +46,8 @@ export let searchEnabled = true;
</div>
{/if}

<slot name="content" />
<div class="flex w-full h-full overflow-auto">
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks better to put it there 👍

@deboer-tim deboer-tim merged commit 01c4d97 into containers:main Jun 19, 2023
8 checks passed
@podman-desktop-bot podman-desktop-bot added this to the 1.2.0 milestone Jun 19, 2023
@deboer-tim deboer-tim deleted the form-pages branch June 26, 2023 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants