Bug 140385 - Web Inspector: Make message selection in the console more readable
Summary: Web Inspector: Make message selection in the console more readable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nikita Vasilyev
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-01-13 01:33 PST by Nikita Vasilyev
Modified: 2015-01-16 18:26 PST (History)
8 users (show)

See Also:


Attachments
[VIDEO] highlighting concept. (1.52 MB, video/quicktime)
2015-01-13 16:13 PST, Jonathan Wells
no flags Details
Patch (2.62 KB, patch)
2015-01-13 19:24 PST, Nikita Vasilyev
no flags Details | Formatted Diff | Diff
Animated GIF with the patch applied (846.38 KB, image/gif)
2015-01-13 19:25 PST, Nikita Vasilyev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2015-01-13 01:33:19 PST
Problem description and proposed solutions: http://trac.webkit.org/wiki/InspectorConsoleSelection

(Since Bugzilla can’t display images inline, I used a wiki instead)
Comment 1 Radar WebKit Bug Importer 2015-01-13 01:34:26 PST
<rdar://problem/19454992>
Comment 2 Jonathan Wells 2015-01-13 16:07:57 PST
I like proposed solution 2. 

You could also have a lighter highlight behind the full text, as if to indicate that cmd-c will copy the text. Then if the user selects a subset of the full text, only that text has that lighter color highlight behind it. If the user deselects that text, say by single clicking within the same error, the highlight expands back to the full text. 

The sidebar highlight (darker) remains the same the whole time.
Comment 3 Jonathan Wells 2015-01-13 16:13:31 PST
Created attachment 244561 [details]
[VIDEO] highlighting concept.

[VIDEO] highlighting concept.

Here is a video with something along the lines of what I'm suggesting.
Comment 4 Timothy Hatcher 2015-01-13 16:25:29 PST
I like that.
Comment 5 Nikita Vasilyev 2015-01-13 18:26:53 PST
Jonathan, I agree on the highlight behind the full text.

If we ever decide to color code different messages types using background color (e.g. slightly yellow for console.warm) it would compete with the selection message background, but until when it’s fine.
Comment 6 Nikita Vasilyev 2015-01-13 19:24:39 PST
Created attachment 244570 [details]
Patch
Comment 7 Nikita Vasilyev 2015-01-13 19:25:46 PST
Created attachment 244571 [details]
Animated GIF with the patch applied
Comment 8 Nikita Vasilyev 2015-01-13 19:29:59 PST
Tim and I liked the solution 1 a little bit more so I went with that approach. Although, I added a slight background and source link highlight.
Comment 9 Nikita Vasilyev 2015-01-13 19:31:39 PST
(In reply to comment #2)
> You could also have a lighter highlight behind the full text, as if to
> indicate that cmd-c will copy the text. Then if the user selects a subset of
> the full text, only that text has that lighter color highlight behind it. If
> the user deselects that text, say by single clicking within the same error,
> the highlight expands back to the full text. 
> 
> The sidebar highlight (darker) remains the same the whole time.

This sounds like a good idea. It requires changes in JS and I’d prefer doing it as a separate patch.
Comment 10 Timothy Hatcher 2015-01-14 00:07:09 PST
Comment on attachment 244570 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=244570&action=review

> Source/WebInspectorUI/UserInterface/Views/LogContentView.css:70
> +    background: hsl(0, 0%, 60%);

Maybe we should use hsl more for gray colors elsewhere.

> Source/WebInspectorUI/UserInterface/Views/LogContentView.css:75
> +    background: hsl(210, 100%, 49%);

Why not 50%?
Comment 11 Timothy Hatcher 2015-01-14 10:15:21 PST
Comment on attachment 244570 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=244570&action=review

>> Source/WebInspectorUI/UserInterface/Views/LogContentView.css:70
>> +    background: hsl(0, 0%, 60%);
> 
> Maybe we should use hsl more for gray colors elsewhere.

Or more colors in general, not just gray.
Comment 12 Timothy Hatcher 2015-01-14 10:17:03 PST
(In reply to comment #9)
> (In reply to comment #2)
> > You could also have a lighter highlight behind the full text, as if to
> > indicate that cmd-c will copy the text. Then if the user selects a subset of
> > the full text, only that text has that lighter color highlight behind it. If
> > the user deselects that text, say by single clicking within the same error,
> > the highlight expands back to the full text. 
> > 
> > The sidebar highlight (darker) remains the same the whole time.
> 
> This sounds like a good idea. It requires changes in JS and I’d prefer doing
> it as a separate patch.

We already hide the background selection color if you make a text selection. I think the only change would be to keep the dark sidebar color.
Comment 13 Nikita Vasilyev 2015-01-14 17:27:36 PST
(In reply to comment #10)
> Comment on attachment 244570 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=244570&action=review
> 
> > Source/WebInspectorUI/UserInterface/Views/LogContentView.css:70
> > +    background: hsl(0, 0%, 60%);
> 
> Maybe we should use hsl more for gray colors elsewhere.
> 
> > Source/WebInspectorUI/UserInterface/Views/LogContentView.css:75
> > +    background: hsl(210, 100%, 49%);
> 
> Why not 50%?

I used the exact same color as in DOM tree selection but converted it from RGB to HSL:

    .dom-tree-outline:focus li.selected .selection {
        background-color: rgb(0, 128, 252);
    }
Comment 14 Nikita Vasilyev 2015-01-14 17:37:46 PST
(In reply to comment #12)
> (In reply to comment #9)
> > (In reply to comment #2)
> > > You could also have a lighter highlight behind the full text, as if to
> > > indicate that cmd-c will copy the text. Then if the user selects a subset of
> > > the full text, only that text has that lighter color highlight behind it. If
> > > the user deselects that text, say by single clicking within the same error,
> > > the highlight expands back to the full text. 
> > > 
> > > The sidebar highlight (darker) remains the same the whole time.
> > 
> > This sounds like a good idea. It requires changes in JS and I’d prefer doing
> > it as a separate patch.
> 
> We already hide the background selection color if you make a text selection.
> I think the only change would be to keep the dark sidebar color.

Yes. Currently, when we select a portion of a console message, CSS class that is responsible for the border gets removed. So we need two different CSS classes. One for dark blue sidebar and another one for selected console message background.
Comment 15 WebKit Commit Bot 2015-01-16 18:26:27 PST
Comment on attachment 244570 [details]
Patch

Clearing flags on attachment: 244570

Committed r178620: <http://trac.webkit.org/changeset/178620>
Comment 16 WebKit Commit Bot 2015-01-16 18:26:31 PST
All reviewed patches have been landed.  Closing bug.