Bug 142520 - Web Inspector: Inline Error / Warning message for Issues
Summary: Web Inspector: Inline Error / Warning message for Issues
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: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-03-09 19:19 PDT by Joseph Pecoraro
Modified: 2015-03-09 20:02 PDT (History)
7 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (28.71 KB, patch)
2015-03-09 19:33 PDT, Joseph Pecoraro
timothy: review+
Details | Formatted Diff | Diff
[IMAGE] Pre-Pretty-Printing (175.58 KB, image/png)
2015-03-09 19:34 PDT, Joseph Pecoraro
no flags Details
[IMAGE] Post-Pretty-Printing (213.33 KB, image/png)
2015-03-09 19:34 PDT, Joseph Pecoraro
no flags Details
[IMAGE] Expanded Errors/Warnings (214.88 KB, image/png)
2015-03-09 19:35 PDT, Joseph Pecoraro
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-03-09 19:19:21 PDT
* SUMMARY
Inline Error / Warning message for Issues.

Currently we highlight lines red/yellow for errors/warnings but we should show the warning itself inline.

Likewise, they should work with pretty printing, since right now issues don't!
Comment 1 Joseph Pecoraro 2015-03-09 19:20:32 PDT
<rdar://problem/19525240>
Comment 2 Joseph Pecoraro 2015-03-09 19:33:46 PDT
Created attachment 248309 [details]
[PATCH] Proposed Fix
Comment 3 Joseph Pecoraro 2015-03-09 19:34:29 PDT
Created attachment 248310 [details]
[IMAGE] Pre-Pretty-Printing
Comment 4 Joseph Pecoraro 2015-03-09 19:34:44 PDT
Created attachment 248311 [details]
[IMAGE] Post-Pretty-Printing
Comment 5 Joseph Pecoraro 2015-03-09 19:35:42 PDT
Created attachment 248312 [details]
[IMAGE] Expanded Errors/Warnings

Note: Only truncated issues, or lines with multiple issues, are expandable. This cuts down on the awkwardness. Maybe we would want to do this when issues overlap content, but I didn't go that far. The developer can just resize.
Comment 6 Timothy Hatcher 2015-03-09 19:45:50 PDT
Comment on attachment 248309 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Models/LineWidget.js:26
> +WebInspector.LineWidget = function(codeMirrorLineWidget, widgetElement)

SourceCodeLineWidget? Something about the short class name makes me think it needs to be longer.

> Source/WebInspectorUI/UserInterface/Models/LineWidget.js:42
> +    get codeMirrorLineWidget()

Makes me wonder if this class should have CodeMirror in the class name. But we don't use CodeMirror in this file so hmm...

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.css:75
> +    padding-right: calc(9px + 3px);

Just flatten to 12px?

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:811
> +        // FIXME: Issue should have a SourceCodeLocation.

Yep!

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:899
> +                        errorsCount++;

Prefix ++.

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:901
> +                        warningsCount++;

Ditto.

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:1217
> +        for (var [lineNumber, widget] of this._widgetMap)

Maybe use .values() or [, widget]?

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTextEditor.js:1230
> +        for (var i = 0; i < issues.length; ++i) {
> +            var issue = issues[i];

for (..of..)
Comment 7 Joseph Pecoraro 2015-03-09 19:55:28 PDT
(In reply to comment #6)
> Comment on attachment 248309 [details]
> [PATCH] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=248309&action=review
> 
> > Source/WebInspectorUI/UserInterface/Models/LineWidget.js:26
> > +WebInspector.LineWidget = function(codeMirrorLineWidget, widgetElement)
> 
> SourceCodeLineWidget? Something about the short class name makes me think it
> needs to be longer.
> 
> > Source/WebInspectorUI/UserInterface/Models/LineWidget.js:42
> > +    get codeMirrorLineWidget()
> 
> Makes me wonder if this class should have CodeMirror in the class name. But
> we don't use CodeMirror in this file so hmm...

Hmm, yeah. This is mostly modeled after Models/TextMarker.js. Both should move to CodeMirror names eventually. For now I'll leave as is because it is nice that they are simple.
Comment 8 Joseph Pecoraro 2015-03-09 20:02:00 PDT
<http://trac.webkit.org/changeset/181306>