-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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(explore): Color scheme groups, new color schemes #27995
Conversation
@kgabryje I have some questions about how this behavior will work with some of the requirements/features of the Select component:
Have we considered implementing this outside of the Select component? Like a radio group that changes the values of the Select depending on the option that is selected? If we are thinking specifically about color palettes where new values and select all are disabled, maybe this should be a specific component? If you ask me, given the complexity involved, I would implement this with a combination of radio group + Select. |
Good question. Currently I left it unsorted, but I was thinking about sorting the selected within the groups. The groups remain in their initial positions.
New items do not belong to any group - they will be treated as regular (ungrouped) options
It simply selects all options
The option groups are supported by the native Antd Select, so in my opinion we should also support them in our customised Select. Right now the color scheme picker is our only use case for the groups, but I feel like grouping the options in categories is not such an uncommon thing to do and the need for it might pop up in the future EDIT: formatting |
We can go down that road but keep in mind that complexity will increase given the other requirements we have and that the Ant Design select does not have such as sorting selected items and new items. If we can avoid that, it would be better. That's why I'm trying to see if there's an alternative before starting to analyze how to resolve all the questions I posted above. |
If there's no alternative, and we really need to implement this behavior, then we need to think about how to break the select component because I don't how this behavior will work with:
|
Ugh sorry, I answered those questions in my first response but messed up the formatting 🤦 Pasting it here again:
Good question. Currently I left it unsorted, but I was thinking about sorting the selected within the groups. The groups remain in their initial positions.
New items do not belong to any group - they will be treated as regular (ungrouped) options
It simply selects/deselects all options, like with ungrouped options |
/testenv up |
@kgabryje Ephemeral environment spinning up at http://34.222.156.36:8080. Credentials are |
6ec2feb
to
d110cd2
Compare
@michael-s-molina @geido Following our discussion from last week, I opted for "low effort" solution for now, which is using Antd Select for ColorSchemeControl instead of our custom Select component. We'll revisit this component in the near future and try to figure out if we can provide a better user experience by rewriting this control with different UI |
52a7d72
to
d7a919b
Compare
@kgabryje Did you forget to commit something? I'm still seeing some changes in the Select component such as group options. |
d7a919b
to
89b3bfa
Compare
@michael-s-molina Thanks for spotting, I updated the PR. I left the styling for groups in |
/testenv up |
@kgabryje Ephemeral environment spinning up at http://34.216.167.224:8080. Credentials are |
@@ -55,6 +55,13 @@ export const StyledSelect = styled(AntdSelect, { | |||
.select-all { | |||
border-bottom: 1px solid ${theme.colors.grayscale.light3}; | |||
} | |||
.ant-select-item.ant-select-item-group { |
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 these should be moved to the ColorSchemeControl
:
<StyledSelect
css={css`
width: 100%;
<HERE>
`}
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.
👍
id: 'modernSunset', | ||
label: 'Modern sunset', | ||
group: ColorSchemeGroup.Featured, | ||
colors: [ |
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'm not sure if these should go into the theme
object. Could you add a TODO
comment to revisit this file when working on SIP-82 Improving Superset Theming?
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.
👍
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.
Do you think all the other colour scheme files (including the old ones) should be revisited? I can add todos to all of them so that we don't miss them
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.
That would be great! Thank you!
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 addressing the comments @kgabryje!
/testenv up |
@kgabryje Ephemeral environment spinning up at http://35.89.137.51:8080. Credentials are |
Ephemeral environment shutdown and build artifacts deleted. |
(cherry picked from commit bbfe5c0)
SUMMARY
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2024-04-11.at.18.44.54.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION