Skip to content

Styling cleanup #4573

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

Merged
merged 11 commits into from
Jan 19, 2025
Merged

Styling cleanup #4573

merged 11 commits into from
Jan 19, 2025

Conversation

mproffitt
Copy link
Contributor

@mproffitt mproffitt commented Jan 19, 2025

What changed?

This PR cleans up a number of stylistic issues I have noticed in the UI.

Each style change is a distinct commit on the PR to aid in isolation and be able to describe what each change is as part of its commit rather than trying to raise each one as a separate PR.

Why was this change made?

Whilst browsing the UI I have noticed a number of stylistic issues, particularly in Dark mode that in some cases are the result of the switch from Material UI 4 to Material UI 5.

  • 6b19b10a6 Button styling fixes
  • 2f4024ef1 Link hover states for sidebar and tabs
  • 5c8c3ce4f Search field showed as wrapper to filter button
  • 9121cd8a6 Styling changes for light mode to make it less harsh
  • 54e909083 YAML sidebar in dark mode
  • d9e5edb43 Fix alerts import and styling
  • 44fdac8df Better placing for User details dropdown
  • 4e0db75fc Better centring for the resume icon
  • 01c770cc1 Clean up theming of sync controls
  • 98fead114 Set default zoom level down to 75% from 85%
  • 49ff2db5f Set graph thumb to centre on the slider

Each of these commits contains additional information about why the change was made. Please see the commit log for details.

How did you validate the change?

Local testing, ensuring close compatibility with existing unit tests, clicking around in the UI

Release notes

N/A

Documentation Changes

N/A

@mproffitt mproffitt requested a review from a team January 19, 2025 10:29
Copy link
Collaborator

@casibbald casibbald left a comment

Choose a reason for hiding this comment

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

In this case let's not squash this PR so each of these is traceable

@erikgb
Copy link
Contributor

erikgb commented Jan 19, 2025

In this case let's not squash this PR so each of these is traceable

Agree! I tend to default to a rebase merge - since most of my PRs contain a single commit. But there are exceptions - like this one.

@casibbald
Copy link
Collaborator

casibbald commented Jan 19, 2025 via email

Copy link
Collaborator

@casibbald casibbald left a comment

Choose a reason for hiding this comment

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

Virtual beer for the Snow blindness fix

@mproffitt
Copy link
Contributor Author

Updated the description to include the latest commit references. I'd definitely prefer a rebase for this over a squash, then we can pick apart ones that may cause issues later.

@mproffitt mproffitt enabled auto-merge (rebase) January 19, 2025 15:26
In the original UI the thumb on the graph slider was centred on the
slider itself.

At some point, a change to one of the dependant libraries forced this
slider out by 9 pixels causing it to look out of place and badly styled.

This commit centres the thumb back on to the slider resulting in a
cleaner look.
By default the graph is zoomed at 85%. This is really closely zoomed and
seems too much for average viewing.

By reducing the default zoom to 75%, more of the graph is initially
visible whilst remaining legible on higher resolution monitors
The switch to Material UI 5 broke some of the styling on the sync
controls. This commit cleans that up and sets a better disabled state
for the `resume` button by setting the colour to be the same as for
other sync control buttons rather than using the same colour as the
enabled state.
The resume icon was offset inside the circle by 2 pixels causing it to
look slightly out of place compared to other sync control icons.
When clicking on the User Icon in the top right, the menu appeared more
towards the centre of the screen. This seemed out of place for where it
was expected to be.

This commit places it more underneath the profile icon, more inline with
what you expect for a menu.
When switched from MUI 4 to 5, the Alert moved from `@mui/lab` to
`@mui/material`. This resulted in errors being visible in the console
relating to this, and poor future compatibility.

By moving the import for Alert to `@mui/material` this improves compatibility
with future changes to the material ui library.

In addition to this, changes were made to the AlertList errors page to
remove the duplication of the alert icon, and re-style the dark mode
error state, relying more on functionality from the library rather than
duplicating behaviour and adding redundant elements.

- Set cleaner colors for the message and icon
- Remove 'clusterName: ' if clusterName not set
- Remove duplicate icon - this is set by MUI Alert and doesn't need to
  be in body of message
When the change to Material UI 5 was implemented, this resulted in a
white background in dark mode on the sidebar when the YAML view drawer
was opened.

This commit modifies the styling on the drawer to improve the visual
appearence of the drawer in dark mode.
When the search box is collapsed, it showed as a wrapper around the
filter button that looked out of place and rather ugly.

This changes the behaviour of how the search field is shown and hidden
to better interact with the UI by setting it more to invisible when
collapsed, and changing the transition from `ease-in-out` to `cubic
bezier`. This comes across as more smooth in display and fits better
with the theme.
In the sidebar, the hover state for links wasn't very clear and produced
a very narrow background that was specific to the text location. This
looked odd for wrapped text.

This commit changes that to span the whole sidebar link to better
highlight the link without looking out of place.

A similar behaviour has been added for tabs in the subtab page
This commit re-introduces fixes for button and thumb hover states

Previously these had a subtle but clear highlight state on hover. This
change re-introduces hover states in both dark and light modes
@mproffitt mproffitt merged commit d351b25 into weaveworks:main Jan 19, 2025
14 checks passed
This was referenced Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants