Bug 191659

Summary: Web Inspector: Audit: automatically add to tab bar when the experimental setting is enabled
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, hi, inspector-bugzilla-changes, joepeck, mattbaker, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=183420
Bug Depends on: 190754    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

Description Devin Rousso 2018-11-14 14:53:03 PST
Having to enable the experimental setting, reload WebInspector, and then right-click the tab bar to access the new tab is unnecessary.  It should automatically be added when enabling the setting.
Comment 1 Devin Rousso 2018-11-14 15:05:21 PST
Created attachment 354856 [details]
Patch
Comment 2 Matt Baker 2018-11-25 13:32:12 PST
Comment on attachment 354856 [details]
Patch

Does this need to be rebased? it doesn't apply locally for me, and doesn't match trunk: https://trac.webkit.org/browser/webkit/trunk/Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js

That aside, I like the idea of automatically adding tabs when enabling the corresponding experimental setting. i wonder about the following case though:

- User enables the Layers Tab (for example)
- Layers tab is automatically added
- User hides Layers tab, leaving the setting enabled
- Reload Web Inspector

=> Layers tab will be added again

Ideally we would want to honor the user's decision to hide the tab. Maybe this isn't an issue, since these are experimental features.
Comment 3 Devin Rousso 2018-11-25 14:48:30 PST
(In reply to Matt Baker from comment #2)
> That aside, I like the idea of automatically adding tabs when enabling the corresponding experimental setting. i wonder about the following case though:
> 
> - User enables the Layers Tab (for example)
> - Layers tab is automatically added
> - User hides Layers tab, leaving the setting enabled
> - Reload Web Inspector
> 
> => Layers tab will be added again
> 
> Ideally we would want to honor the user's decision to hide the tab. Maybe
> this isn't an issue, since these are experimental features.
The tab would be hidden, as `WI.AuditTabContentView.isTabAllowed` only returns true if the experimental setting is enabled (the same is true for the layers tab as well).
Comment 4 Devin Rousso 2018-11-25 14:49:42 PST
Created attachment 355606 [details]
Patch

Rebase
Comment 5 Joseph Pecoraro 2018-11-26 09:12:56 PST
Comment on attachment 355606 [details]
Patch

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

r=me

> Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:267
> +            let newTabs = WI._openTabsSetting.value.slice();

Maybe move this to WI.settings, or public? It’s default value though uses a bunch of other classes.
Comment 6 Devin Rousso 2018-11-26 10:16:11 PST
Comment on attachment 355606 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:267
>> +            let newTabs = WI._openTabsSetting.value.slice();
> 
> Maybe move this to WI.settings, or public? It’s default value though uses a bunch of other classes.

Frankly, this is a bit of a "hack", so I'm not as concerned with the idea of public/private, not to mention the fact that if/when these are made non-experimental, the code here will disappear.
Comment 7 WebKit Commit Bot 2018-11-26 10:21:03 PST
Comment on attachment 355606 [details]
Patch

Clearing flags on attachment: 355606

Committed r238500: <https://trac.webkit.org/changeset/238500>
Comment 8 WebKit Commit Bot 2018-11-26 10:21:04 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2018-11-26 10:22:34 PST
<rdar://problem/46248193>