Open Bug 2027618 Opened 1 month ago Updated 1 month ago

Show an indicator when a collapsed group contains errors or warnings

Categories

(DevTools :: Console, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: glob, Unassigned)

References

Details

Attachments

(1 file)

From Shadow8435 on Connect:

I like using console.group() and console.groupCollapsed() to structure my console outputs where possible to prevent clutter and to make finding things easier.

Unfortunately, a collapsed group does not indicate whether there are any Errors or Warnings inside it, making it easy to miss them.

I suggest changing the background colour of a group's header to the corresponding colour or displaying a small icon inside the group's header (or both to bring it in line with how errors/warnings are normally displayed in the console) when Warnings or Errors are present inside.

We agree this would be a nice feature. Having an indicator or some way to preview the content of a group would be nice.

There were some concerns about the feasibility of adding an icon to the header (it could be confusing when group is called with several arguments I think).

Nicolas, can you share a bit more why this proposal is challenging?

Flags: needinfo?(nchevobbe)
Priority: -- → P3
Attached image cookie warnings group

We could take some inspiration from what we're doing with warning groups, where we have a badge and the number of messages, but the issue is that for console.group[Collaspsed], we don't have a clear group label, we'll print all the parameters that are passed to the function call; and so it might be tricky to have icons at the "end" of the message, as we might have many things displayed (e.g. console.group(globalThis, document)).
If we can't put it at the end, let's have it at the beginning right? We could do like we do for console errors, have the icons before the expand toggle (▶︎). It might be tricky to have mutliple icons there and making sense of it? Like, we probably won't add the warning/error background color to the console.group message, so we might have inconsistencies in the UI.
And since we're talking about showing icons, do we need to restrict to error and warnings, why not the one we have for console.info for example? And maybe we could also show the number of messages a group has, so we do have something like warning groups in the end

Flags: needinfo?(nchevobbe)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: