-
Notifications
You must be signed in to change notification settings - Fork 364
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
change: [M3-7994] - Clean up Top Menu and Fix Inconsistencies #10383
change: [M3-7994] - Clean up Top Menu and Fix Inconsistencies #10383
Conversation
> | ||
<ClickAwayListener onClickAway={handleClose}> | ||
<MenuList |
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.
As far as I can tell, this Menu stuff isn't even doing anything meaningful. For it to work properly, the direct children probably need to be Menu Items.
@@ -64,7 +64,7 @@ export const TopMenu = React.memo((props: TopMenuProps) => { | |||
variant="dense" | |||
> | |||
<Hidden mdDown> | |||
<TopMenuIcon key={navHoverText} title={navHoverText}> | |||
<TopMenuTooltip title={navHoverText}> |
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.
I don't think key
is needed here. Please correct me if I'm wrong
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.
I just renamed TopMenuIcon.tsx
to TopMenuTooltip.tsx
because TopMenuIcon didn't make sense
)} | ||
</IconButton> | ||
</TopMenuTooltip> | ||
<Popover |
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.
Now using a Popover
instead of a Popper
to match the behavior of the AddNewMenu
and the UserMenu
. This fixes a lot of styling and adds a nice animation to match the other menus.
Before | This PR |
---|---|
Screen.Recording.2024-04-17.at.11.19.39.AM.mov |
Screen.Recording.2024-04-17.at.11.21.53.AM.mov |
Notice how the Popper background does not stay when scroll bounces and how there is no open/close animation | Notice how the background of the Popover is constant when scroll bounces and there is a nice open/close animation |
padding: 0, | ||
}} | ||
<TopMenuTooltip title="Notifications"> | ||
<IconButton |
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.
An IconButton
is much more fitting than a Button
</StyledLinkButton> | ||
</TopMenuIcon> | ||
<TopMenuTooltip title="Help & Support"> | ||
<Link to="/support"> |
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.
Using an actual Link
instead of using JS to go to /support
. This is probably good for accessibility and probably just better practice?
role="link" | ||
> | ||
<StyledTopMenuIconWrapper> | ||
<HelpSVGIcon status="help" /> |
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.
I don't think status="help"
does anything meaningful. Let me know if I'm mistaken
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 status="help"
prop and the other one you removed from the Community
component status="community"
appear to be remaining bits from previous implementations of the tooltip icons. I agree that these don't belong in the codebase any longer. Good catch.
Coverage Report: ❌ |
packages/manager/src/features/TopMenu/NotificationMenu/NotificationMenu.tsx
Outdated
Show resolved
Hide resolved
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 addressing the fixes. looks good and consistent. This is a nice cleanup!
- Semantic HTML & accessibility ✅
- Behavior & no regressions ✅
I noticed that we don't have a rel="noopener noreferrer"
for the cloud community link but I don't think we even need those anymore as it seems to have been set as the default behavior in most browsers. Not to mentioned, the risk of browser hijacking by our own web properties seems fairly low 😄
Fixes a few console errors caused by change: [M3-7994] - Clean up Top Menu and Fix Inconsistencies #10383 Sorry!! 🤦 Allows our Link component to accept a ref (had to do this to fix Tooltip ref error) Co-authored-by: Banks Nussman <banks@nussman.us>
Description 📝
Cleans up and fixes many inconsistencies with the Top Menu 🧹
Fixes
1. Fixes bug where opening the Notification/Event Menu would scroll to top in Safari browsers 🔧
Screen.Recording.2024-04-16.at.1.18.03.PM.mov
Screen.Recording.2024-04-16.at.1.18.21.PM.mov
2. Fixes inconsistent ripple effects
Screen.Recording.2024-04-16.at.1.11.08.PM.mov
Screen.Recording.2024-04-16.at.1.13.24.PM.mov
3. Makes Notification/Event Menu work and look like the
UserMenu
and theAddNewMenu
🎨Screen.Recording.2024-04-16.at.1.15.16.PM.mov
Screen.Recording.2024-04-16.at.1.15.26.PM.mov
Other Changes 🔁
Link
, so it should be more accessibleLink
, so it should be more accessibleHow to test 🧪
As an Author I have considered 🤔