-
Notifications
You must be signed in to change notification settings - Fork 758
Improve EventListener UI #7937
Improve EventListener UI #7937
Conversation
@fvsch Correct me if I'm wrong, but the arrow referenced in the mockup seems to be based on an older ~8x9px arrow, but it was changed to 10x10px recently. Is the intent to keep things as similar to the mockup as possible? If so you'd probably want something like this below for the checkbox:
Apart from that I just played with it and it looks good - great job @harshlele! |
So it's the same arrow, in the So the red/blue lines drawn by Matt have to be taken with a grain of salf because they encore visual intent, which may not be the same as the actual distance between two DOM nodes. |
I'm looking at the PR, and it's a good improvement overall. This point was is not addressed in the PR yet:
(By button I mean a element wrapping the Regarding the spacing, it's a nice improvement but I think we can still improve it further:
On the code quality side:
|
So i just put the arrow inside a button, then made that button element 20x20px, and moved the arrow's click listener to the button. I think this should solve both of these problems:
|
align-items: center; | ||
} | ||
|
||
.btn-expand-category { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all the classes in this file use a .event-listener-*
pattern, can we use that here too?
.event-listener-expand
could work;.event-listener-header > button
works too, but I'm partial to having a specific class, in case we want to add other buttons in the same context in the future.
Currently, selectors in Debugger stylesheets are global, so this style is publishing "btn-expand-category" as a global name that can be consumed anywhere in Debugger (see #7905). That can be a worthwhile thing to do, but if we want to do it we should create a reusable ExpandCategoryButton or something (we may do it if we end up repeating the same UI pattern and design in a few places).
> | ||
<AccessibleImage className={classnames("arrow", { expanded })} /> | ||
</button> | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this extra <div>
and just use the <label>
for styling.
@@ -33,7 +60,14 @@ html[dir="rtl"] .event-listeners-content .arrow.expanded { | |||
margin-inline-start: 30px; | |||
} | |||
|
|||
.event-listener-event span { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This selector could impact too many elements, especially if we add some in the future.
Maybe .event-listener-event label span
, or a new class like .event-listener-name
.
For spacing, I find that with a 20px arrow button we can adjust spacing like this to match the mockup:
Rationale:
|
I'm not sure if i understood this correctly, but wouldn't this look/act weird? If the label extended all the way to the edge,it would feel like you're just randomly clicking in an empty area to right of the label text. (because the label text would always just be besides the checkbox) |
Sorry I thought I had replied to this earlier, but I must have forgotten to send the comment.
I guess I'm just used to this kind of UI, but if you feel that would be too strange let's not do it. .event-listener-group label {
display: block;
padding-block: 3px;
padding-inline-start: 2px;
padding-inline-end: 10px;
} So that if the user targets the end of the label text and clicks with some level of imprecision, we still register that click. (Rule of thumb for desktop UI: users will routinely click roughly 10px away from their target. And for touch interfaces, the imprecision can be much bigger, which is why Apple and Material guidelines ask for buttons that are at least 44px or 48px tall.) |
Hmm I added the padding to the label. Although, I got "unknown property" warnings in my editor, chrome and firefox for the |
@harshlele Thanks a lot. I tried the result locally and it looks great and works with keyboard navigation too. 👍 @darkwing This should be good to go. |
Wow, this is amazing work @harshlele ! Thank you so much! |
… into bug-7571-set-dir-root * 'master' of https://github.com/devtools-html/debugger.html: [Sources] Consolidate sources reducer (firefox-devtools#7977) Update maintainer.md (firefox-devtools#7973) Improve EventListener UI (firefox-devtools#7937)
#7879 - Improve UI implementation of EventListeners list
Summary of Changes