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

refactor(ui5-ai-button): change api names #10572

Merged
merged 1 commit into from
Jan 22, 2025
Merged

Conversation

tsanislavgatev
Copy link
Contributor

@tsanislavgatev tsanislavgatev commented Jan 15, 2025

We're improving API naming. We have 3 changes in the API.
CHANGE: In the ButtonState we change the splitMode property to showArrowButton.
BEFORE:

<ui5-ai-button-state name="revise" text="Revise" icon="ai" split-mode></ui5-ai-button-state>

NOW:

<ui5-ai-button-state name="revise" text="Revise" icon="ai" show-arrow-button></ui5-ai-button-state>

CHANGE: In the Button, we change the activeArrowButton to arrowButtonPressed following the convention in the framework.

function menuOpenHandler() {
	var button = menu.opener;

	button.activeArrowButton = true;
}

NOW:

function menuOpenHandler() {
	var button = menu.opener;

	button.arrowButtonPressed = true;
}

CHANGE: In the Button we also change the arrow-click event name to arrow-button-click, so the event name is easier to understand and we ensure that it might not be mistaken with the arrow icon when the arrow button is not shown.

myAiButtonSplit.addEventListener("arrow-click", aiButtonSplitArrowClickHandler);

NOW:

myAiButtonSplit.addEventListener("arrow-button-click", aiButtonSplitArrowClickHandler);

@tsanislavgatev tsanislavgatev marked this pull request as draft January 16, 2025 07:10
@tsanislavgatev tsanislavgatev marked this pull request as ready for review January 16, 2025 09:54
@ilhan007
Copy link
Member

Let's describe the changes in this manner, but without the breaking change word, maybe just "CHANGE:"
Screenshot 2025-01-16 at 18 48 26

We may decide to describe them and we can just copy/paste the PR description.

@vladitasev
Copy link
Contributor

There was another point of discussion we agreed upon - to follow up with Niki about arrowButtonActive vs arrowButtonPressed - we said, if it's only pressed and nothing else, then "pressed" is the better term, if it has more functionality other than the pressed state, "active" is ok.

@tsanislavgatev
Copy link
Contributor Author

There was another point of discussion we agreed upon - to follow up with Niki about arrowButtonActive vs arrowButtonPressed - we said, if it's only pressed and nothing else, then "pressed" is the better term, if it has more functionality other than the pressed state, "active" is ok.

It was discussed and it was changed to pressed, but it is wrong in the commit message, as the commit message was written later based on notes from the meeting... Anyways it was agreed to be arrowButtonPressed as it was implemented.

@vladitasev
Copy link
Contributor

Please fix the commit description too (arrowButtonActive is still there in one place)

@tsanislavgatev tsanislavgatev merged commit 7c45756 into main Jan 22, 2025
10 checks passed
@tsanislavgatev tsanislavgatev deleted the ai-button-api-change branch January 22, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants