-
Notifications
You must be signed in to change notification settings - Fork 375
feat(menus): custom menus updates #9014
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
Conversation
e062ef6 to
db4b98e
Compare
|
Preview: https://patternfly-react-pr-9014.surge.sh A11y report: https://patternfly-react-pr-9014-a11y.surge.sh |
|
The preview is broken (no left nav). Needs to be rebased? |
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 think the new demos - like the Options Menu demo and App launcher demo - need a sentence at the top to explain that, since the old version is deprecated, the component can still be built using the new Dropdown/Select (as demonstrated in the demo)
1aaf12e to
4382dd0
Compare
thatblindgeye
left a comment
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.
More of a nit, but if we want to move away from using "composable" in example names, we could update the directory from demos/ComposableMenu to demos/CustomMenu.
packages/react-core/src/demos/ComposableMenu/examples/DateSelectDemo.tsx
Outdated
Show resolved
Hide resolved
packages/react-core/src/demos/ComposableMenu/examples/DrilldownMenuDemo.tsx
Outdated
Show resolved
Hide resolved
packages/react-core/src/demos/ComposableMenu/examples/FavoritesDemo.tsx
Outdated
Show resolved
Hide resolved
packages/react-core/src/demos/ComposableMenu/examples/ActionsMenuDemo.tsx
Outdated
Show resolved
Hide resolved
packages/react-core/src/demos/ComposableMenu/examples/DateSelectDemo.tsx
Outdated
Show resolved
Hide resolved
mcarrano
left a comment
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 looks great. I have nothing to add beyond the issues already raised by @thatblindgeye .
e6059d0 to
7796c05
Compare
ce42c5e to
2d1482f
Compare
nicolethoen
left a comment
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.
Can we add Props tables for components used to build these demos to this page? In particular i'm interested in seeing MenuContainer documented, but since there are not too many components used in these demos, a few other props tables may be helpful, too?
|
@nicolethoen Do you also want to add prop tables to the custom menus page? I added them to the specific demos for the deprecated components. |
2820de1 to
63718fb
Compare
|
@kmcfaul i'd vote for the |
packages/react-core/src/demos/CustomMenus/ApplicationLauncher.md
Outdated
Show resolved
Hide resolved
|
@nicolethoen No just the custom menus page uses the new container (and I've included the props table there). |
mcarrano
left a comment
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 looks good to me. Only have one question. I see that we've added React Demo tabs for the Context selector and Application launcher components (as intended), but still also have those demos on the Custom menus page. Did we intend to duplicate these on the Custom menu page? Can't remember our earlier convo about this. What are your thoughts @nicolethoen ?
packages/react-core/src/demos/CustomMenus/ApplicationLauncher.md
Outdated
Show resolved
Hide resolved
packages/react-core/src/demos/CustomMenus/ApplicationLauncher.md
Outdated
Show resolved
Hide resolved
80a4cab to
9df2771
Compare
|
@mcarrano @nicolethoen I believe we landed on having the app launcher/context selector/options menu in both places. The code is only in one location it's just referenced in two places. I can remove them from the custom menus if we want though. |
9df2771 to
7705150
Compare
I'm OK to leave it, but just wanted to raise the question. |
7705150 to
c1135c4
Compare
tlabaj
left a comment
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.
If we are going to have this menu container, shouldn't our Select and dropdown use it?
We can refactor them, but as it's internal maybe this could be a follow up? The benefit of having separate implementations is if we want to differentiate how a Select vs a Dropdown vs a generic Menu behaves by default on the other hand. |
aaec02c to
ab19037
Compare
tlabaj
left a comment
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 good, I just wonder if the Menu container should be Beta. @mcarrano thoughts?
Generally, since we will be doing more frequent major releases, I don't feel the need to mark everything beta - unless it's a completely optional enhancement or experimental. I've been made aware that Extensions cannot use beta components at all, because they cannot introduce breaking changes - and have come to realize that products are generally very hesitant to adopt any beta solutions. If we want people to use this MenuContent as they build out custom Select implementations, because it is our recommended solution, i'd advocate for promoting it. I understand any hesitation though. |
I think this is a discussion we should have as a team. I will add it to the agenda. |
|
We can also add/remove a beta tag later and not hold this PR up. |
ab19037 to
d992f81
Compare
|
Rebased with the select PR merge, and re added a beta tag to the drilldown example that I think I removed in error during a previous rebase (just double checked the promotion PR and its still in beta from that). |
| /** Callback to change the open state of the menu. | ||
| * Triggered by clicking outside of the menu, or by pressing any keys specificed in onOpenChangeKeys. */ | ||
| onOpenChange?: (isOpen: boolean) => void; | ||
| /** @beta Keys that trigger onOpenChange, defaults to tab and escape. It is highly recommended to include Escape in the array, while Tab may be omitted if the menu contains non-menu items that are focusable. */ |
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.
Can we mark this whole component Beta for now and remove this tag on the prop.
d992f81 to
42cf3a4
Compare
|
Your changes have been released in:
Thanks for your contribution! 🎉 |
* feat(menus): custom menus updates * fix merge update * rebase and deprecated blurb * rename directory, remove dupe focusing, update desc * add beta to keys * update prop desc * add prop tables, fix focusing bug * content updates * content updates * move prop, add popper props * update wording * add beta note to prop table
What: Closes #8899
MenuContentwhich isn't accessible by Select/Dropdown currently (for drilldown). The tree view demo doesn't use menu at all. To keep from using Popper directly still, I added aMenuContainercomponent to menu to act as a similar wrapper for Popper like Select/Dropdown. The application launcher demo and context selector demo end up being slightly different in the DOM than previously becauseMenuContentis internal to Select/Dropdown and both had elements (MenuSearch, MenuFooter) that previously were outside of the content. I also had to add anonOpenChangeKeysprop to Dropdown because these two require theTabkey to access different sections of the menu (search and footer) instead of closing the menu. Lmk if it would be better to use MenuContainer again and stick with the menu components.