Bug 183650 - Web Inspector: Canvas tab: create icons for recordings/shaders in the preview tile
Summary: Web Inspector: Canvas tab: create icons for recordings/shaders in the preview...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks: WebInspectorCanvasTab
  Show dependency treegraph
 
Reported: 2018-03-14 17:29 PDT by Devin Rousso
Modified: 2018-08-20 16:50 PDT (History)
7 users (show)

See Also:


Attachments
Patch (50.55 KB, patch)
2018-03-14 21:37 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
[Image] After Patch is applied (176.37 KB, image/png)
2018-03-14 21:37 PDT, Devin Rousso
no flags Details
Archive of layout-test-results from ews101 for mac-sierra (2.37 MB, application/zip)
2018-03-14 22:41 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews104 for mac-sierra-wk2 (2.87 MB, application/zip)
2018-03-14 22:48 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews115 for mac-sierra (3.05 MB, application/zip)
2018-03-14 23:07 PDT, EWS Watchlist
no flags Details
Patch (57.71 KB, patch)
2018-03-14 23:28 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews104 for mac-sierra-wk2 (2.62 MB, application/zip)
2018-03-15 00:36 PDT, EWS Watchlist
no flags Details
Patch (13.50 KB, patch)
2018-03-15 11:23 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (13.60 KB, patch)
2018-08-02 01:02 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (15.70 KB, patch)
2018-08-15 17:14 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2018-03-14 17:29:28 PDT
Instead of having a "View Recordings..." dropdown, we should just have two icons (one each for recordings and shaders) adopt a similar approach to path components (if there is only one, select it on click, otherwise show a dropdown).  This way, all related "resources" to the canvas are easily accessible from the Overview.
Comment 1 Devin Rousso 2018-03-14 21:37:11 PDT
Created attachment 335830 [details]
Patch
Comment 2 Devin Rousso 2018-03-14 21:37:27 PDT
Created attachment 335831 [details]
[Image] After Patch is applied
Comment 3 EWS Watchlist 2018-03-14 22:41:21 PDT Comment hidden (obsolete)
Comment 4 EWS Watchlist 2018-03-14 22:41:22 PDT Comment hidden (obsolete)
Comment 5 EWS Watchlist 2018-03-14 22:48:10 PDT Comment hidden (obsolete)
Comment 6 EWS Watchlist 2018-03-14 22:48:11 PDT Comment hidden (obsolete)
Comment 7 EWS Watchlist 2018-03-14 23:06:58 PDT Comment hidden (obsolete)
Comment 8 EWS Watchlist 2018-03-14 23:07:00 PDT Comment hidden (obsolete)
Comment 9 Devin Rousso 2018-03-14 23:28:53 PDT
Created attachment 335836 [details]
Patch

Oops.  Forgot some other inspector tests.
Comment 10 EWS Watchlist 2018-03-15 00:36:15 PDT Comment hidden (obsolete)
Comment 11 EWS Watchlist 2018-03-15 00:36:16 PDT Comment hidden (obsolete)
Comment 12 Devin Rousso 2018-03-15 11:23:21 PDT
Created attachment 335865 [details]
Patch

Splitting the changes to WI.Collection into a separate patch because of EWS failures
Comment 13 Joseph Pecoraro 2018-07-30 15:56:48 PDT
Comment on attachment 335865 [details]
Patch

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

I think this is a good idea. Often it can be useful to just see which context has shaders to know which is likely to be the important context.

r- just so that we can see an updated patch. Otherwise, this is an r+ able patch.

> Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:1035
> -localizedStrings["View Recordings... (%d)"] = "View Recordings... (%d)";
> +localizedStrings["View Recording"] = "View Recording";
> +localizedStrings["View Shader"] = "View Shader";

Hmm, what if the UI looked like this:

    Shaders, No Recordings:
    [@]

    Shaders, 1 Recording:
    [@] o_o (1)

    Shaders, 2 Recordings:
    [@] o_o (2)

I think the (#) gives extra information that wasn't available but might be useful to the user... "oh this is the one I took multiple recordings on". However if we think most users will only ever do a single recording then it probably won't 

Having a button to quickly get to the shaders seems nice. Seems like a good way to make use of an extra 20px that would otherwise not be used =)

> Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js:276
> +        let {canvas} = event.data;

Heh. I just ran some tests, and the perf of this is (as it should be) identical to the direct access.

    let {canvas} = event.data;
    let canvas = event.data.canvas;

Seems like an interesting pattern that is a few less characters =)

> Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js:419
> +    _updateViewRelated()

I feel like this name needs another word. Maybe:

    _updateViewRelatedItems()

> Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js:440
> +        if (shaderPrograms.length === 1) {
> +            WI.showRepresentedObject(shaderPrograms[0]);
> +            return;
> +        }

I'd have to experience a picker. Is it worth having a picker or just getting the user to the UI and then letting them select the shader?

> Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js:463
> +        if (recordings.length === 1) {
> +            WI.showRepresentedObject(recordings[0]);
> +            return;
> +        }

Likewise. Just clicking the entire canvas gets the user into this. Is it worth having them select the recording here, or from the normal UI?

I see these icons more as indicators than useful for actions.
Comment 14 Devin Rousso 2018-07-30 16:37:48 PDT
Comment on attachment 335865 [details]
Patch

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

>> Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js:1035
>> +localizedStrings["View Shader"] = "View Shader";
> 
> Hmm, what if the UI looked like this:
> 
>     Shaders, No Recordings:
>     [@]
> 
>     Shaders, 1 Recording:
>     [@] o_o (1)
> 
>     Shaders, 2 Recordings:
>     [@] o_o (2)
> 
> I think the (#) gives extra information that wasn't available but might be useful to the user... "oh this is the one I took multiple recordings on". However if we think most users will only ever do a single recording then it probably won't 
> 
> Having a button to quickly get to the shaders seems nice. Seems like a good way to make use of an extra 20px that would otherwise not be used =)

My only hesitance to (#) is that it might be confusing as to which it relates to.  I'd see a (#) and think "thats the total number of 'associated' things to this canvas (recordings + shaders)".  Also, I don't think many WebGL canvases will have more than one or two shaders, so it's probably pretty rare.

As a side note, I laughed at "o_o" 😛

>> Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js:440
>> +        }
> 
> I'd have to experience a picker. Is it worth having a picker or just getting the user to the UI and then letting them select the shader?

I think that any time we can eliminate an action by the user, it's a good idea.  This follows the same pattern as path components, and I think we should do it.  Also, see my above comment about the number of shaders.

>> Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js:463
>> +        }
> 
> Likewise. Just clicking the entire canvas gets the user into this. Is it worth having them select the recording here, or from the normal UI?
> 
> I see these icons more as indicators than useful for actions.

This actually shouldn't be the case.  Recording's shouldn't be automatically selected when viewing a canvas unless the recording has just finished being captured.
Comment 15 Matt Baker 2018-07-30 16:46:49 PDT
Comment on attachment 335865 [details]
Patch

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

>>> Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js:463
>>> +        }
>> 
>> Likewise. Just clicking the entire canvas gets the user into this. Is it worth having them select the recording here, or from the normal UI?
>> 
>> I see these icons more as indicators than useful for actions.
> 
> This actually shouldn't be the case.  Recording's shouldn't be automatically selected when viewing a canvas unless the recording has just finished being captured.

Are you referring to when we automatically show a recording once it completes? (which IIR is for any recording not started from the console). Clicking a canvas from the Overview should always show the same view, correct?
Comment 16 Devin Rousso 2018-07-30 16:52:14 PDT
Comment on attachment 335865 [details]
Patch

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

>>>> Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js:463
>>>> +        }
>>> 
>>> Likewise. Just clicking the entire canvas gets the user into this. Is it worth having them select the recording here, or from the normal UI?
>>> 
>>> I see these icons more as indicators than useful for actions.
>> 
>> This actually shouldn't be the case.  Recording's shouldn't be automatically selected when viewing a canvas unless the recording has just finished being captured.
> 
> Are you referring to when we automatically show a recording once it completes? (which IIR is for any recording not started from the console). Clicking a canvas from the Overview should always show the same view, correct?

Yes.  Clicking on a canvas in the overview should just show a `WI.CanvasContentView` (no recording selected) for that canvas.  When a non-console recording finishes, a `WI.RecordingContentView` should be shown with similar sidebars as `WI.CanvasContentView` (any shaders are shown), except with recording specific data (e.g. actions list, other details sidebars, etc).
Comment 17 Devin Rousso 2018-08-02 01:02:32 PDT
Created attachment 346364 [details]
Patch

This patch is mainly a rebase with a few style changes.  My build is currently broken, so I was unable to test it.  :/
Comment 18 Devin Rousso 2018-08-15 17:14:04 PDT
Created attachment 347227 [details]
Patch

Fixed a few bugs
Comment 19 Joseph Pecoraro 2018-08-20 12:07:08 PDT
Comment on attachment 347227 [details]
Patch

r=me
Comment 20 WebKit Commit Bot 2018-08-20 13:30:57 PDT
Comment on attachment 347227 [details]
Patch

Clearing flags on attachment: 347227

Committed r235093: <https://trac.webkit.org/changeset/235093>
Comment 21 WebKit Commit Bot 2018-08-20 13:30:59 PDT
All reviewed patches have been landed.  Closing bug.
Comment 22 Radar WebKit Bug Importer 2018-08-20 16:50:52 PDT
<rdar://problem/43534413>