-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[docs-infra] Revamp the product switcher design #42603
[docs-infra] Revamp the product switcher design #42603
Conversation
Netlify deploy previewhttps://deploy-preview-42603--material-ui.netlify.app/ Bundle size report |
Looks amazing. We need to fix the keyboard navigation. |
Yeah, so, that's technically fixed compared to the production version (you can tab through the options)(via the docs, not via the marketing pages yet), as I switched from using the Menu to using Popper + Menu List. However, I understand that to be inaccurate as in menus, we should be able to navigate via arrow keys instead of tabs (afaik). I had tried using Menu Items, still with the Menu, to see if I'd get all of that for free, but for some reason, that wasn't working properly. |
I'm unable to navigate the options in the newly added menu. I tried tab and arrow keys with no luck 🤔 |
Uhm, I can do it by focusing on the docs button and then pressing enter. tab.mp4Pressing esc while the button is focused doesn't close the Popper, though (something else to fix, I guess). |
Oh, I was trying from the home page 😅 Kapture.2024-06-11.at.12.57.55.mp4 |
Yeah, it's expected not to work on the marketing page's navbar—I haven't touched the code there given I'm considering removing the Docs button altogether (#42540). |
Even better! |
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 amazing! The logos and icons blend perfectly 🔥
I have a couple of remarks, more like questions:
- Should the navigation use
arrows
ortabs
? IMO, arrows feel more natural, though I'm not sure what the best approach is. Whatever is decided, it's important to be sure that all menus follow the same interaction—both in the marketing and docs pages. - I think we could use some animations and micro-interactions to spice things up a bit—I was thinking of something like this
So, it's not even a matter of feeling, but rather accuracy to the the ARIA patterns specs. The prod implementation, using the Menu component, didn't have any keyboard navigation interaction working at all. I tried some different approaches on this PR (like using the Menu Item as the base component for the
Uhm... will think about it. 🤔 |
It's missing a few things like
But in any case, neither of them are accessible currently, and this is an improvement. So I think it could be shipped. |
It does close on esc if you're focused on a menu item; it doesn't otherwise because opening the popover doesn't automatically put focus on the first menu item (something that I was expecting to get for free from the Material components; there's something strange).
That and tab navigation or that and then remove tab navigation (i.e., you can only navigate through via arrow keys)? That's the fundamental question I had with this PR.
Yeah, the popover doesn't have a role defined, but which one should it be? The |
Looks fantastic @danilo-leal! We're looking to divide the Toolpad section into Studio and Core in the upcoming month - I'm assuming we could do something like this when the time comes? |
@bharatkashyap yeah, exactly—looks great! |
The keyboard navigation is broken because you're breaking the contract with the Since the material-ui If I do so, the It might be doable with base-ui since
https://mui.com/base-ui/react-menu/#wrapping-menu-items Feel free to revert my commits |
Wouldn't use the current shape of the Base UI component now—maybe in the near future once the revamped Menu API is more ironed out & released. In any case, the only problem I see with your changes is what I said in the comment above: the Menu List is an
I tried doing |
TS aspect is fixed :) |
@alexfauquette love it, thank you! Let me know if this is 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.
Both looks good 👍
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.
This scales so much better for 4-6 X component 🥳
At some point we might have to introduce an "Other components" if we end up with Scheduler, Window splitter, File uploader, Rich Text Editor etc... but with this architecture I think we are good to go for the coming 18-24 months on X <3
Co-authored-by: alexandre <alex.fauquette@gmail.com>
Fix: #41183
Preview: https://deploy-preview-42603--material-ui.netlify.app/material-ui/getting-started/
Run-down of what this PR does: