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

feat: vertical oriented button group #755

Merged
merged 5 commits into from
Nov 13, 2024

Conversation

ruanyl
Copy link
Member

@ruanyl ruanyl commented May 10, 2023

Description

This commit added a new prop(orientation) to the current OuiButtonGroup, the possible values are horizontal and vertical. The default value is horizontal which match the current UI behavior. With vertical prop, the button group will be oriented vertically.

Example:

image
image

Issues Resolved

#659

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • All tests pass
    • yarn lint
    • yarn test-unit
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Member

@ashwin-pc ashwin-pc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruanyl Nice! just a few questions

@@ -123,20 +123,43 @@
.ouiButtonGroup--small {
.ouiButtonGroupButton {
border: $ouiBorderThin;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why dont we want border thin for vertical?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both vertical and horizontal has $ouiBorderThin which set on line 125.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops yeah my bad

@@ -123,20 +123,43 @@
.ouiButtonGroup--small {
.ouiButtonGroupButton {
border: $ouiBorderThin;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
&:not(:first-child) {
margin-left: -1px;
}
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is set on line 133 under &:not(.ouiButtonGroup--vertical)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should not review PR's when im sleepy. yes you are right. I did not notice that the margin properties changed are different even though the values are the same.

@KrooshalUX
Copy link
Contributor

@ruanyl great question re: compressed. I'm not entirely familiar with the implementation details so apologies if this is a bit naïve - Is there an approach where we can expand compressed beyond just a boolean? So if orientation = vertical and compressed = true then fixed width and if orientation = horizontal and compressed = true then fixed height ?

I'm wondering if the way this was structured is why some of the other components have orientation split into different components all together.

@ruanyl
Copy link
Member Author

ruanyl commented May 11, 2023

@KrooshalUX

So if orientation = vertical and compressed = true then fixed width and if orientation = horizontal and compressed = true then fixed height

Technically it is doable, but if orientation = vertical with fixed width could potentially problematic as the button text might overflow.

I'm wondering if the way this was structured is why some of the other components have orientation split into different components all together.

Do you have an example of this?

@BSFishy
Copy link
Contributor

BSFishy commented May 11, 2023

Do you have an example of this?

https://oui.opensearch.org/1.1/#/navigation/steps

@@ -166,13 +171,24 @@ export const OuiButtonGroup: FunctionComponent<Props> = ({
);
}

// Compressed style can't support `vertical` orientation because compressed button group has a fixed height
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get why this would be a blocker. A variation of height: auto with a fixed-width would be enough to bypass this. no?

Copy link
Member Author

@ruanyl ruanyl Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KrooshalUX what's your opinion of a vertical compressed button group should look like?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KrooshalUX It would be nice to have UX suggestion on a vertical + compressed button

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs on compressed: https://oui.opensearch.org/1.2/#/forms/compressed-forms

I think the idea is to have any sort of spacing smaller than uncompressed

@joshuarrrr
Copy link
Member

@ruanyl @KrooshalUX Is this a requirement for any 2.10 features?

@ruanyl
Copy link
Member Author

ruanyl commented Aug 28, 2023

@joshuarrrr No, this is just an improvement

@KrooshalUX
Copy link
Contributor

@joshuarrrr nope, just something we want eventually.

@ruanyl can you outline where we are blocked ?

@ruanyl
Copy link
Member Author

ruanyl commented Aug 29, 2023

@KrooshalUX This is not a blocker.

@KrooshalUX
Copy link
Contributor

@ruanyl oh, no , to clarify - understood its not a blocker for 2.10, but where are we blocked on finishing the issue? I am not sure if there is any outstanding decisions / need from UX ?

@joshuarrrr
Copy link
Member

I'm going to mark this as a draft for now, but @ruanyl feel free to take it out of draft status when you're able to make the updates.

This commit added a new prop(orientation) to the current OuiButtonGroup,
the possible values are `horizontal` and `vertical`. The default value
is `horizontal` which match the current UI behavior. With `vertical`
prop, the button group will be oriented vertically.

related issue: opensearch-project#659

Signed-off-by: Yulong Ruan <[email protected]>
@ruanyl ruanyl marked this pull request as ready for review October 30, 2024 07:36
@ruanyl
Copy link
Member Author

ruanyl commented Oct 30, 2024

@virajsanghvi @AMoo-Miki @ashwin-pc Finally get the PR updated, could you take another look please?

@virajsanghvi
Copy link
Collaborator

Can you add a changelog entry?

Curious, where would this be used in OSD? Is this part of any designs?

@ruanyl
Copy link
Member Author

ruanyl commented Oct 31, 2024

Can you add a changelog entry?

Curious, where would this be used in OSD? Is this part of any designs?

Sure, I will update the changelog.

This change was originally introduced for maps plugin, it currently uses two buttons vertically aligned, but would be better to use a button group.

image

@ruanyl
Copy link
Member Author

ruanyl commented Nov 4, 2024

@virajsanghvi PR updated, could you take another look please?

@virajsanghvi virajsanghvi merged commit 3c191a5 into opensearch-project:main Nov 13, 2024
16 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 13, 2024
* feat: vertical oriented button group

This commit added a new prop(orientation) to the current OuiButtonGroup,
the possible values are `horizontal` and `vertical`. The default value
is `horizontal` which match the current UI behavior. With `vertical`
prop, the button group will be oriented vertically.

related issue: #659

Signed-off-by: Yulong Ruan <[email protected]>

* doc(changelog): add changelog for vertical button group

Signed-off-by: Yulong Ruan <[email protected]>

* fix(lint): fix sass lint

Signed-off-by: Yulong Ruan <[email protected]>

---------

Signed-off-by: Yulong Ruan <[email protected]>
(cherry picked from commit 3c191a5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants