-
Notifications
You must be signed in to change notification settings - Fork 4
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
Limit height of page content so that app bar and nav bar stays visible when scrolling #1121
Limit height of page content so that app bar and nav bar stays visible when scrolling #1121
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1121 +/- ##
===========================================
- Coverage 97.66% 97.66% -0.01%
===========================================
Files 42 42
Lines 1586 1585 -1
Branches 433 432 -1
===========================================
- Hits 1549 1548 -1
Misses 34 34
Partials 3 3
Continue to review full report at Codecov.
|
…ity-pages-#996 # Conflicts: # src/helpPage/helpPage.component.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI-wise it looks good but as Louise said we still have an extra vertical scroll bar present in table view. This mostly affects Dataview from what I can see but I had a look elsewhere and saw maybe a couple of other areas that could maybe be improved too.
For example, on the admin download table, we have an extra scroll bar that we probably don't need and this is because the table element is surrounded by what looks to be a Paper component. I removed it and it got rid of the problem but also caused the whole section to be moved too far up and left, like so:
Have a play around with it and see if you can get it lining up nicely, I think it just needs some padding somewhere.
Similarly, I noticed the same problem on the downloadTab component in DataGateway Download which I think might be caused by this? So if you fancy having a go at that one too, that would be cool, would just require a PR on DataGateway repo.
Thank you for the review! I'll look into the scroll bar issue. |
<ThemeProvider theme={theme}> | ||
<Routing /> | ||
</ThemeProvider> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one last change! Adding the ThemeProvider
to the mounted wrapper has resulted in some massive additions to the snapshots that we just don't need. If you take it out from all the mounted wrappers in this file, you should get some more manageable snapshots. Once it's done, compare the new snapshots to what is currently on develop branch and as long as they look fairly similar in size, they're probably good to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I just realised. The ThemeProvider was what I initially told you to change. And now I realise that it's not even needed. Really sorry! I owe you one for this 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries! I didn't know it wasn't needed. I thought the Routing
component would need it but turns out it doesn't. I don't think it should be removed though as we will have to rewrite it in @testing-library
in the future which will actually require ThemeProvider
since it renders the entire component out, and all the styling obviously requires the theme
object to be in context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, if we remove it, we can more easily test the snapshot is correct during the migration to testing-library, plus just leaving the import by itself will make the linter complain. But that's just my opinion
I think it is due to a slight miscalculation of height in |
I thought it could be something like that. Try the solution on a bunch of pages before submitting it, just to make sure it doesn't accidentally break something else! |
The calculation is only for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this with ral-facilities/datagateway#1378 and it works well!
We do now have a snapshot that's bigger than it's worth but as long as we put a pin in it to remember to reduce it when we refactor tests, it can stay for now
It should become smaller as we slowly migrate to |
Description
This PR limits the height of
PageContainer
so that the app bar and the footer is still visible when the page is scrolling.Demo
This clip shows the new scroll behavior:
SciGateway.and.10.more.pages.-.Work.-.Microsoft.Edge.2022-07-07.15-39-55.mp4
Testing instructions
Agile board tracking
connect to #996
Closes #996