-
Notifications
You must be signed in to change notification settings - Fork 776
[API Spec] SplitMenuFlyoutItem control #10862
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
base: main
Are you sure you want to change the base?
[API Spec] SplitMenuFlyoutItem control #10862
Conversation
|
AppBarSplitButton would be nice too 👀 |
|
I've added this to the public api review process board: https://aka.ms/winappsdk/api-specs-review This PR will be open for feedback for a month from its opening: October 30th – November 30th FYI @dipeshmsft |
|
Please consider referencing all resources in XAML with For example, |
|
I have UX concerns about the current proposal/implementation where the context menu item reads "Compress to ZIP" but opens a sub-menu with alternative formats (7z, tar.gz, etc.). The chevron ( Example: Imagine a context menu item labeled "Email to John >" that opens a sub-menu with "Slack John", "Call John", "Text John". While all communicate with John, the parent item explicitly promised email. Are there existing Windows patterns or any other examples to support this "specific action > alternative actions" model that I'm not aware of? |
| including the `SplitMenuFlyoutItem`. | ||
| - When focus is coming from a menu item above the current menu item i.e. focus is coming as a result of Down Arrow Key, | ||
| the focus will move to primary button. Similarly, when the focus is coming from below, | ||
| i.e. focus is coming to this control as a result of Up Arrow Key, focus first moves to secondary button. |
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.
That's confusing. I think if a user is keyboarding through a context menu with items that can open sub-menus, they would expect up/down to select only primary items. If they are interested in other options, they will explore those by moving to the item and pressing right-arrow.
(LTR layout assumed)
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.
We chose the above behavior to accommodate users who would be using a screen reader. If we use Up/Down arrow keys to navigate to primary button and then to next item, it hampers the discoverability of the secondary button.
This same pattern is followed in Teams desktop application.
Here is a sample of the Split Menu Item that already exists in Fluent UI React 9: https://storybooks.fluentui.dev/react/?path=/docs/components-menu-menu--docs#split-menu-item
|
|
||
| ### Primary Button Interaction | ||
| *When focus is on primary button* | ||
| - **Right\Down Arrow Key**: Moves the focus to secondary button. |
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.
Also confusing. I'd expect right-arrow to open the sub-menu.
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.
Referring to the comment above. Following the Fluent UI behavior for this control.
Although in case of previous variations of this control, like Microsoft PowerPoint, we have the behavior that you have mentioned.
|
If this control is already in experimental3, which is already in the pipeline for release, what impact will this PR really have? |
"Compress to ZIP" scenario may not be the best scenario for SplitMenuFlyoutItem and maybe more suited for MenuFlyoutSubItem. I would like to draw your attention to the Paste example, where there are different ways of performing the paste - "Paste as Text", "Paste with Merge Formatting", "Paste with Source Formatting", etc. This is one of the true examples of what we are trying to achieve using this control. If there are multiple ways of performing one operation and the app developer wants to set one as the default mode operation, those scenarios are the ones that we are trying to support using this control. In the example of having a menu item "Email to John" and then inside that command having sub-menu items like "Slack to John", "Call John", this is geared towards the default mode of action for a user. Say it is by mail, so we show that in the primary part, and other parts of making contact are secondary, so they are put in the sub menu item. However, I think the control is general enough to support both the cases : having alternate actions grouped together, and handling different variations of the same action. In the light of the confusion this is creating I will go ahead and modify the usage examples in the API spec. |
@riverar, we have done 2 passes on internal review for this control, however since this is still in experimental, we are open to suggestions. |
|
|
||
| Here is one example of a customized submenu (this is a reference from the SplitButton control). | ||
|
|
||
|  |
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.
nit: Images can be mid-aligned.
Jay-o-Way
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.
I just wanna say that this document does not follow MS Learn style/formatting guidelines.
- https://learn.microsoft.com/contribute/content/text-formatting-guidelines
- https://learn.microsoft.com/contribute/content/markdown-reference
Some examples: (not limited to)
- UI elements, like menu items, dialog names, and names of text boxes, should be in bold text.
- Keys and keyboard shortcuts: use "select" and <kbd> tags
- Empty lines between headers, lists, code blocks etc.
- Each Markdown file must have one and only one H1 heading.
- Spelling, please
- Don't use bold as an alternative for a header
This document follows the API Spec template provided in the repo: https://github.com/microsoft/WindowsAppSDK/blob/main/specs/spec_template.md I will take a look at rest of the formatting issues and update the spec accordingly. |
😂 Hasn't been touched in at least 5 years though... |
|
@dipeshmsft Does it support KeyboardAccelerators? I don't see it mentioned here and no screenshot, too |
This is an API Spec PR for the proposed SplitMenuFlyoutItem control.
PR Type
Please check the type of change your PR introduces:
Description
The SplitMenuFlyoutItem control is proposed to be a new addition to the WinUI library, designed to provide a split button experience within a menu flyout. This control derives from MenuFlyoutItem and introduces a dual-button interface consisting of a primary button and a flyout button.
Motivation and Context
This functionality will allow developers to expose a default primary action while also offering additional options through an attached dropdown — ideal for condensing complex functionality into a smaller footprint and saving overall menu length.
How Has This Been Tested?
Screenshots (if appropriate):
Attached in the document.