Skip to content
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

Merged

Conversation

bnussman-akamai
Copy link
Member

@bnussman-akamai bnussman-akamai commented Apr 16, 2024

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 🔧

Before After
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

Before After
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 the AddNewMenu 🎨

Before After
Screen.Recording.2024-04-16.at.1.15.16.PM.mov
Screen.Recording.2024-04-16.at.1.15.26.PM.mov

Other Changes 🔁

  • Makes "Help and Support" and actual Link, so it should be more accessible
  • Makes "Community" an actual Link, so it should be more accessible

How to test 🧪

  • Test the Top Menu
  • Verify accessibility does not get worse

As an Author I have considered 🤔

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@bnussman-akamai bnussman-akamai self-assigned this Apr 16, 2024
@bnussman-akamai bnussman-akamai added Enhancement UX/UI Changes for UI/UX to review labels Apr 16, 2024
@bnussman-akamai bnussman-akamai marked this pull request as ready for review April 17, 2024 15:14
@bnussman-akamai bnussman-akamai requested a review from a team as a code owner April 17, 2024 15:14
@bnussman-akamai bnussman-akamai requested review from hana-akamai and abailly-akamai and removed request for a team April 17, 2024 15:14
>
<ClickAwayListener onClickAway={handleClose}>
<MenuList
Copy link
Member Author

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}>
Copy link
Member Author

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

Copy link
Member Author

@bnussman-akamai bnussman-akamai Apr 17, 2024

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
Copy link
Member Author

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
Copy link
Member Author

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">
Copy link
Member Author

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" />
Copy link
Member Author

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

Copy link
Contributor

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.

@bnussman-akamai bnussman-akamai requested a review from a team as a code owner April 17, 2024 16:17
@bnussman-akamai bnussman-akamai requested review from cliu-akamai and removed request for a team April 17, 2024 16:17
Copy link

github-actions bot commented Apr 17, 2024

Coverage Report:
Base Coverage: 81.85%
Current Coverage: 81.77%

@carrillo-erik
Copy link
Contributor

I ran the lighthouse tool against your PR and the develop branch. Although the tool is not perfect it does help point out some useful information. In this case Accessibility dropped from 92 to 87. It appears to be complaining about the IconButton not having any text for screen readers.

Develop

dev-branch

This PR

pr-branch

The good news is that the workaround seems straightforward based on the recommendations. I tried aria-label="Help", I suppose the same can be done with accessibleAriaLabel. The Accessibility score remained the same, however, the message went away.
Screenshot 2024-04-17 at 1 52 24 PM

Copy link
Contributor

@abailly-akamai abailly-akamai left a 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 😄

@bnussman-akamai bnussman-akamai merged commit 8b2ec94 into linode:develop Apr 19, 2024
18 checks passed
bnussman-akamai added a commit that referenced this pull request Apr 23, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement UX/UI Changes for UI/UX to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants