-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Make sidebars responsive #17010
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
Make sidebars responsive #17010
Conversation
started the job as gitpod-build-bmh-responsive-sidebar.1 because the annotations in the pull request description changed |
Looking at this now! 👀 Install Gitpod job seems successful. |
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.
Code LGTM, tested and works nicely 🎨
/hold For @gtsiolis 's feedback
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.
Thanks for making this change, @selfcontained!
Left a few comments below following our discussion around this menu.
Approving additionally to unblock this but holding in case you'd like to address the UX comments below in this PR. Otherwise, we can open a follow-up issue to keep track of these issues.
Thanks also @geropl for the hold above.
/hold
} | ||
}, [link, location.pathname]); | ||
|
||
let classes = "flex block py-2 px-4 rounded-md whitespace-nowrap max-w-52"; |
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.
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.
Yah, that def. looks better. What do you think you'd prefer here for the sidebar nav between the tab-bar or a dropdown?
- A dropdown avoids some of the weird scroll positioning issues when you navigate described in another comment (which we can fix, but might take a bit).
- The tab-bar nav options are a bit more discoverable since you can see (some of) them.
🤔
} | ||
}, [link, location.pathname]); | ||
|
||
let classes = "flex block py-2 px-4 rounded-md whitespace-nowrap max-w-52"; |
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.
thought: Going with the tabs pattern will also help decrease the gap between the menu items and providing a hint for menu items overflowing the viewport.
className={classNames( | ||
// Handle flipping between row and column layout | ||
"flex flex-row md:flex-col items-center", | ||
"w-full md:w-52 overflow-auto md:overflow-visible", |
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.
<Link to={link[0]} key={title} className="md:w-full"> | ||
<li ref={itemRef} className={classes}> | ||
{title} | ||
</li> | ||
</Link> |
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.
suggestion: Probably not the best line to comment about this, but could we not shift the menu items when an item is clicked? Noticed that clicking on an item moves it to the left side of the scrollable area, which sometimes seems a bit jarring, no?
Untitled.mov
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.
Yah, I didn't like this either, tried to explain it a bit in the PR description, but it's buried in there:
Currently navigation on the submenu results in a full route re-render, which resets the scroll position of the menu. This PR shifts the active item into visibility, but it isn't able to maintain scroll position due to the re-render. We can address this in a followup by using nested routes w/ react-router, and only re-render the portions of the page that change as much as possible.
Another thing to consider is if we did a dropdown for nav instead of this scrollbar or a tab-bar, it would avoid that issue.
/unhold will followup with additional improvements |
Description
Step 1 to making sidebars responsive. Shifts the sidebar to a row that scrolls on smaller screens. Also made the
<Heading1/>
slightly smaller on small screens.Follow Up Steps
Related Issue(s)
Fixes #8133
How to test
Preview Env: https://bmh-respon4a5450a2ee.preview.gitpod-dev.com/user/account
Release Notes
Documentation
Build Options:
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish Options
Installer Options
Add desired feature flags to the end of the line above, space separated
Preview Environment Options:
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh