<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>201539</bug_id>
          
          <creation_ts>2019-09-06 01:50:17 -0700</creation_ts>
          <short_desc>Web Inspector: Better position for Sources tab when enabling the experimental setting</short_desc>
          <delta_ts>2019-09-06 14:21:17 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Joseph Pecoraro">joepeck</assigned_to>
          <cc>hi</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>joepeck</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1568444</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2019-09-06 01:50:17 -0700</bug_when>
    <thetext>Better position for Sources tab when enabling the experimental setting

It is horrible that the new Sources tab ends up all the way at the end. Let&apos;s try to place it where the Debugger tab was.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1568446</commentid>
    <comment_count>1</comment_count>
      <attachid>378171</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2019-09-06 01:51:11 -0700</bug_when>
    <thetext>Created attachment 378171
[PATCH] Proposed Fix</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1568597</commentid>
    <comment_count>2</comment_count>
      <attachid>378171</attachid>
    <who name="Devin Rousso">hi</who>
    <bug_when>2019-09-06 11:10:09 -0700</bug_when>
    <thetext>Comment on attachment 378171
[PATCH] Proposed Fix

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

r=me

&gt; Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:348
&gt;              let newTabs = WI._openTabsSetting.value.slice();

NIT: now that &lt;https://webkit.org/b/17240&gt; added `WI.Setting.prototype.save`, we can avoid this `slice` and instead just forcibly call `WI._openTabsSetting.save()` at the end of this function, right before `InspectorFrontendHost.reopen()`.

&gt; Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:352
&gt; +                    let index = newTabs.indexOf(WI.DebuggerTabContentView.Type);

Rather than look for `WI.DebuggerTabContentVIew` specifically, perhaps we could expose `productionTabClasses` (in `WI.contentLoaded` in Main.js) and use that for ordering (which would also benefit the Layers Tab), since that already has a defined order of where the default tabs should be.

This way, if the user doesn&apos;t have the Debugger Tab open, but one of the other &quot;nearby&quot; tabs is open, we&apos;d still add the Sources Tab in the &quot;generally&quot; right place :)

&gt; Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:354
&gt; +                        newTabs.splice(index, 0, WI.SourcesTabContentView.Type);

NIT: `Array.prototype.insertAtIndex`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1568690</commentid>
    <comment_count>3</comment_count>
      <attachid>378171</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2019-09-06 14:09:18 -0700</bug_when>
    <thetext>Comment on attachment 378171
[PATCH] Proposed Fix

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

&gt;&gt; Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:352
&gt;&gt; +                    let index = newTabs.indexOf(WI.DebuggerTabContentView.Type);
&gt; 
&gt; Rather than look for `WI.DebuggerTabContentVIew` specifically, perhaps we could expose `productionTabClasses` (in `WI.contentLoaded` in Main.js) and use that for ordering (which would also benefit the Layers Tab), since that already has a defined order of where the default tabs should be.
&gt; 
&gt; This way, if the user doesn&apos;t have the Debugger Tab open, but one of the other &quot;nearby&quot; tabs is open, we&apos;d still add the Sources Tab in the &quot;generally&quot; right place :)

I&apos;m not sure how we would decide to reconcile all cases. So I&apos;ve simplified to this:
• If the Debugger tab exists, no matter where the user ordered it, use that spot
• If the Debugger tab does not exist, then the user has already shows ability to customized tabs.

In any case, this is a short term solution until we enable it by default!

&gt;&gt; Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js:354
&gt;&gt; +                        newTabs.splice(index, 0, WI.SourcesTabContentView.Type);
&gt; 
&gt; NIT: `Array.prototype.insertAtIndex`.

Nice!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1568694</commentid>
    <comment_count>4</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2019-09-06 14:20:13 -0700</bug_when>
    <thetext>https://trac.webkit.org/changeset/249592/webkit</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1568697</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-09-06 14:21:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/55127412&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>378171</attachid>
            <date>2019-09-06 01:51:11 -0700</date>
            <delta_ts>2019-09-06 14:09:18 -0700</delta_ts>
            <desc>[PATCH] Proposed Fix</desc>
            <filename>sources-tab-index.patch</filename>
            <type>text/plain</type>
            <size>2425</size>
            <attacher name="Joseph Pecoraro">joepeck</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2VMb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dGluZ3MuZXhwZXJpbWVudGFs
RW5hYmxlU291cmNlc1RhYi52YWx1ZSkgeworICAgICAgICAgICAgICAgIGxldCBleGlzdGluZ0lu
ZGV4ID0gbmV3VGFicy5pbmRleE9mKFdJLlNvdXJjZXNUYWJDb250ZW50Vmlldy5UeXBlKTsKKyAg
ICAgICAgICAgICAgICBpZiAoZXhpc3RpbmdJbmRleCA9PT0gLTEpIHsKKyAgICAgICAgICAgICAg
ICAgICAgbGV0IGluZGV4ID0gbmV3VGFicy5pbmRleE9mKFdJLkRlYnVnZ2VyVGFiQ29udGVudFZp
ZXcuVHlwZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCAhPT0gLTEpCisgICAgICAg
ICAgICAgICAgICAgICAgICBuZXdUYWJzLnNwbGljZShpbmRleCwgMCwgV0kuU291cmNlc1RhYkNv
bnRlbnRWaWV3LlR5cGUpOworICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAg
ICAgICAgICAgICBuZXdUYWJzLnB1c2goV0kuU291cmNlc1RhYkNvbnRlbnRWaWV3LlR5cGUpOyAg
ICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQogICAg
ICAgICAgICAgaWYgKCFpbml0aWFsVmFsdWVzLmdldChXSS5zZXR0aW5ncy5leHBlcmltZW50YWxF
bmFibGVMYXllcnNUYWIpICYmIHdpbmRvdy5MYXllclRyZWVBZ2VudCAmJiBXSS5zZXR0aW5ncy5l
eHBlcmltZW50YWxFbmFibGVMYXllcnNUYWIudmFsdWUpCiAgICAgICAgICAgICAgICAgbmV3VGFi
cy5wdXNoKFdJLkxheWVyc1RhYkNvbnRlbnRWaWV3LlR5cGUpOwogICAgICAgICAgICAgV0kuX29w
ZW5UYWJzU2V0dGluZy52YWx1ZSA9IG5ld1RhYnM7Cg==
</data>
<flag name="review"
          id="393825"
          type_id="1"
          status="+"
          setter="hi"
    />
          </attachment>
      

    </bug>

</bugzilla>