-
Notifications
You must be signed in to change notification settings - Fork 81
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: avoid necessity for overwriting height and scrolling behavior [CFISO-1861] #2859
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thanks a bunch for this, Kathrin! |
@damann ah, i thought we might want to change that, because we got the feedback that it looked super weird when the content became scrollable and it looked like the gap is unintentional. but we can play around with it |
The gap should still be scrollable, meaning you can hover it and scroll the content from there, so it's "part of the content but not really". It's one of the lovely challenges we face due to the way we handle overflow in the web app 😅 |
Not quite sure what the scrolling has to do with the gap. Can we discuss this in power hour, please? |
7988c7f
to
ab654d7
Compare
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
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.
It looks good to me, thank you for doing this work!
Something not introduced by your changes but that we should fix (can be in a follow-up): we violate a11y landmarks because we are nesting the <header>
tag.
See the permitted parents.
The changes don't work with the visual modeler: https://github.com/contentful/visual-modeler/pull/459 Now, I'm pretty sure this works fine once the VM goes into the web app, but it seems like there's an expectation now that the Layout is at a minimum always rendered with a navbar? |
@denkristoffer yeah, the layout is now only to be able to be used as the outer wrapper for content in the user_interface with a navbar. otherwise its impossible to pair the sidebars, scrolling behavior AND stretching it always to the bottom of the page. Its no longer a generic "3 columns and a header" component. to make it more flexible we could offer a offset prop so that the default offset is the navbar or you can overwrite it. |
@Lelith Yes I was thinking similar thoughts, but I would probably default to no offset and then we can wrap the layout once in a component in the web app. I am considering use by customers, out of the box without having to change settings. |
fix: story import
be14bb9
to
1596028
Compare
How does this work at the moment on pages with the fullscreen behaviour and no nav (Like live preview)? Are they fine? |
It looks fine, but other views lack padding at the bottom and their large vertical content is cut. EDIT: I was missing the offset value, hence the lack of padding mentioned above. |
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.
LGTM
Thanks for the review, after discussing with Daniel about the sidebar widths, I am working on updating the API to have various sizes ( |
Purpose of PR
This is a refactor / rewrite of the layout component structure as well as it's styling. It forces the main container, which gives the white background always to be the height of the current view height - offset from the navigation.
The offset will be adjusted for the content height based on wether or not the component contains a header.
The scrolling behavior changes from beeing on the outer wrapper to the individual content elements as soon as at least one sidebar is available. To make all three different areas individually scrollable.
This also extended the storybook example for this component to show different variations with, without header and with different amounts of content.
variant narrow, header and right sidebar
variant wide header, no sidebars
variant wide, header and both sidebars
variant fullscreen, header and both sidebars