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(UI): Improve split button styling #10027

Merged

Conversation

maks-w
Copy link

@maks-w maks-w commented Sep 10, 2024

Change-Id: I4f0474e02411ada5547c8c2f23dda22cb4433557

Summary

This is my proposal for UI splitting the buttons in 2 parts.
I hope I didn't take too much liberty with the design ^^

Checklist

  • I have run make prettier-write and formatted the code.
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

@maks-w maks-w force-pushed the maks-w/improve-split-button-styling branch 13 times, most recently from bfb47c3 to 11a8e52 Compare September 12, 2024 11:30
.jsdialog.unotoolbutton.selected:hover {
background-color: var(--color-background-darker) !important;
Copy link
Author

Choose a reason for hiding this comment

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

We move the responsability of the background-color to the children since a button could have 2 parts

}

.unoarrow::after,
.jsdialog .ui-content.unobutton::after {
Copy link
Author

Choose a reason for hiding this comment

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

I extended a little bit the click zone so that the border of the button could be clickable

@@ -37,6 +37,7 @@ describe(['tagdesktop', 'tagnextcloud', 'tagproxy'], 'Delete Objects', function(
});

it('Delete Chart' , function() {
cy.cGet('#toolbar-up > .ui-scroll-right').click();
cy.cGet('#toolbar-up > .ui-scroll-right').click();
Copy link
Author

Choose a reason for hiding this comment

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

The menu is a bit wider now, so we need to click twice for the icon to appear.

@maks-w maks-w marked this pull request as ready for review September 12, 2024 12:37
@eszkadev
Copy link
Contributor

I see no problem with the JS code thanks! @pedropintosilva will you find a minute to review the new look of split button?

Copy link
Contributor

@pedropintosilva pedropintosilva left a comment

Choose a reason for hiding this comment

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

thanks @maks-w ! It looks much better, well done 👏

Before we can merge this it would be good to understand why we are forgoing the --btn-size CSS var. That was a nice way to not only make sure all icon buttons share the same size but also to allow adjusting them in one single place. With the current changes we are never sure about the resulting size.

Also the pseudo elements in other buttons are being affected (not only arrows). Example the save icon in the tabbed bar (when it receives the .savemodified class. Meaning when the user types and there are changes ready to be saved)

@@ -2760,8 +2760,8 @@ L.Control.JSDialogBuilder = L.Control.extend({

if (typeof menubutton === 'object') {
L.DomUtil.addClass(menubutton.container, data.class ? data.class + ' has-colorpicker': 'has-colorpicker');

var valueNode = L.DomUtil.create('div', 'selected-color', menubutton.container);

Copy link
Contributor

Choose a reason for hiding this comment

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

can we remove this white space?

Copy link
Author

Choose a reason for hiding this comment

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

done

@maks-w maks-w force-pushed the maks-w/improve-split-button-styling branch 2 times, most recently from a94014d to bbc6136 Compare October 14, 2024 07:48
@maks-w
Copy link
Author

maks-w commented Oct 14, 2024

thanks @maks-w ! It looks much better, well done 👏

Before we can merge this it would be good to understand why we are forgoing the --btn-size CSS var. That was a nice way to not only make sure all icon buttons share the same size but also to allow adjusting them in one single place. With the current changes we are never sure about the resulting size.

I pushed a new commit to restore this behavior. Some changes however, because of the padding, the button and the image are not the same size now, so there is a button size and an image size variable (the image size is computed, so there is still only 1 variable to change to change the size of the button).

I took the liberty to reduce a little bit the size of the buttons, who seem a little too big (but perhaps I took it a step too far). Tell me what you think.

Also the pseudo elements in other buttons are being affected (not only arrows). Example the save icon in the tabbed bar (when it receives the .savemodified class. Meaning when the user types and there are changes ready to be saved)

For the pseudo element, it seems to me that it is a good practice to extend a little bit the click zone of buttons in general; not just for the arrow button.
Even today we have the rollover actif before we can click on it, which can cause missclicks.
But maybe I didn't understand correctly the issue?

I just noticed that some icons are blurry with the added padding :(
Let me look into it and check why the cypress tests are not green anymore.

@eszkadev
Copy link
Contributor

please rebase, I think tests are failing due to old base

@maks-w maks-w force-pushed the maks-w/improve-split-button-styling branch 3 times, most recently from 5c0764e to 0e351a6 Compare October 15, 2024 12:33
eszkadev added a commit that referenced this pull request Oct 18, 2024
it was broken after PR:
#10027

I'm afraid I was not as clear as I could have been, sorry
#10027 (review)
What I mean is that it's very important to:
* When fixing/improving the style of a given widget to avoid pushing
additional changes that have a high risk of changing many things and
bring regressions
  * I welcome those changes but in an isolated PR which can better
  tested and worked on :)
* Changing sizes of buttons or let them be dynamically set according to
the DOM is a bit hard and prone to problems

Nevertheless this is an attempt to fix those while retain the nice
work from Maks.

Co-authored-by: Szymon Kłos <[email protected]>
Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I2d6aa5113405aa32e06d45cfbfd1a623647f3121
andreasma pushed a commit to freeonlineoffice/online that referenced this pull request Oct 21, 2024
it was broken after PR:
CollaboraOnline/online#10027

I'm afraid I was not as clear as I could have been, sorry
CollaboraOnline/online#10027 (review)
What I mean is that it's very important to:
* When fixing/improving the style of a given widget to avoid pushing
additional changes that have a high risk of changing many things and
bring regressions
  * I welcome those changes but in an isolated PR which can better
  tested and worked on :)
* Changing sizes of buttons or let them be dynamically set according to
the DOM is a bit hard and prone to problems

Nevertheless this is an attempt to fix those while retain the nice
work from Maks.

Co-authored-by: Szymon Kłos <[email protected]>
Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I2d6aa5113405aa32e06d45cfbfd1a623647f3121
pedropintosilva added a commit that referenced this pull request Oct 22, 2024
Issue that came up with its follow ups

db10c45
#10027

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I6c9401e9f3a37fd604a2598388be64f026efce21
pedropintosilva added a commit that referenced this pull request Oct 22, 2024
Issue that came up with its follow ups

db10c45
#10027

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I6c9401e9f3a37fd604a2598388be64f026efce21
pedropintosilva added a commit that referenced this pull request Oct 23, 2024
Due to db10c45
#10027

we now need to make sure the img element is completely out of the way
via padding otherwise the background-image is not visible

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: Idf909b4cffbedf71b75797a6611fb8067f2a314a
pedropintosilva added a commit that referenced this pull request Oct 23, 2024
Due to db10c45
#10027

we now need to make sure the img element is completely out of the way
via padding otherwise the background-image is not visible

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: Idf909b4cffbedf71b75797a6611fb8067f2a314a
Darshan-upadhyay1110 pushed a commit that referenced this pull request Oct 25, 2024
it was broken after PR:
#10027

I'm afraid I was not as clear as I could have been, sorry
#10027 (review)
What I mean is that it's very important to:
* When fixing/improving the style of a given widget to avoid pushing
additional changes that have a high risk of changing many things and
bring regressions
  * I welcome those changes but in an isolated PR which can better
  tested and worked on :)
* Changing sizes of buttons or let them be dynamically set according to
the DOM is a bit hard and prone to problems

Nevertheless this is an attempt to fix those while retain the nice
work from Maks.

Co-authored-by: Szymon Kłos <[email protected]>
Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I2d6aa5113405aa32e06d45cfbfd1a623647f3121
Darshan-upadhyay1110 pushed a commit that referenced this pull request Oct 25, 2024
Issue that came up with its follow ups

db10c45
#10027

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I6c9401e9f3a37fd604a2598388be64f026efce21
Darshan-upadhyay1110 pushed a commit that referenced this pull request Oct 25, 2024
Due to db10c45
#10027

we now need to make sure the img element is completely out of the way
via padding otherwise the background-image is not visible

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: Idf909b4cffbedf71b75797a6611fb8067f2a314a
Darshan-upadhyay1110 pushed a commit that referenced this pull request Oct 25, 2024
it was broken after PR:
#10027

I'm afraid I was not as clear as I could have been, sorry
#10027 (review)
What I mean is that it's very important to:
* When fixing/improving the style of a given widget to avoid pushing
additional changes that have a high risk of changing many things and
bring regressions
  * I welcome those changes but in an isolated PR which can better
  tested and worked on :)
* Changing sizes of buttons or let them be dynamically set according to
the DOM is a bit hard and prone to problems

Nevertheless this is an attempt to fix those while retain the nice
work from Maks.

Co-authored-by: Szymon Kłos <[email protected]>
Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I2d6aa5113405aa32e06d45cfbfd1a623647f3121
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Darshan-upadhyay1110 pushed a commit that referenced this pull request Oct 25, 2024
Issue that came up with its follow ups

db10c45
#10027

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I6c9401e9f3a37fd604a2598388be64f026efce21
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Darshan-upadhyay1110 pushed a commit that referenced this pull request Oct 25, 2024
Due to db10c45
#10027

we now need to make sure the img element is completely out of the way
via padding otherwise the background-image is not visible

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: Idf909b4cffbedf71b75797a6611fb8067f2a314a
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
andreasma pushed a commit to freeonlineoffice/online that referenced this pull request Oct 26, 2024
Issue that came up with its follow ups

db10c453e95f732d85c489fe8da8708cec0ad09c
CollaboraOnline/online#10027

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I6c9401e9f3a37fd604a2598388be64f026efce21
andreasma pushed a commit to freeonlineoffice/online that referenced this pull request Oct 26, 2024
Due to db10c453e95f732d85c489fe8da8708cec0ad09c
CollaboraOnline/online#10027

we now need to make sure the img element is completely out of the way
via padding otherwise the background-image is not visible

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: Idf909b4cffbedf71b75797a6611fb8067f2a314a
Darshan-upadhyay1110 pushed a commit that referenced this pull request Oct 28, 2024
it was broken after PR:
#10027

I'm afraid I was not as clear as I could have been, sorry
#10027 (review)
What I mean is that it's very important to:
* When fixing/improving the style of a given widget to avoid pushing
additional changes that have a high risk of changing many things and
bring regressions
  * I welcome those changes but in an isolated PR which can better
  tested and worked on :)
* Changing sizes of buttons or let them be dynamically set according to
the DOM is a bit hard and prone to problems

Nevertheless this is an attempt to fix those while retain the nice
work from Maks.

Co-authored-by: Szymon Kłos <[email protected]>
Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I2d6aa5113405aa32e06d45cfbfd1a623647f3121
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Darshan-upadhyay1110 pushed a commit that referenced this pull request Oct 28, 2024
Issue that came up with its follow ups

db10c45
#10027

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I6c9401e9f3a37fd604a2598388be64f026efce21
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Darshan-upadhyay1110 pushed a commit that referenced this pull request Oct 28, 2024
Due to db10c45
#10027

we now need to make sure the img element is completely out of the way
via padding otherwise the background-image is not visible

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: Idf909b4cffbedf71b75797a6611fb8067f2a314a
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Darshan-upadhyay1110 pushed a commit that referenced this pull request Oct 28, 2024
Issue that came up with its follow ups

db10c45
#10027

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I6c9401e9f3a37fd604a2598388be64f026efce21
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Darshan-upadhyay1110 pushed a commit that referenced this pull request Oct 28, 2024
Due to db10c45
#10027

we now need to make sure the img element is completely out of the way
via padding otherwise the background-image is not visible

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: Idf909b4cffbedf71b75797a6611fb8067f2a314a
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
timar pushed a commit that referenced this pull request Oct 28, 2024
it was broken after PR:
#10027

I'm afraid I was not as clear as I could have been, sorry
#10027 (review)
What I mean is that it's very important to:
* When fixing/improving the style of a given widget to avoid pushing
additional changes that have a high risk of changing many things and
bring regressions
  * I welcome those changes but in an isolated PR which can better
  tested and worked on :)
* Changing sizes of buttons or let them be dynamically set according to
the DOM is a bit hard and prone to problems

Nevertheless this is an attempt to fix those while retain the nice
work from Maks.

Co-authored-by: Szymon Kłos <[email protected]>
Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I2d6aa5113405aa32e06d45cfbfd1a623647f3121
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
timar pushed a commit that referenced this pull request Oct 28, 2024
Issue that came up with its follow ups

db10c45
#10027

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I6c9401e9f3a37fd604a2598388be64f026efce21
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
timar pushed a commit that referenced this pull request Oct 28, 2024
Due to db10c45
#10027

we now need to make sure the img element is completely out of the way
via padding otherwise the background-image is not visible

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: Idf909b4cffbedf71b75797a6611fb8067f2a314a
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Minion3665 pushed a commit that referenced this pull request Nov 4, 2024
it was broken after PR:
#10027

I'm afraid I was not as clear as I could have been, sorry
#10027 (review)
What I mean is that it's very important to:
* When fixing/improving the style of a given widget to avoid pushing
additional changes that have a high risk of changing many things and
bring regressions
  * I welcome those changes but in an isolated PR which can better
  tested and worked on :)
* Changing sizes of buttons or let them be dynamically set according to
the DOM is a bit hard and prone to problems

Nevertheless this is an attempt to fix those while retain the nice
work from Maks.

Co-authored-by: Szymon Kłos <[email protected]>
Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I2d6aa5113405aa32e06d45cfbfd1a623647f3121
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Minion3665 pushed a commit that referenced this pull request Nov 4, 2024
Issue that came up with its follow ups

db10c45
#10027

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: I6c9401e9f3a37fd604a2598388be64f026efce21
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Minion3665 pushed a commit that referenced this pull request Nov 4, 2024
Due to db10c45
#10027

we now need to make sure the img element is completely out of the way
via padding otherwise the background-image is not visible

Signed-off-by: Pedro Pinto Silva <[email protected]>
Change-Id: Idf909b4cffbedf71b75797a6611fb8067f2a314a
Signed-off-by: Darshan-upadhyay1110 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Improve split button styling
4 participants