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

refactor: [M3-8339] - Clean up and fix Linode Details after CDS 2.0 #10662

Conversation

bnussman-akamai
Copy link
Member

@bnussman-akamai bnussman-akamai commented Jul 9, 2024

Description πŸ“

  • Removes many unnecessary styled components πŸ—‘οΈ
  • Removes unnecessary usages of Grid πŸ—‘οΈ
  • Fixes dark mode paper theme color 🎨
  • Replaces usages of AddNewLink with Button πŸ”˜
  • Fixes some styles the regressed because of new design tokens πŸ”§

Preview πŸ“·

Before After
Screenshot 2024-07-09 at 3 03 28β€―PM Screenshot 2024-07-09 at 3 03 44β€―PM
Screenshot 2024-07-09 at 3 04 22β€―PM Screenshot 2024-07-09 at 3 04 40β€―PM

How to test πŸ§ͺ

  • Check Linode Details for general styling and functionality 🎨 πŸ”˜
  • Verify the theme change looks correct πŸ‘οΈ

As an Author I have considered πŸ€”

  • πŸ‘€ 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

@bnussman-akamai bnussman-akamai added Clean Up Design Tokens Laying the groundwork for Design Tokens labels Jul 9, 2024
@bnussman-akamai bnussman-akamai self-assigned this Jul 9, 2024
@bnussman-akamai bnussman-akamai requested a review from a team as a code owner July 9, 2024 19:07
@bnussman-akamai bnussman-akamai requested review from hkhalil-akamai and abailly-akamai and removed request for a team July 9, 2024 19:07
@@ -858,7 +858,7 @@ export const darkTheme: ThemeOptions = {
palette: {
background: {
default: customDarkModeOptions.bg.app,
paper: Color.Neutrals[100],
paper: Color.Neutrals[90],
Copy link
Member Author

Choose a reason for hiding this comment

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

bg.bgPaper is set to Color.Neutrals[90] so I think this should probably be set to the same thing.

bg.bgPaper should probably be phased out in the long run in favor of MUI's built in palette value theme.palette.background.paper

Copy link
Contributor

Choose a reason for hiding this comment

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

We will clean some of that up in future theme layer updates. Ideally we don't want to use either directly anyway. In our perfect world we won't have any exportable theme constants.

<StyledTypography variant="h3">IP Addresses</StyledTypography>
</Grid>
<StyledWrapperGrid>
<Hidden smDown>
Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this Hidden because we should probably be allowing mobile users to access IP Transfer and IP Sharing

Copy link
Contributor

Choose a reason for hiding this comment

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

This does lead to some wrapping at narrow widths but it doesn't affect usability:

Screenshot 2024-07-09 at 5 46 22β€―PM

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated this to switch over to an ActionMenu on small screens in a22ef07

@bnussman-akamai bnussman-akamai changed the title refactor [M3-8339] - Clean up and fix Linode Details after CDS 2.5 refactor [M3-8339] - Clean up and fix Linode Details after CDS 2.0 Jul 9, 2024
Copy link

github-actions bot commented Jul 9, 2024

Coverage Report: βœ…
Base Coverage: 82.31%
Current Coverage: 82.31%

Copy link
Contributor

@hkhalil-akamai hkhalil-akamai left a comment

Choose a reason for hiding this comment

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

Great job simplifying styles while maintaining pixel-parity with what we had before. Tested and looks good in all breakpoints. A few minor questions.

>
<Stack>
<Box
bgcolor={(theme) => theme.palette.background.paper}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we adding a background color to the headers in this section, is it to match what we had before?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, exactly. The previous implementation was using theme.color.white, but since CDS was merged, the color changed causing these headers to have no visible background in dark mode. I updated this to use theme.palette.background.paper, which seems more fitting anyways.

We could probably use a Paper instead of a Box here, but I went with Box to keep things more "raw"

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 understand what keep things more "raw"means but using the right component is always the better option VS a one time style, especially as the theme will go through more changes in the near future

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I initially hesitated to use Paper because I was worried that its built-in padding would cause problems, but it doesn't matter because I'm specifying the padding manually anyway

Addressed in 8730aae

@bnussman-akamai bnussman-akamai changed the title refactor [M3-8339] - Clean up and fix Linode Details after CDS 2.0 refactor: [M3-8339] - Clean up and fix Linode Details after CDS 2.0 Jul 10, 2024
>
<Stack>
<Box
bgcolor={(theme) => theme.palette.background.paper}
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 understand what keep things more "raw"means but using the right component is always the better option VS a one time style, especially as the theme will go through more changes in the near future

@@ -858,7 +858,7 @@ export const darkTheme: ThemeOptions = {
palette: {
background: {
default: customDarkModeOptions.bg.app,
paper: Color.Neutrals[100],
paper: Color.Neutrals[90],
Copy link
Contributor

Choose a reason for hiding this comment

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

We will clean some of that up in future theme layer updates. Ideally we don't want to use either directly anyway. In our perfect world we won't have any exportable theme constants.

Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

thx for addressing the changes!

@bnussman-akamai bnussman-akamai merged commit aab737c into linode:develop Jul 11, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Up Design Tokens Laying the groundwork for Design Tokens
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants