mozilla / perfcompare

Improved Performance Comparison Tool
Mozilla Public License 2.0
39 stars 93 forks source link

Use the palette instead of overridden style for IconButtons #656

Closed julienw closed 4 months ago

julienw commented 4 months ago

(Note: lots of files changed, but that's mostly test snapshots with all containing the same change -- you can focus on the non-snapshot changes first)

The problem: The way the style was previously specified was applying it globally to the whole app. This applied to both adornments (https://mui.com/material-ui/react-text-field/#input-adornments) and all input buttons (moreover the documentation is very deficient about this "active" palette property).

I wanted to add such adornments and IconButtons to the "filter by title" search and therefore this style applied there, and I would have had to override it.

The solution: However I think it's much easier instead to stop applying the style globally and use it just where necessary. Moreover it's super easy to just use the keyword color="primary", it also adjusts automatically to the dark mode thanks to the magic in src/theme/protocolTheme.ts.

This is the first commit.

I took this opportunity to fix the snackbar's close button color. This is related to the fixed issue because this is also using an IconButton. While I was there I also added an aria-label. This is the second commit. Note that the snackbar still looks a bit weird because the default icon (on the left) for the error variant in notistack also looks like a "close" button.

Except for the snackbar close button color, there should be no other visible change with this PR.

netlify[bot] commented 4 months ago

Deploy Preview for mozilla-perfcompare ready!

Name Link
Latest commit 3ecbf2f85a5042b0406354cc7334437816f50086
Latest deploy log https://app.netlify.com/sites/mozilla-perfcompare/deploys/6656fcba927913000887f859
Deploy Preview https://deploy-preview-656--mozilla-perfcompare.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.71%. Comparing base (0936bce) to head (3ecbf2f).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## beta #656 +/- ## ======================================= Coverage 96.71% 96.71% ======================================= Files 67 67 Lines 1491 1491 Branches 257 257 ======================================= Hits 1442 1442 Misses 45 45 Partials 4 4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.