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

upcoming: [DI-20800] - CSS for widget size control and feedbacks #10951

Merged

Conversation

venkymano-akamai
Copy link
Contributor

@venkymano-akamai venkymano-akamai commented Sep 17, 2024

Description 📝

CSS updates according to UX feedback for widgets and main bar

Changes 🔄

  1. Fixed widget paper wrapper height
  2. Fixed legend table height and overflow on scroll
  3. Removed divider between filters and graph inside widget
  4. Main Bar consistency according to UX margin (24px), divider color update
  5. Placeholder update according to suggestion

Target release date 🗓️

01-10-2024

Preview 📷

Before After
Screenshot 2024-09-17 at 4 53 46 PM Screenshot 2024-09-17 at 4 28 06 PM
Screenshot 2024-09-17 at 4 54 16 PM Screenshot 2024-09-17 at 4 47 57 PM

How to test 🧪

  1. As some of endpoints are not available enable mock service
  2. Go to monitors tab
  3. Select dashboard and filters, you will be able to see widgets and CSS fixes

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@venkymano-akamai venkymano-akamai requested a review from a team as a code owner September 17, 2024 08:13
@venkymano-akamai venkymano-akamai requested review from dwiley-akamai and cpathipa and removed request for a team September 17, 2024 08:13
@venkymano-akamai venkymano-akamai marked this pull request as draft September 17, 2024 08:13
Copy link
Contributor

@cpathipa cpathipa left a comment

Choose a reason for hiding this comment

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

@venkymano-akamai Left couple comments in the initial review, Will take a deeper look later today. Please revolve the conflicts.

@@ -131,7 +131,7 @@ export const CloudPulseDashboardLanding = () => {
}

return (
<Grid container spacing={2}>
<Grid container paddingTop={'8px'} spacing={2}>
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 use theme values instead of hardcoded values here?

Copy link
Contributor Author

@venkymano-akamai venkymano-akamai Sep 18, 2024

Choose a reason for hiding this comment

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

done, changed to paddingTop={1} = 8px, also tried to use theme.spacing wherever possible

sx={{
marginBlockEnd: 'auto',
borderColor: '#F4F5F6',
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cpathipa , the color '#F4F5F6' is not present in themes, i have used grey5 that seems to be very similar, any chance here we can go with '#F4F5F6' this color itself

Choose a reason for hiding this comment

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

@gitkcosby/ @cpathipa We have got this color from Dominik( ACLP UX), Would you able to help us to provide the appropriate theme color for this?

Choose a reason for hiding this comment

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

@venkymano-akamai Domink confirmed that we are good to use grey5 (#f7f7fa) as its almost same color. We can use the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!!, grey5 we will go

@venkymano-akamai venkymano-akamai marked this pull request as ready for review September 19, 2024 11:56
Copy link
Contributor

@jaalah-akamai jaalah-akamai left a comment

Choose a reason for hiding this comment

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

Looks good overall - just a few comments

height: theme.spacing(67.5), // 540px
maxHeight: theme.spacing(67.5), // 540px
},
}));
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think any of this is necessary now that we've set an overflow/scroll for the legends.

Copy link
Contributor Author

@venkymano-akamai venkymano-akamai Sep 19, 2024

Choose a reason for hiding this comment

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

@jaalah-akamai , we fixed this height because, we need to show error, while there is an issue from metrics API or any un-related errors, where we don't render the graph at all

Even in the error case, the spacing should remain the same

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea so when I see maxHeight, that's usually a red flag for me because we're cropping the natural growth of elements (unless it's absolutely necessary). You just want the error state to always match the other containers, and that can be accomplished without these styles by adding this:

Screenshot 2024-09-19 at 1 15 55 PM

Replaced StyledWidgetWrapper with just Paper

Copy link
Contributor

Choose a reason for hiding this comment

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

In CloudPulseWidget.tsx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jaalah-akamai , this works as well, I have removed the wrapper. Thanks for the suggestion

packages/manager/src/assets/icons/arrow_right.svg Outdated Show resolved Hide resolved
</Typography>
<Stack
alignItems={'center'}
direction={{ sm: 'row' }}
gap={{ md: 2, xs: 1 }}
gap={2}
maxHeight={`calc(${theme.spacing(10)} + 5px)`}
Copy link
Contributor

Choose a reason for hiding this comment

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

maxHeight - Doesn't appear to be doing much, and do we need it? I don't think those controls should grow at all

Copy link
Contributor Author

@venkymano-akamai venkymano-akamai Sep 19, 2024

Choose a reason for hiding this comment

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

@jaalah-akamai , yes we need , because if we introduce more filters, possibly include a dimension filter, and another thing to start listing down the selected filters, we can fix the height and introduce a scroll for views. Because, in one widget, i might select three dimension filter and start listing down that and in another widget i only might select two filters, again the size of the widget is growing dynamically and we will have two different sized widgets

Copy link

@kmuddapo kmuddapo Sep 19, 2024

Choose a reason for hiding this comment

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

There is a use case in future we need to support another control like split by within a widget, so there is a quite chance it can grow.

@jaalah-akamai
Copy link
Contributor

I'm not sure if this is a bug or not, but with the new overflow/scrolling, can we keep the mobile layout the same as desktop? I actually think it looks better and it would enable us to remove a lot of breakpoint specific styles.

Before After
Screenshot 2024-09-19 at 9 56 30 AM Screenshot 2024-09-19 at 9 56 00 AM

@venkymano-akamai
Copy link
Contributor Author

venkymano-akamai commented Sep 19, 2024

I'm not sure if this is a bug or not, but with the new overflow/scrolling, can we keep the mobile layout the same as desktop? I actually think it looks better and it would enable us to remove a lot of breakpoint specific styles.

Before After
Screenshot 2024-09-19 at 9 56 30 AM Screenshot 2024-09-19 at 9 56 00 AM

@jaalah-akamai , if it is regarding the styles of legend rows it is actual behaviour of linegraph, this involves changes in actual line graph component i think, anyway as we are migrating to recharts, we don't want to touch the actual line graph component. Let me know your thoughts on this

Also to achieve this we need to the changes in LineGraph.styles.ts and remove all styles involving theme.breakpoints.down('md'). We hope this might have already handled if we go for recharts, so we don't need now

Also , if this is mandatory and no one is using linegraph, we can remove those styles and commit it, please confirm

@venkymano-akamai
Copy link
Contributor Author

@jaalah-akamai , I addressed most of comments and replied my thoughts on some of the comments, can you please check once?

@kmuddapo
Copy link

I'm not sure if this is a bug or not, but with the new overflow/scrolling, can we keep the mobile layout the same as desktop? I actually think it looks better and it would enable us to remove a lot of breakpoint specific styles.
Before After
Screenshot 2024-09-19 at 9 56 30 AM Screenshot 2024-09-19 at 9 56 00 AM

@jaalah-akamai , if it is regarding the styles of legend rows it is actual behaviour of linegraph, this involves changes in actual line graph component i think, anyway as we are migrating to recharts, we don't want to touch the actual line graph component. Let me know your thoughts on this

Also to achieve this we need to the changes in LineGraph.styles.ts and remove all styles involving theme.breakpoints.down('md'). We hope this might have already handled if we go for recharts, so we don't need now

Also , if this is mandatory and no one is using linegraph, we can remove those styles and commit it, please confirm

My recommendation is not to touch the existing linegraph as its a generic component and we anyway planned to migrate to recharts in next sprint (2 weeks from now) and any changes to linegraph might be a throw away code again.

@jaalah-akamai jaalah-akamai added the Add'tl Approval Needed Waiting on another approval! label Sep 19, 2024
Copy link
Contributor

@dwiley-akamai dwiley-akamai left a comment

Choose a reason for hiding this comment

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

Verified described CSS fixes ✅
Code review ✅

Copy link
Contributor

@coliu-akamai coliu-akamai left a comment

Choose a reason for hiding this comment

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

For some reason I'm seeing that the first two graphs take up the entire screen width, even on a large screen, vs the last two graphs - not sure if this expected? Is anyone else experiencing the same?

pic 1 pic 2
image image

@jaalah-akamai jaalah-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Sep 19, 2024
@jaalah-akamai
Copy link
Contributor

Will merge if pipeline passes 👍

@kmuddapo
Copy link

For some reason I'm seeing that the first two graphs take up the entire screen width, even on a large screen, vs the last two graphs - not sure if this expected? Is anyone else experiencing the same?

pic 1 pic 2
image image

Yes!! Thats expected, User has the ability to Zoom in/Zoom out the widget, based on that size of the widget varies.

@kmuddapo
Copy link

Will merge if pipeline passes 👍

Thanks!! @jaalah-akamai

@coliu-akamai
Copy link
Contributor

coliu-akamai commented Sep 20, 2024

Yes!! Thats expected, User has the ability to Zoom in/Zoom out the widget, based on that size of the widget varies.

Awesome, thanks for clarifying! 🤦

Copy link

Coverage Report:
Base Coverage: 86.94%
Current Coverage: 86.94%

@jaalah-akamai jaalah-akamai merged commit 538d9e1 into linode:develop Sep 20, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! CloudPulse
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants