Closed Bug 1476296 Opened 3 years ago Closed 1 year ago

Focused filter buttons look like `active` (confusing)

Categories

(DevTools :: Netmonitor, defect, P3)

defect

Tracking

(firefox75 fixed)

RESOLVED FIXED
Firefox 75
Tracking Status
firefox75 --- fixed

People

(Reporter: nachtigall, Assigned: vtsty.dev, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: good-first-bug)

Attachments

(3 files)

AR:
Pressing / deactivating an active filter button in Network tab makes them still look like being kind of active. I think this was introduced some days/weeks ago.

ER:
Make it behave and look like the filter buttons in the console. 

See attached screencast.
What I mean is the intermediate grey style when a disabled button is focussed. It is confusing what this means.

Same for the light blue when active state is foccussed.
Attached image filter-focus.jpg
I can see it. Yes, it's confusing.

We might use the same bk color for focused button as the Console panel (to be consistent). See the attached screenshot - the Requests button is focused.

Honza
Mentor: odvarko
Keywords: good-first-bug
Priority: -- → P3
Whiteboard: good-first-bug
I would like to work on this as my second bug. Thanks
Hi,
    I'd like to work on this bug. Please let me know how to proceed.
Thanks,
Cheryl.
> Make it behave and look like the filter buttons in the console. 

It seems that the Console filter's way to manage this is to put the focus on the document body after users unselected a button. The code seems to detect keyboard navigation, because when the buttons are tabbed to and unselected with Space or Enter keys, they keep focus and focus styles (as they should!).

A simpler fix that doesn't require that much JS logic might be to change :focus styles to use :-moz-focusring instead.
Firefox has some heuristics that make :-moz-focusring active only when users have used keyboard navigation. These heuristics might not be perfect, but they could still be a good improvement here.

Documentation:
https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-focusring

The change could be changing this:

.devtools-button:not(:empty):not(.checked):not(:disabled):focus, .devtools-toolbarbutton:not(:-moz-any([checked="true"], [disabled]))[label]:focus {
    background-color: var(--toolbarbutton-focus-background);
    color: var(--toolbarbutton-focus-color);
}

to:

.devtools-button:not(:empty):not(.checked):not(:disabled):-moz-focusring,
.devtools-toolbarbutton:not(:-moz-any([checked="true"], [disabled]))[label]:-moz-focusring {
    background-color: var(--toolbarbutton-focus-background);
    color: var(--toolbarbutton-focus-color);
}

in resource://devtools/client/themes/common.css

Tried it briefly, and it seems to be working alright.
Small correction: the Console sends focus to the jsterm <textarea>. This allows mouse users to click a filter button, then resume typing immediately.
Sorry for delayed response, just got back from my vacation.

I have to give a chance to the first person who expressed interest in fixing this bug. 

(In reply to Mihir Karbelkar(:fauxwizard_) from comment #3)
> I would like to work on this as my second bug. Thanks
Mihir, are you still interested in this?
Should I assign the bug to you?

Honza
Flags: needinfo?(karbelkar.mihir)
Yes I would like to work on this. is it fine if take 2-3 days because I am a little busy with some activities in my college. thanks.
Flags: needinfo?(karbelkar.mihir)
Assignee: nobody → karbelkar.mihir
Status: NEW → ASSIGNED
Assignee: karbelkar.mihir → nobody
Status: ASSIGNED → NEW
Hi,
    I'd like to work on this bug. Please let me know how to proceed.
Thanks,
Renata.
Flags: needinfo?(odvarko)
Assigned to you!

Please see comment #5, is it promising solution?
Honza
Assignee: nobody → renataandrade1987
Status: NEW → ASSIGNED
Flags: needinfo?(odvarko)
It seems that :-moz-focusring might not be working as I expected. It behaves identically to :focus in my tests these days. Not sure if that's a recent regression, or a platform-specific limitation maybe.
See Also: → 1502098
(In reply to Florens Verschelde [:fvsch] from comment #11)
> It seems that :-moz-focusring might not be working as I expected. It behaves
> identically to :focus in my tests these days. Not sure if that's a recent
> regression, or a platform-specific limitation maybe.
Thanks for the analysis! Any workaround?
Should I assign you this this bug?

Honza
Assignee: renataandrade1987 → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(florens)
I'll take it. I need to check if the :-moz-focusring issues are affecting all platforms, if they are reported somewhere else, etc.

If we don't have a native CSS solution, we could investigate making use of a :focus-visible JS polyfill, and see what the perf cost might be.
Assignee: nobody → florens
Status: NEW → ASSIGNED
Flags: needinfo?(florens)

(In reply to Florens Verschelde :fvsch from comment #13)

I'll take it. I need to check if the :-moz-focusring issues are affecting
all platforms, if they are reported somewhere else, etc.

Hello @Florens! How was your investigation? I am looking to contribute as I am applying for this project for the Outreachy internship. Can I help with this?

Assignee: florens → nobody
Status: ASSIGNED → NEW

Is this still valid ? couldn't reproduce on latest nightly.

Flags: needinfo?(odvarko)
Flags: needinfo?(odvarko)

I don't know how to see the toggle buttons behavior on different OS. This bug disapeared on Ubuntu

Assignee: nobody → vtsty.dev
Status: NEW → ASSIGNED
Attachment #9127477 - Attachment description: Bug 1476296 - Eliminate confusing with CSS :focus selector → Bug 1476296 - Remove confusing devtools toggle button focused state
Summary: Focussed filter buttons look like `active` (confusing) → Focused filter buttons look like `active` (confusing)
Pushed by jodvarko@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2ef93285bdc1
Remove confusing devtools toggle button focused state r=Honza,fvsch
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 75
You need to log in before you can comment on or make changes to this bug.