Bug 203719

Summary: Web Inspector: Sources: tab isn't visible after removal of Debugger Tab and Resources Tab
Product: WebKit Reporter: Devin Rousso <hi>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, hi, inspector-bugzilla-changes, simon.fraser, timothy, 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=205826
Bug Depends on: 202341    
Bug Blocks:    
Attachments:
Description Flags
Patch none

Description Devin Rousso 2019-10-31 20:51:00 PDT
If you'd never previously opened the Sources Tab, but had already used Web Inspector, it won't appear after the Resources/Debugger Tabs were removed.
Comment 1 Devin Rousso 2019-10-31 20:51:19 PDT
<rdar://problem/56802389>
Comment 2 Devin Rousso 2019-10-31 20:52:48 PDT
Created attachment 382545 [details]
Patch
Comment 3 WebKit Commit Bot 2019-11-01 09:19:21 PDT
Comment on attachment 382545 [details]
Patch

Clearing flags on attachment: 382545

Committed r251922: <https://trac.webkit.org/changeset/251922>
Comment 4 WebKit Commit Bot 2019-11-01 09:19:23 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 BJ Burg 2019-11-01 11:41:57 PDT
Comment on attachment 382545 [details]
Patch

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

r=me

> Source/WebInspectorUI/UserInterface/Base/Main.js:154
> +    // Replace the Debugger/Resources Tab with the Sources Tab.

Please extract this into a separate function. Maybe even a separate file like MigrationUtilities.js. When we decide this code is no longer worth the trouble (say, Catalina + 1, or based on telemetry showing its use has diminished) then we can easily remove it.

> Source/WebInspectorUI/UserInterface/Base/Main.js:155
> +    let debuggerIndex = WI._openTabsSetting.value.indexOf("debugger");

It seems weird we have a symbolic name for "debugger" or "resources" tab?
Comment 6 Devin Rousso 2019-11-01 13:54:25 PDT
Comment on attachment 382545 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Base/Main.js:154
>> +    // Replace the Debugger/Resources Tab with the Sources Tab.
> 
> Please extract this into a separate function. Maybe even a separate file like MigrationUtilities.js. When we decide this code is no longer worth the trouble (say, Catalina + 1, or based on telemetry showing its use has diminished) then we can easily remove it.

This already landed in r251922 😅

>> Source/WebInspectorUI/UserInterface/Base/Main.js:155
>> +    let debuggerIndex = WI._openTabsSetting.value.indexOf("debugger");
> 
> It seems weird we have a symbolic name for "debugger" or "resources" tab?

This was the value of `WI.DebuggerTabContentView.Type` and `WI.ResourcesTabContentView.Type`.  It's the identifier we used for saving/restoring.