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

systemd: White widget backgrounds in the journal filter toolbar #21389

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mvollmer
Copy link
Member

@mvollmer mvollmer commented Dec 5, 2024

The secondary button should not be transparent.

At the same time, improve the existing CSS that does the same job for
menu toggles.

The toolbar already has its own super custom styling, which I had
missed earlier. Let's move our tweaks for the menu toggles into that
section and do them by setting the appropriate PF variable.

Also, we can remove the FIXME part.

@mvollmer mvollmer requested a review from garrett December 5, 2024 14:31
@martinpitt
Copy link
Member

Technical review 👍 . Happy to give a formal ack if you already agreed on this with Garrett someplace else. Thanks!

@martinpitt
Copy link
Member

@mvollmer would you mind putting a before/after screenshot? that may make it easier for @garrett to review.

@garrett
Copy link
Member

garrett commented Dec 12, 2024

I agree with this sentiment and the CSS looks like what I'd suspect. I'd be able to approve it with a screenshot. 😉

@garrett
Copy link
Member

garrett commented Dec 12, 2024

Also: Note: This would affect all buttons, regardless of context (what other widgets they're in), so it might have some unknown effects in some places.

It's probably correct, however.

@mvollmer mvollmer added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Dec 13, 2024
@mvollmer mvollmer force-pushed the pf-more-contrast-for-secondary-buttons branch from e2719dd to b6fd1f0 Compare December 13, 2024 08:20
@mvollmer mvollmer removed the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Dec 13, 2024
@mvollmer mvollmer force-pushed the pf-more-contrast-for-secondary-buttons branch 2 times, most recently from 5a4731a to b268d77 Compare December 13, 2024 10:19
@mvollmer mvollmer added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Dec 13, 2024
@mvollmer mvollmer force-pushed the pf-more-contrast-for-secondary-buttons branch from b268d77 to 169b0f2 Compare December 13, 2024 10:36
@mvollmer
Copy link
Member Author

mvollmer commented Dec 13, 2024

The hostswitcher has changed in light mode:

image

as opposed to earlier:

image

This does increase the contrast, and now the buttons have the same background color as the text input box. So I guess it's correct in that sense and looks as intended.

@mvollmer
Copy link
Member Author

The rest of the pixel changes are as expected. For example, the secondary buttons on the Networking page now look like this in dark mode:

image

as opposed to:

image

@mvollmer mvollmer force-pushed the pf-more-contrast-for-secondary-buttons branch 2 times, most recently from 93df7ea to 73229a3 Compare January 8, 2025 11:30
Copy link
Member

@garrett garrett left a comment

Choose a reason for hiding this comment

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

That actually decreases contrast between the background and the text, not increases it.

(referring to #21389 (comment))

The way PatternFly is designed is to have secondary buttons inherit the background color.

Buttons are incorrect in all the screenshots. IIRC, the goal was to ensure that there is enough contrast between the text and background in certain circumstances (where the background that is bleeding through and text does not have enough contrast).

@mvollmer
Copy link
Member Author

mvollmer commented Jan 8, 2025

That actually decreases contrast between the background and the text, not increases it.

Ah, I misunderstood which contrast we want to increase: I thought buttons should have a different background than their surroundings.

The way PatternFly is designed is to have secondary buttons inherit the background color.

And we should keep that?

It all started with this comment and screenshot:

image

You said:

the widgets should all have a white background there, including the secondary button; they need contrast... the text on grey isn't enough contrast, and additionally the grey on the widgets make them look disabled

From that I thought that widgets should get the primary background color (white in light mode), including secondary buttons. I completely missed the "text on grey" part. :-(

So in this PR it looks like this in light mode:

image

And this is dark mode now:

image

In both modes, the secondary button has the same background as the text input (for example).

I am happy to just close this PR, of course, but if you think we should change how secondary buttons look, I am happy to do that as well. :-) But I can't tell right now what should be changed exactly.

@mvollmer mvollmer requested a review from garrett January 8, 2025 14:11
@garrett
Copy link
Member

garrett commented Jan 8, 2025

Yeah, this is clearly wrong:

image

The dropdowns and the button should have the white background. The grey background makes them not look like widgets, does not have enough contrast between the text and the background, and even makes the button look disabled. Those are all things that need fixing, and why it has a white background on main (unless that was changed recently and is then a big usability and accessibility bug if so) and should always have a white background.

I'm pretty sure I said elsewhere that this should not happen globally, but only in cases like this. It's fine to have a fix for these widgets in the general toolbar widget like this, but it's not OK to just globally change the background of the widgets everywhere.

@mvollmer
Copy link
Member Author

mvollmer commented Jan 8, 2025

The dropdowns and the button should have the white background.

Ok! What about dark mode? How should that look in the specific case of the journal filter header?

I'm pretty sure I said elsewhere that this should not happen globally, but only in cases like this.

Yes, I agree.

@garrett
Copy link
Member

garrett commented Jan 8, 2025

Ok! What about dark mode? How should that look in the specific case of the journal filter header?

Good question. Which component is providing that grey background? I did a look through the PF5 site through all components and patterns to find a reference, but can't find it. What is it specifically?

Perhaps we're doing something an old, unsupported way or something out of spec. I think this page was even pre-PatternFly at some point? Perhaps we need to change the widgets and the look it's using overall? Perhaps this is why it's weird?

@mvollmer mvollmer marked this pull request as draft January 9, 2025 07:21
@mvollmer
Copy link
Member Author

mvollmer commented Jan 9, 2025

Which component is providing that grey background?

It's a Toolbar, with our own styling:

.pf-v5-c-toolbar {
  --pf-v5-c-toolbar--BackgroundColor: var(--pf-v5-c-page__main-section--BackgroundColor);

  // Make toolbar stretch to all the available space and wrap up to two lines
  .pf-v5-c-toolbar__group:nth-child(3) {
    flex-grow: 1;
  }

  // Make text filter stretch to all the available space
  .pf-v5-c-toolbar__item.text-search, .journal-filters-grep {
    flex-grow: 1;
  }

  .text-help {
    padding-inline-start: var(--pf-v5-global--spacer--xs);
  }

  // Hide filters from advanced search dropdown entries which already exist in the toolbar
  .journal-filters-grep .pf-v5-c-panel__main-body {
    .pf-v5-c-form__group:nth-child(5), .pf-v5-c-form__group:nth-child(6) {
      display: none;
    }
  }

  .pf-v5-c-toolbar__expandable-content.pf-m-expanded .pf-v5-c-divider {
    display: none;
  }

  // FIXME: When porting the selects to the PF5 select implementation drop this
  .pf-v5-c-toolbar__item {
    align-self: center;
  }
}

I wasn't aware that toolbars normally don't have a grey background...

Oh, there is a FIXME that we can now act on. :)

@mvollmer mvollmer force-pushed the pf-more-contrast-for-secondary-buttons branch from 73229a3 to e2c84c6 Compare January 9, 2025 08:41
@mvollmer
Copy link
Member Author

mvollmer commented Jan 9, 2025

Ok, I have redone this. The CSS changes now only apply to the journal filter toolbar, and I hope I have also found a better way get the desired effect by setting some PF variables.

Dark mode is unchanged for now.

@mvollmer mvollmer force-pushed the pf-more-contrast-for-secondary-buttons branch 2 times, most recently from f877f0c to d301d23 Compare January 9, 2025 10:10
@mvollmer
Copy link
Member Author

mvollmer commented Jan 9, 2025

@mvollmer mvollmer removed the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Jan 9, 2025
The secondary button should not be transparent.

At the same time, improve the existing CSS that does the same job for
menu toggles.

The toolbar already has its own super custom styling, which I had
missed earlier. Let's move our tweaks for the menu toggles into that
section and do them by setting the appropriate PF variable.

Also, we can remove the FIXME part.
@mvollmer mvollmer force-pushed the pf-more-contrast-for-secondary-buttons branch from d301d23 to 0c41f81 Compare January 9, 2025 10:12
@mvollmer mvollmer marked this pull request as ready for review January 9, 2025 10:21
@mvollmer mvollmer changed the title lib: Give secondary buttons more contrast in toolbars systemd: White widget backgrounds in the journal filter toolbar Jan 9, 2025
@mvollmer mvollmer assigned mvollmer and unassigned mvollmer Jan 9, 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