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

Adapt FilterNavigatorBar to High Contrast Mode. #5257

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

Conversation

nchevobbe
Copy link
Member

@nchevobbe nchevobbe commented Dec 11, 2024

This ensures the different items are properly rendered in HCM:

  • the items gets a button color, and have a distinct hovered style
  • the selected item looks selected
  • the separator are visible (a dark version of the existing image was added)
  • the disabled items have full opacity and use a gray text

dark light
single profile navigator button image image
single profile navigator button hovered image image
with a few items (second one hovered, last one is the "preview") image image

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.08%. Comparing base (9175e24) to head (033a323).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5257   +/-   ##
=======================================
  Coverage   86.08%   86.08%           
=======================================
  Files         311      311           
  Lines       29678    29678           
  Branches     8190     8190           
=======================================
  Hits        25548    25548           
  Misses       3548     3548           
  Partials      582      582           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nchevobbe nchevobbe added the accessibility Related to making the profiler UI accessible label Dec 11, 2024
Copy link
Contributor

@julienw julienw left a comment

Choose a reason for hiding this comment

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

Thanks!
I only have these small comments, tell me what you think and rerequest review when you're ready :-)

src/components/shared/FilterNavigatorBar.css Outdated Show resolved Hide resolved
@media (forced-colors: active) {
.filterNavigatorBar {
--internal-background-color: ButtonFace;
--internal-hover-background-color: SelectedItemText;
Copy link
Contributor

Choose a reason for hiding this comment

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

This one doesn't work very well for me on Linux when using the Light theme: it's white, so it doesn't well stand out with the white background around. Surprisingly with the dark theme this works fine, because SelectedItem and SelectedItemText stay the same (!) and therefore stand ou just fine!

It would be good to fix that but if that not easy (and you consider it's more a bug in Linux) I'm also fine with keeping it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe using ButtonFace/ButtonText would make sense?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could you post a screenshot of this please (with and without :hover)? So basically the issue is that SelectedItemText has the same/similar value as Canvas ? Could you check the computed values of those?
I'm using what's recommended by the accessibility team, but here the design isn't exactly the same (e.g. we don't have block borders). We could switch to using ButtonText bg and ButtonFace color, but that would make it different from other items we already have the SelectedItemText?SelectedItem pair for hover style :/

Copy link
Contributor

@julienw julienw Jan 17, 2025

Choose a reason for hiding this comment

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

Thinking about it more, I think I'd prefer to use the same selected values: that is SelectedItem for background and SelectedItemText for text, on hover. They'd stand out more. Currently I don't think they're very "high contrast" when hovering, not even in your screenshots.
(I'm fine to swap them for the "active" state though).

What do you think?

Screenshots with the current version:
light mode:
image

dark mode:
image

It may also be that there's a deeper issue in Firefox, where SelectedItem/SelectedItemText don't change with the dark mode (at least for me on Linux).

Copy link
Member Author

Choose a reason for hiding this comment

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

Thinking about it more, I think I'd prefer to use the same selected values: that is SelectedItem for background and SelectedItemText for text, on hover. They'd stand out more. Currently I don't think they're very "high contrast" when hovering, not even in your screenshots. (I'm fine to swap them for the "active" state though).

What do you think?

That would make it hard to differentiate between hovered and selected, which isn't ideal.
At least in the screenshot you're providing the color of the text is updated, so that's something.
If we want to go bold, we could have a ButtonText background with a ButtonFace color, but it looked a tad brutal when I tried (but I think that was something Nathan suggested to me in some HCM review in DevTools, so that could work).
Would you mind trying this combination and telling me how it looks for you?

(The borders look a bit weird on your screenshots, not sure what this is about)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking about it more, I think I'd prefer to use the same selected values: that is SelectedItem for background and SelectedItemText for text, on hover. They'd stand out more. Currently I don't think they're very "high contrast" when hovering, not even in your screenshots. (I'm fine to swap them for the "active" state though).
What do you think?

That would make it hard to differentiate between hovered and selected, which isn't ideal.

But to me that makes it obvious what a click operation will do: this will make the current hovered one selected.

At least in the screenshot you're providing the color of the text is updated, so that's something. If we want to go bold, we could have a ButtonText background with a ButtonFace color, but it looked a tad brutal when I tried (but I think that was something Nathan suggested to me in some HCM review in DevTools, so that could work). Would you mind trying this combination and telling me how it looks for you?

I can have a look yes.

(The borders look a bit weird on your screenshots, not sure what this is about)

This happens at some zoom level because of rounding differences (I think) between borders (sticking to integer number of pixels) and other things (not sticking to integer value of pixels). I never really bothered trying to fix this.

src/components/shared/FilterNavigatorBar.css Outdated Show resolved Hide resolved
This ensures the different items are properly rendered in HCM:
- the items gets a button color, and have a distinct hovered style
- the selected item looks selected
- the separator are visible (light and dark HCM-specific version of the existing image were added)
- the disabled items have full opacity and use a gray text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Related to making the profiler UI accessible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants