Bug 201470 - Web Inspector: unify the interaction of show/hide status icons in Sources and Canvas
Summary: Web Inspector: unify the interaction of show/hide status icons in Sources and...
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:
 
Reported: 2019-09-04 13:17 PDT by Devin Rousso
Modified: 2019-09-04 19:16 PDT (History)
5 users (show)

See Also:


Attachments
Patch (11.47 KB, patch)
2019-09-04 13:17 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (11.16 KB, patch)
2019-09-04 18:30 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 2019-09-04 13:17:06 PDT
Rather than "fading" the tree element's text when the underlying represented object is disabled/blackboxed, we should just "fade" the icon.  The "fade" shouldn't change when the tree element is selected, unless the user is hovering directly over the status eye (this helps convey the idea that clicking the status eye is like a checkbox).  The image of the status eye also shouldn't change depending on whether the underlying represented object is disabled/blackboxed, as it being visible/"faded" is already enough of an indicator.

It should also be possible to toggle the disabled/blackboxed state via the context menu.
Comment 1 Devin Rousso 2019-09-04 13:17:59 PDT
Created attachment 378006 [details]
Patch
Comment 2 Joseph Pecoraro 2019-09-04 17:16:05 PDT
Comment on attachment 378006 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Models/ShaderProgram.js:61
> +        CanvasAgent.setShaderProgramDisabled(this._identifier, disabled, (error) => {

We should set `this._disabled` immediately.

Currently if someone set the state rapidly before a response was received:

    shaderProgram.disabled = true;
    shaderProgram.disabled = false; // Wouldn't do anything.

Then the 2nd setting would potentially be missed and the frontend would leave the program in a disabled state, which would not be what we actually want.

> Source/WebInspectorUI/UserInterface/Views/ShaderProgramTreeElement.js:57
> +        super.detach();

This should be `super.ondetach()`

> Source/WebInspectorUI/UserInterface/Views/ShaderProgramTreeElement.js:63
>      canSelectOnMouseDown(event)
>      {
> -        return !this._statusElement.contains(event.target);
> +        return !this._disabledImageElement.contains(event.target);
> +    }

Given the superclass implementation is TreeElement, maybe this should call the super class if the specific case here is not true.

> Source/WebInspectorUI/UserInterface/Views/SourceCodeTreeElement.js:141
> +    populateContextMenu(contextMenu, event)
> +    {
> +        if (this._sourceCode.supportsScriptBlackboxing) {
> +            let isBlackboxed = WI.debuggerManager.isScriptBlackboxed(this._sourceCode);

Does this show up very high in the context menu or rather low?
Comment 3 Devin Rousso 2019-09-04 18:26:04 PDT
Comment on attachment 378006 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Models/ShaderProgram.js:61
>> +        CanvasAgent.setShaderProgramDisabled(this._identifier, disabled, (error) => {
> 
> We should set `this._disabled` immediately.
> 
> Currently if someone set the state rapidly before a response was received:
> 
>     shaderProgram.disabled = true;
>     shaderProgram.disabled = false; // Wouldn't do anything.
> 
> Then the 2nd setting would potentially be missed and the frontend would leave the program in a disabled state, which would not be what we actually want.

That's true.  I really wish we had a more "concrete" way of ensuring that frontend state is in sync with backend state, and only updating the frontend in response to changes from the backend (like how Timelines/Audit/Canvas all have this idea of "starting"/"stopping" when the UI has requested something and hasn't yet received confirmation from the backend).

>> Source/WebInspectorUI/UserInterface/Views/ShaderProgramTreeElement.js:57
>> +        super.detach();
> 
> This should be `super.ondetach()`

Oops.

>> Source/WebInspectorUI/UserInterface/Views/ShaderProgramTreeElement.js:63
>> +    }
> 
> Given the superclass implementation is TreeElement, maybe this should call the super class if the specific case here is not true.

Good call!

>> Source/WebInspectorUI/UserInterface/Views/SourceCodeTreeElement.js:141
>> +            let isBlackboxed = WI.debuggerManager.isScriptBlackboxed(this._sourceCode);
> 
> Does this show up very high in the context menu or rather low?

It's basically at the very bottom, right above where the "Expand All"/"Collapse All" would be.  I'll move this to `WI.appendContextMenuItemsForSourceCode` instead, right under "Create Local Override:.
Comment 4 Devin Rousso 2019-09-04 18:30:35 PDT
Created attachment 378033 [details]
Patch
Comment 5 WebKit Commit Bot 2019-09-04 19:15:55 PDT
Comment on attachment 378033 [details]
Patch

Clearing flags on attachment: 378033

Committed r249513: <https://trac.webkit.org/changeset/249513>
Comment 6 WebKit Commit Bot 2019-09-04 19:15:56 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-09-04 19:16:18 PDT
<rdar://problem/55050913>