-
Notifications
You must be signed in to change notification settings - Fork 96
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
feat(applauncher): add support for sections/icons/divider #1916
Conversation
Deploy preview for pf-next ready! Built with commit 9bf6fdd |
👍 This looks great! I really like how you combined the icon with the screen reader text, since they are synonymous. Looking at this html example below, this seems like a pattern that should be reusable in other places. A similar case came up with my product team today where they want to include a link to the product documentation in a dropdown menu in the masthead. Would it be possible to make this chunk of the menu item a reusable component? Or is that just something we should capture as part of #1429?
One change that I recommend is to not set opacity on |
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.
See my comment above. The opacity should not be applied to the screen-reader-only text.
@jgiardino thanks, updated so that we don't have a wrapper for the external link icon, it seems unnecessary. Also updated the documentation. Should |
What would be the benefit of it being a component? I'm also curious how we would position it as a component - what might it be named? I also changed the structure with an update (removed the wrapper and now just have the icon + screen-reader text) and, assuming that works, curious if that impacts this potentially becoming a component? |
<li> | ||
{{#> app-launcher-menu-item}} | ||
{{#> app-launcher-menu-item-icon}} | ||
<img src="https://kubernetes.io/images/favicon.png" alt=""> |
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.
Should aria-hidden="true" be applied to the icon on the left of the list item, too?
Since you are using <img>
elements for these icons, AND since these images are redundant (i.e. the text that follows is considered synonymous with these icons), then having alt=""
like you have it here is the correct way to tell assistive technology that this image provides no extra meaning and to ignore it.
I think this just gets back to the need to have menu items and toggles as separate components so that we can build these things just once (e.g. this would be a variation of the MenuItem component). Should I just add this as something to #1429 for now? This is definitely something that could be useful in the Dropdown menu, only because this exact use case came up in a product planning meeting yesterday. :-)
I think this works. I think if it's just a variation of a future menu item component, this would be fine. |
@jgiardino that sounds good to me, thanks! |
I have a question for design (@mcarrano, @kybaker)... Is the use case for this component that it will always have links? A question came up off thread about whether the app launcher should always be wrapped in a Also, in other components where we use the If the app launcher is wrapped in a navigation region, what would that label be? Would "Application" match our use case for this component? @mcoker If we do decide that all app launchers should use |
@jgiardino I'm fine with making that update in this PR if you would be OK with verifying that changeset. |
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.
Looks fantastic, really top-notch. Just caught the three css vars.
Yes, this matches my expectations @jgiardino . Regarding the naming, I think "Application" could be ambiguous. Maybe "Application lancher" or just "launcher?" |
I was also wondering the same thing, and thinking that "Application launcher" might be better. "Launcher" alone seems ambiguous to me, too. And something to keep in mind is that this label gets combined with "navigation", so for the user it would get announced as "Application launcher navigation". |
Co-Authored-By: Matt Nolting <[email protected]>
Co-Authored-By: Matt Nolting <[email protected]>
Co-Authored-By: Matt Nolting <[email protected]>
@jgiardino updated the examples and documentation. |
@mattnolting thanks, copied and pasted that code from the dropdown component, so committed your suggestions and updated the dropdown component if you want to take another look. |
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.
Perfect 👍
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 PR is included in version 2.13.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
fixes #1914
@kybaker I just put images and SVGs of various shapes I found online in the example to show how they will look. There is a 24x24 area to the left of the app launcher link text where the icon will go and the log edge of the icon will stretch to fill the 24px length, and the shorter edge will scale down. And if the logo is less than 24x24, it will just be smaller. All the images will be vertically and horizontally centered.
@jgiardino I changed the title
<h2>
s to<h1>
s, inline with what we're doing in the dropdown component, since you can establish a new heading hierarchy in<section>
elements. And added the scree-reader text.