-
Notifications
You must be signed in to change notification settings - Fork 279
feat(ui5-ai-button): implement split button functionality #10242
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
hinzzx
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.
We could also add a playground sample and a test maybe.
For example we can test that it changes successfully to split-button mode, when clicking Generate
Stoev
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.
Hi, made some suggestions. Was not sure whether some of the instructions are intended for the developer, or for the end user. For example in lines 35 to 37 my assumption is that instruction is intended for developer, although some parts can be interpreted as intended for end user.
Stoev
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.
Please consider editing the capitalization for button names, as suggested in the comments.
| * Each state have a name that identifies it and can have text, icon and end icon defined (in any combination) depending on the state purpose. | ||
| * For the `ui5-ai-button` user interface, you can define one or more button states by placing `ui5-ai-button-state` components in their default slot. | ||
| * Each state has a name for identification and can include text, an icon, and an end icon, as needed for its purpose. | ||
| * You can define a split mode for the `ui5-ai-button`, which will results in displaying an arrow button for additional actions. |
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.
Please change:
You can define a split mode for the ui5-ai-button, which will results in displaying an arrow button for additional actions.
To:
You can define a split mode for the ui5-ai-button, which will result in displaying an arrow button for additional actions.
| * It enables users to trigger actions by clicking or tapping the `ui5-ai-button`, or by pressing | ||
| * certain keyboard keys, such as Enter. | ||
| * The `ui5-ai-button` component serves as a button for AI-related scenarios. Users can trigger actions by clicking or tapping the `ui5-ai-button` | ||
| * or by pressing keyboard keys like [Enter] or [Space]. |
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.
Please consider changing:
Users can trigger actions by clicking or tapping the ui5-ai-button
To:
Users can trigger actions by choosing the ui5-ai-button
| * The `ui5-ai-button` can be activated by clicking or tapping it. You can change the button state in the click event handler. When the button is | ||
| * in split mode, you can activate the default button action by clicking or tapping it, or by pressing keyboard keys like [Enter] or [Space]. | ||
| * You can activate the arrow button by clicking or tapping it, or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4]. | ||
| * To display additional actions, you can attach a menu to the arrow 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.
Please consider changing for accessibility purpose:
The ui5-ai-button can be activated by choosing it. You can change the button state in the click event handler. When the button is in split mode, you can activate the default button action by choosing it or by pressing keyboard keys like [Enter] or [Space]. You can activate the arrow button by choosing it or by pressing keyboard keys like [Arrow Up], [Arrow Down], or [F4]. To display additional actions, you can attach a menu to the arrow button.
| * Fired when the component is in split mode and after the arrow button | ||
| * is activated either by clicking or tapping it or by using the [Arrow Up] / [Arrow Down], | ||
| * [Alt] + [Arrow Up]/ [Arrow Down], or [F4] keyboard keys. | ||
| * @public |
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.
Please consider changing:
аctivated either by clicking or tapping it
to:
аctivated by choosing it
vladitasev
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.
Important: This is just a review of the public APIs
I see 2 issues:
- The names of the new APIs are inconsistent
ai-button: activeArrowButton + arrow-click event
ai-button-state: splitMode
There is no way for the user to understand that these 3 are related and affect the same UI element (the arrow to the right)
Here are a couple of possibilities:
ai-button: arrowButtonActive + arrow-button-click event
ai-button-state: showArrowButton
or
ai-button: arrowActive + arrow-click event
ai-button-state: showArrow
- I believe "active" is not the correct term for the pressed state of the arrow. Active means that the user can interact with it. Probably should be "pressed" - this is how it is in
ui5-toggle-button
Therefore, my final suggestion would be:
ai-button: arrowButtonPressed + arrow-button-click event
ai-button-state: showArrowButton
This way it should be easier for app developers to connect the dots - they can set showArrowButton on the states, then they can set arrowButtonPressed on the ai button itself, and when the user clicks it the event that is fired is arrowButtonClick
| @property({ type: Boolean }) | ||
| fadeOut = false; | ||
| @property({ type: Boolean, noAttribute: true }) | ||
| activeArrowButton = false; |
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.
Must be arrowButtonActive (boolean property names end with an adjective)
| * @public | ||
| */ | ||
| @property({ type: Boolean }) | ||
| splitMode = false; |
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 believe this should be called showArrowButton because splitMode means nothing for people who haven't seen the specs/figmas and is more like designer slang IMO
|
[heart] Stoev, Dimitar reacted to your message:
________________________________
From: Vladislav Tasev ***@***.***>
Sent: Friday, December 20, 2024 8:31:44 AM
To: SAP/ui5-webcomponents ***@***.***>
Cc: Stoev, Dimitar ***@***.***>; Comment ***@***.***>
Subject: Re: [SAP/ui5-webcomponents] feat(ui5-ai-button): implement split button functionality (PR #10242)
@vladitasev commented on this pull request.
Important: This is just a review of the public APIs
I see 2 issues:
* The names of the new APIs are inconsistent
ai-button: activeArrowButton + arrow-click event
ai-button-state: splitMode
There is no way for the user to understand that these 3 are related and affect the same UI element (the arrow to the right)
Here are a couple of possibilities:
ai-button: arrowButtonActive + arrow-button-click event
ai-button-state: showArrowButton
or
ai-button: arrowActive + arrow-click event
ai-button-state: showArrow
1. I believe "active" is not the correct term for the pressed state of the arrow. Active means that the user can interact with it. Probably should be "pressed" - this is how it is in ui5-toggle-button
Therefore, my final suggestion would be:
ai-button: arrowButtonPressed + arrow-button-click event
ai-button-state: showArrowButton
This way it should be easier for app developers to connect the dots - they can set showArrowButton on the states, then they can set arrowButtonPressed on the ai button itself, and when the user clicks it the event that is fired is arrowButtonClick
________________________________
In packages/ai/src/Button.ts<#10242 (comment)>:
*/
- @Property({ type: Boolean })
- fadeOut = false;
+ @Property({ type: Boolean, noAttribute: true })
+ activeArrowButton = false;
Must be arrowButtonActive (boolean property names end with an adjective)
________________________________
In packages/ai/src/ButtonState.ts<#10242 (comment)>:
@@ -67,6 +67,15 @@ class ButtonState extends UI5Element {
*/
@Property()
endIcon?: string;
+
+ /**
+ * Defines if the component is in split button mode.
+ * @default false
+ * @SInCE 2.6.0
+ * @public
+ */
+ @Property({ type: Boolean })
+ splitMode = false;
I believe this should be called showArrowButton because splitMode means nothing for people who haven't seen the specs/figmas and is more like designer slang IMO
—
Reply to this email directly, view it on GitHub<#10242 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADMB2UABOFVC4GAL7V2WIO32GPIXBAVCNFSM6AAAAABSJRZP5WVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMJWHE4DENBXHA>.
You are receiving this because you commented.Message ID: ***@***.***>
|
|
🎉 This PR is included in version v2.6.0-rc.3 🎉 The release is available on v2.6.0-rc.3 Your semantic-release bot 📦🚀 |
There is a request for redesign/refactoring of AI Button
ui5-ai-buttonin order to useui5-split-buttoninstead ofui5-buttonwhich will allow app developers to define default action on pressing of AI button and opening an additional menu in some cases.There is new property
splitModeintroduced inui5-button-statecomponent that activates split button mode for specific state.