firefox-devtools / ux

Firefox DevTools UX Community
Mozilla Public License 2.0
103 stars 21 forks source link

Show console error count in toolbox #58

Closed digitarald closed 5 years ago

digitarald commented 5 years ago

Console errors are a guiding beacon for web developers, during development and in production (collected via error reporting services). Making them visible in top-level UI can hint important.

Work started in bug 1109362.

cc @nchevobbe @janodvarko @fvsch @violasong

Background

We have a lot of prior art, so we should pick the best fit and improve based on that.

Considerations:

Prior Art

Observations & Opinions.

Chrome

image

Firefox's GCLI

image

Safari

image

Edge

image

Firebug

image
digitarald commented 5 years ago

Victoria's mockups from the discussion in bug 1109362.

Iteration 1:

image

I'd suggest making it more compact by just showing the number with red coloring. I gave the solid red badge a try but it looked way too intense. What about just red text/slightly smaller font/some text separator like a colon?

Iteration 2:

image

Brighter red may look nicer, and not need a separator

digitarald commented 5 years ago

In the spirit of kicking it off, the Chrome placement has some benefits:

janodvarko commented 5 years ago

Yes, I like the placement of the number on the right side.

It would be also great to have an (error) icon next to the number, so it's clear what the number represents. Or perhaps we could experiment with the solid red badge again (with the number inside)? Having it far right doesn't have to feel too intense (as when it's between tabs).

Honza

fvsch commented 5 years ago

Error count in Console tab

I like the simple red count (Iteration 2). Here's a test with a solid red badge look (done in CSS on Linux, exact rendering depends on font and resolution):

Screen Shot

Looks alright-ish, maybe a bit too strong indeed.

Should consider the transition from no errors to 1 error; minimizing visual jitter

In that scenario, I wouldn't reserve a ~20px blank space in the Console tab in the "no error" state, it looks rather strange. So we would have to live with a jump between the "no error" and the "some error(s)" state. But we can avoid jumps between different error counts (between 1 and Infinity).

Error count on right side of toolbar

If the error count is disabled, I wonder if we should add some kind of marker in the Console tab. There's the notification marker in Firefox tabs, perhaps a red variant could work?

screenshot of firefox tab
digitarald commented 5 years ago

Here's a test with a solid red badge look (done in CSS on Linux, exact rendering depends on font and resolution):

That also looks good, from a styling perspective (not considering the tab vs right-aligned decision). If we feel we need to tone it down, we can still pick a less vibrant red

Not a fan of opening the split console on click, mostly because I'm not a fan of using the split console along tools like the Inspector (which is already very visually busy!) and only use it with the Debugger.

The trade off is a hefty context switch from the current tool to a new panel. As example, if a user is the process of editing CSS or stepping, see an error appearing, clicking – they will be ejected out of their flow into a new panel. My hypothesis would be that split console is less jarring. Lastly the consistent UX argument is that Chrome does it and users would be surprised if our interaction diverges – which raises the bar for picking another action.

Maybe follow up can be making the split console logic better on how much space it takes when opening (I noticed it can cause some strange layouts by squishing some parts of 3-panel layouts.

Can we make it more compact when docked to the side? Just an error count and no warning count maybe? No icons?

Agreed, good thing to try out. Having a red badge with error count works as well as the error-icon + counter, with half the space. We also have prior art with addon icon badge counters

image

Can we make it optional (on by default), like most other elements in the toolbar?

Given that all browsers show their indicator by default, I would also propose that. Having a preference to disable the element makes sense though.

violasong commented 5 years ago

The badge with darker red still seems pretty intense/alarming to me. If we're ok adding a small icon, in outline mode, it looks pretty good I think. I was assuming we won't be adding an indicator for console warnings, only error.

image

Not sure about the split console question.

digitarald commented 5 years ago

If we're ok adding a small icon, in outline mode, it looks pretty good I think.

How would it look filled? Would the text in red might be easier to read in black? Then it basically looks like Chrome I guess, just with our icon 😅

I was assuming we won't be adding an indicator for console warnings, only error.

Yes, for now. Could we try out how it looks for brainstorming?

violasong commented 5 years ago

Oh argh, it's looking brighter in my screenshots than in my sketch for some reason. I meant for it to look more like this:

image

Here's how chrome style looks.

image
digitarald commented 5 years ago

@violasong what's your preference? I am fine with either but prefer the second one as it provides better contrast and we don't have other devtools interfaces with red text and outlined icons.

Final thoughts, @janodvarko @nchevobbe ?

violasong commented 5 years ago

The first one plays off the (?) icons, but I can see what you mean about the red outline being weird.

I worked on the second one some more - shrinked the icon and number so it's a little less prominent. I'm liking this a lot more now and am happy to go with it.

image
violasong commented 5 years ago

Attached the icon — it's a smaller version of the photon one, 10x10, with slightly larger exclamation mark. Should be filled with red 60. error-small-compressed.svg.zip

janodvarko commented 5 years ago

So, for me this looks great, thanks!

Honza

fvsch commented 5 years ago

@violasong Would 12px icons work here or is that too big and 10px is preferable?

12px icons follow the recommended "small" size from Photon and that's what we use in the Console. If we want a full (Chrome-style) alert icon we already have one for Console errors.

Here it is (bottom center) compared to the 10px icon (bottom right) and Console icons (top row):

Error   Warning@2x

SVG: Error count icons.zip

Side note: it seems you set your 10px icon in a 11px artboard and with the center stroke sitting on half-pixels? Was that on purpose because it rendered better in your tests, or an export artifact maybe? In my tests that version looks good @2x, but the center shape has blurry edges @1x: 11px-error-icon-rasterization

In the attached SVG I've realigned it to a 10px canvas, but maybe that's not particularly better.

hemakshis commented 5 years ago

Hi, What about the tooltip text that should be displayed when the user hovers over the icon? Should we add something like " errors" (done by Chrome) or "Open Split Console" or "Show in Split Console"?

violasong commented 5 years ago

Ah, the .5 pixels on 11px artboard thing was a mistake! Thanks for fixing it.

For me the 10px level of prominence with larger white text helps reduce the alarm/discomfort of seeing a red error dot. I'm assuming people often want to ignore it if they're working in the Inspector, etc.

@digitarald Why thumbs-down?

digitarald commented 5 years ago

@digitarald Why thumbs-down?

Oh noes, I meant (double, triple) thumbs up! The smaller icon is excellent.

If this is wrapped up, I'd like to close this issue as implementation work has started. We can re-open it in case of follow up questions.

violasong commented 5 years ago

Haha Yay! Will close the issue.

MichalBryxi commented 4 years ago

implementation work has started

Can you link a PR / issue / something where we can see the progress?

nchevobbe commented 4 years ago

implementation work has started

Can you link a PR / issue / something where we can see the progress?

Work was happening in https://bugzilla.mozilla.org/show_bug.cgi?id=1109362

digitarald commented 4 years ago

If people want to help contribute, bug 1109362 is a intermedia-first-bug with a first draft of a patch.