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

fix(filters): improving the add filter/divider UI. #31279

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

rusackas
Copy link
Member

@rusackas rusackas commented Dec 4, 2024

SUMMARY

This has driven me crazy for too long! Finally fixing the weird pop-up to add filters or dividers, and just use sensible buttons!

I'll add some comments in the thread, hoping it helps reviewers.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After:
Dec-04-2024 13-08-11

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added the dashboard:design Related to the Dashboard UI/UX label Dec 4, 2024
@@ -267,7 +267,6 @@ const TableElement = ({ table, ...props }: TableElementProps) => {
return (
<ButtonGroup
css={css`
display: flex;
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved this to be a default style for ButtonGroup, rather than an override.

@@ -30,22 +31,28 @@ export default function ButtonGroup(props: ButtonGroupProps) {
role="group"
className={className}
css={{
'& :nth-of-type(1):not(:nth-last-of-type(1))': {
display: 'flex',
'& > :nth-of-type(1):not(:nth-last-of-type(1))': {
Copy link
Member Author

Choose a reason for hiding this comment

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

Now that we have icons in buttons sometimes (which was always supported by AntD), I made these styles more specific, so they apply to the buttons themselves, and not elements within the buttons.

borderTopLeftRadius: 0,
borderBottomLeftRadius: 0,
marginLeft: 0,
},
...(props.expand && {
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding a new "expand" prop that makes buttons take up the available width (stretching).

Important side note that I GREATLY prefer adding props or classes to components, rather than adding overrides in their individual instances (that makes a mess).

@@ -54,6 +54,7 @@ import {
LineChartOutlined,
LoadingOutlined,
MonitorOutlined,
PicCenterOutlined,
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding a new icon that works well enough for filter bar dividers.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 4, 2024
@kasiazjc
Copy link
Contributor

kasiazjc commented Dec 4, 2024

Thanks @rusackas for taking this up! Buttons here look more like tabs to me and it's not as obvious that they add new elements. I would suggest going for either:

  • secondary + tertiary/link side by side
  • the pattern we have in the top nav with better dropdown and trigger - not perfect, but better than what we have
    From the two I would go with the first solution though if we can do it.

@mistercrunch
Copy link
Member

This is a good improvement already, I'm not against merging as "less bad". Maybe a design idea would be to move the "add divider" button under the last filter (?) Not sure if that makes sense

@rusackas
Copy link
Member Author

rusackas commented Dec 4, 2024

Per @mistercrunch @justinpark and @michael-s-molina 's suggestions, I've moved the buttons to the bottom (like the Apply Filters button).

Per @kasiazjc and @michael-s-molina 's suggestions, I've separated the buttons rather than using the split-button ButtonGroup component.

Per @kasiazjc's request, I've gone with secondary rather than tertiary buttons.

Definitely looks/feels better now. Someone please approve it, so I can go straighten some other crooked picture on a wall somewhere ;)

@mistercrunch
Copy link
Member

200w (1)

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM, I really like the latest version with the buttons below (I love @kasiazjc's keen eye for this stuff!). But please update the description with the updated video.

@rusackas
Copy link
Member Author

rusackas commented Dec 4, 2024

LGTM, I really like the latest version with the buttons below (I love @kasiazjc's keen eye for this stuff!). But please update the description with the updated video.

Agreed... after everyone's feedback, things look much better than my first iteration. I set my standards too low, as I simply wanted the weird popover to die a fiery death. Once I'm done playing whack-a-mole with CI, I'll merge :D

@rusackas
Copy link
Member Author

rusackas commented Dec 4, 2024

Just need a Cypress codeowner stamp from @geido @eschutho or @betodealmeida to squeeze this one through 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard:design Related to the Dashboard UI/UX preset-io size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants