-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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: Add label and tooltip for the color schemes control #21040
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21040 +/- ##
=======================================
Coverage 66.30% 66.30%
=======================================
Files 1772 1773 +1
Lines 67609 67629 +20
Branches 7204 7206 +2
=======================================
+ Hits 44829 44843 +14
- Misses 20938 20943 +5
- Partials 1842 1843 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
/testenv up |
@stephenLYZ Ephemeral environment spinning up at http://35.91.151.185:8080. Credentials are |
@kasiazjc it looks like the names AND the palette colors are being truncated. Should that happen to both, or should one of them "win"? |
/testenv up |
The proposed design truncates both. I believe it makes sense since you can have a very large amount of colors or a very lenghty name for the palette. |
@geido Ephemeral environment spinning up at http://52.33.179.163:8080. Credentials are |
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.
Code looks good and it works! Left two comments that are not blocking. The double truncation does strike me as kind of strange: the row of swatches starts at a different place for each item so the menu looks a little chaotic, and as a user I think my first impression of seeing two ellipses in one menu item would be that there's a layout bug. I can't think of a perfect alternative, but what about if we made it so we had a max of like 10 swatches and they were right-justified without an ellipsis, and then the title is left-justified, truncated with an ellipsis always at the same point? We wouldn't see the max amount of information possible but it would look a lot cleaner and the tooltips would show the full content.
But, also non-blocking if we want to stick with this design.
superset-frontend/src/explore/components/controls/ColorSchemeControl/ColorSchemeLabel.tsx
Show resolved
Hide resolved
superset-frontend/src/explore/components/controls/ColorSchemeControl/index.jsx
Outdated
Show resolved
Hide resolved
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.
LGTM
Thanks for the feedback Cody! I think actually that is a good idea. We still need an indicator that not all of the colors are shown and I'm thinking - maybe let's add a counter? So, as in the categorical color palette, max number of colors is 12, let's use it's a max shown. It will be the fixed with for the color swatches section. Then between text and colors there is 8px fixed spacing and the rest is title. Does it make sense? All of the things would cut off in the same space and it would declutter the whole thing a little bit. What do you think @geido |
…/color-schemes-names
@kasiazjc the two elements cannot be located at the opposite ends as the container can be dragged and expanded. This would create a potential huge space between the label and the colors. In order to keep this flexible we also should not set a maximum number of 12 colors as the dropdown should behave based on the available horizontal space. As for changing from ellipsis to a number of hidden colors, that would require a bigger refactor and if we think it is critical we should discuss that option and I can open another PR. In the meantime, I made some enhancements so that the options do not look disordered and all consume the same space now, which should satisfy what @codyml was asking above. Also, These latest changes truncates both the labels and colors less often, which should improve the feelings about double truncation. |
Oh, I understand. I actually think it looks good! I am totally fine with merging this version. Thank you Diego for working on it 🙏 |
…/color-schemes-names
/testenv up |
@geido Ephemeral environment spinning up at http://34.220.222.129:8080. Credentials are |
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
This PR adds the label name in the color schemes control to make it easier for the users to find their color schemes.
It also adds a tooltip when the color scheme label or the color list gets truncated.
BEFORE
AFTER
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION