Closed
Bug 1141571
Opened 10 years ago
Closed 10 years ago
Add a legend to the Box Model tool
Categories
(DevTools :: Inspector, defect, P2)
DevTools
Inspector
Tracking
(firefox51 verified, firefox52 verified, firefox53 verified)
VERIFIED
FIXED
Firefox 40
People
(Reporter: janx, Assigned: janx)
References
(Blocks 1 open bug)
Details
(Whiteboard: [polish-backlog][difficulty=easy])
Attachments
(4 files, 2 obsolete files)
47.13 KB,
image/png
|
Details | |
6.09 KB,
patch
|
pbro
:
review+
|
Details | Diff | Splinter Review |
2.36 KB,
patch
|
bgrins
:
review+
|
Details | Diff | Splinter Review |
159.00 KB,
image/png
|
Details |
The Box Model inspector is a great tool, but it's suboptimal that you have to know what each color is for by heart.
Therefore, it would be nice to show a legend underneath like:
[#] margin (# is apple green)
[#] border (# is grey)
[#] padding (# is purple)
[#] bounding client rect (# is sky blue)
Assignee | ||
Updated•10 years ago
|
Whiteboard: [devedition-40]
Assignee | ||
Comment 1•10 years ago
|
||
Note: Hovering on a particular color does indicate what it represents, but as almost invisible white text on apple green background in the bottom right corner.
A proper legend would be more discoverable and readable, even in screenshots.
Updated•10 years ago
|
Whiteboard: [devedition-40] → [devedition-40][difficulty=easy]
Comment 2•10 years ago
|
||
Setting devedition-40 bugs to P2, filter on C17C996C-A0BE-4153-8057-FAB642D0746D
Priority: -- → P2
Assignee | ||
Comment 4•10 years ago
|
||
Brian, please have a look.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=0320e09f678c
Assignee | ||
Comment 5•10 years ago
|
||
Attached screenshot.
Note: For the color preview boxes, I chose a dotted outline with an offset of -1px, because it resembles the original more. However, it seems that on some zoom levels the offset looks more like -2px (probably a rounding error).
Maybe there is a better way to do the dotted outline?
Assignee | ||
Comment 6•10 years ago
|
||
Comment on attachment 8591640 [details] [diff] [review]
Add a legend to the Box Model tool.
(git bz forgot about the r? flag again)
Brian, please have a look.
This patch…
1. replaces the useless white-on-light-green, bottom-right tooltip with actual hover tooltips ("title" attribute).
2. defines the box model colors as CSS variables.
3. reuses these variables in a legend underneath the box model view.
Attachment #8591640 -
Flags: review?(bgrinstead)
Comment 7•10 years ago
|
||
For info, we do have a legend already. It appears when you hover over regions, for now it's just the name of the region and it's placed in the margin box (bottom right corner).
You might not have seen it because we have a regression at the moment whereby it's not easily visible anymore (white text on yellow background): see bug 1150507.
I do like the idea of a more prominent legend as you propose here (although in the screenshot you attached, I think it might be a little too big), but if we go for this, we'll need to get rid of the other legend.
Comment 8•10 years ago
|
||
I think it might be better to have the legend text appearing inside the box model similar to chrome and safari. It would provide a better UX and avoid this color matching the user would have to go through to determine whether or not it is a margin, padding, or border.
Assignee | ||
Comment 9•10 years ago
|
||
Thanks for the feedback!
Actually, I had noticed the bottom-right text-on-hover (see comment 1 and comment 6), but I believe that ― even when readable ― it's not discoverable, and so it doesn't help with users who get confused about the colors and don't hover (this actually happened to me several times). And it doesn't help with screenshots either.
I replaced this weird tooltip mechanism with an actual `title` attribute, so that when you hover over any of the values, you still see the "margin-top" or "border-bottom" text in an actual tooltip. The legend is just there for convenience, but it doesn't take up valuable space (it can overflow at the bottom) and can be ignored as needed.
Assignee | ||
Comment 10•10 years ago
|
||
TL;DR: With my patch, users still see useful information on hover, but can also benefit from a proper legend if they need it.
Comment 11•10 years ago
|
||
Comment on attachment 8591640 [details] [diff] [review]
Add a legend to the Box Model tool.
Review of attachment 8591640 [details] [diff] [review]:
-----------------------------------------------------------------
Would you mind splitting this into two patches? One that just replaces the old 'tooltip' mechanism with the title attribute, and a second that adds the legend.
Regarding the legend, I wonder if it would be easier for the user to have the text 'margin', 'border', 'padding' in the top left of the corresponding region. See how Firebug does it, for example (I'll attach a screenshot momentarily)
Attachment #8591640 -
Flags: review?(bgrinstead)
Comment 12•10 years ago
|
||
See how there is text in the corner of each region. I think this is nice since it's overlaid directly on what you are looking at
Updated•10 years ago
|
Status: NEW → ASSIGNED
Comment 13•10 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #12)
> Created attachment 8591836 [details]
> firebug-regions.png
>
> See how there is text in the corner of each region. I think this is nice
> since it's overlaid directly on what you are looking at
I would definitely prefer this approach! Having the legend overlays directly in the box model reduces that extra step of looking at the legend and matching it with the box.
Comment 14•10 years ago
|
||
(In reply to Brian Grinstead [:bgrins] from comment #11)
> Comment on attachment 8591640 [details] [diff] [review]
> Add a legend to the Box Model tool.
>
> Review of attachment 8591640 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Would you mind splitting this into two patches? One that just replaces the
> old 'tooltip' mechanism with the title attribute:
I have a patch in bug 1151956 ready to go that replaces all tooltip attributes with title attributes. But I wasn't as thorough as Jan, I didn't remove the old tooltip mechanism ... I havn't even seen we had this in place :|
Assignee | ||
Comment 15•10 years ago
|
||
(In reply to Gabriel Luong (:gl) from comment #13)
> (In reply to Brian Grinstead [:bgrins] from comment #12)
> > Created attachment 8591836 [details]
> > firebug-regions.png
> >
> > See how there is text in the corner of each region. I think this is nice
> > since it's overlaid directly on what you are looking at
>
> I would definitely prefer this approach! Having the legend overlays directly
> in the box model reduces that extra step of looking at the legend and
> matching it with the box.
OK fair enough, I will use this approach instead.
Assignee | ||
Comment 16•10 years ago
|
||
(In reply to Patrick Brosset [:pbrosset] [:patrick] from comment #14)
> I have a patch in bug 1151956 ready to go that replaces all tooltip
> attributes with title attributes. But I wasn't as thorough as Jan, I didn't
> remove the old tooltip mechanism ... I havn't even seen we had this in place
> :|
Whoops, sorry for the duplicate work!
You can either rebase your patch on top of mine, or land yours first. I'm fine either way :)
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5915ee441cd1
Attachment #8591640 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Attachment #8592194 -
Flags: review?(pbrosset)
Updated•10 years ago
|
Attachment #8592194 -
Flags: review?(pbrosset) → review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed,
leave-open
Assignee | ||
Updated•10 years ago
|
Attachment #8591646 -
Attachment is obsolete: true
Assignee | ||
Comment 17•10 years ago
|
||
Sheriffs, please land the other patch; this one still needs r+.
Changed legend as suggested, I'll upload a screenshot.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=88cfdec022c8
Assignee | ||
Comment 18•10 years ago
|
||
Screenshot of new box model legend.
Assignee | ||
Updated•10 years ago
|
Attachment #8592281 -
Flags: review?(bgrinstead)
Comment 19•10 years ago
|
||
Comment on attachment 8592281 [details] [diff] [review]
Add a legend to the Box Model tool.
Review of attachment 8592281 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good
Attachment #8592281 -
Flags: review?(bgrinstead) → review+
Comment 20•10 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/52a143ca5a1a
https://hg.mozilla.org/integration/fx-team/rev/0ceb71fdbe2f
Keywords: checkin-needed
Whiteboard: [devedition-40][difficulty=easy] → [devedition-40][difficulty=easy][fixed-in-fx-team]
Assignee | ||
Updated•10 years ago
|
Keywords: leave-open
Comment 21•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/52a143ca5a1a
https://hg.mozilla.org/mozilla-central/rev/0ceb71fdbe2f
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Whiteboard: [devedition-40][difficulty=easy][fixed-in-fx-team] → [devedition-40][difficulty=easy]
Target Milestone: --- → Firefox 40
Updated•9 years ago
|
Whiteboard: [devedition-40][difficulty=easy] → [polish-backlog][difficulty=easy]
Comment 23•8 years ago
|
||
I reproduced this issue using 47.0a1, build ID: 20160202030232, on Windows 10 x64.
I can confirm this issue is fixed, I verified using Fx 51.0b11, build ID: 20170103031119 and Fx 52.0a2, build ID: 20170105004018 and Fx53.0a1, build ID: 20170104030214, on Windows 10 x64, Mac OS X 10.11 and Ubuntu 14.04 LTS.
Cheers!
Status: RESOLVED → VERIFIED
status-firefox40:
fixed → ---
status-firefox51:
--- → verified
status-firefox52:
--- → verified
status-firefox53:
--- → verified
QA Contact: cristian.comorasu
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•