Title: [242105] trunk/Source/WebInspectorUI
Revision
242105
Author
[email protected]
Date
2019-02-26 13:50:41 -0800 (Tue, 26 Feb 2019)

Log Message

Web Inspector: Search: no results when opening to Search tab
https://bugs.webkit.org/show_bug.cgi?id=195058
<rdar://problem/48407699>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel.prototype.performSearch):
If targets aren't available, wait until they are and then perform the search.

* UserInterface/Base/Main.js:
(WI.targetsAvailable): Added.
Expose getter for indicating whether targets are available.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (242104 => 242105)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-02-26 21:40:50 UTC (rev 242104)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-02-26 21:50:41 UTC (rev 242105)
@@ -1,3 +1,19 @@
+2019-02-26  Devin Rousso  <[email protected]>
+
+        Web Inspector: Search: no results when opening to Search tab
+        https://bugs.webkit.org/show_bug.cgi?id=195058
+        <rdar://problem/48407699>
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/SearchSidebarPanel.js:
+        (WI.SearchSidebarPanel.prototype.performSearch):
+        If targets aren't available, wait until they are and then perform the search.
+
+        * UserInterface/Base/Main.js:
+        (WI.targetsAvailable): Added.
+        Expose getter for indicating whether targets are available.
+
 2019-02-26  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: CPU Usage Timeline - Main Thread Indicator

Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Main.js (242104 => 242105)


--- trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2019-02-26 21:40:50 UTC (rev 242104)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Main.js	2019-02-26 21:50:41 UTC (rev 242105)
@@ -632,6 +632,11 @@
     }
 };
 
+WI.targetsAvailable = function()
+{
+    return this._targetsAvailablePromise.settled;
+};
+
 WI.whenTargetsAvailable = function()
 {
     return this._targetsAvailablePromise.promise;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js (242104 => 242105)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js	2019-02-26 21:40:50 UTC (rev 242104)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js	2019-02-26 21:50:41 UTC (rev 242105)
@@ -100,17 +100,29 @@
         if (!searchQuery.length)
             return;
 
+        let createSearchingPlaceholder = () => {
+            let searchingPlaceholder = WI.createMessageTextView("");
+            String.format(WI.UIString("Searching %s"), [(new WI.IndeterminateProgressSpinner).element], String.standardFormatters, searchingPlaceholder, (a, b) => {
+                a.append(b);
+                return a;
+            });
+            this.updateEmptyContentPlaceholder(searchingPlaceholder);
+        };
+
+        if (!WI.targetsAvailable()) {
+            createSearchingPlaceholder();
+            WI.whenTargetsAvailable().then(() => {
+                if (this._searchQuerySetting.value === searchQuery)
+                    this.performSearch(searchQuery);
+            });
+            return;
+        }
+
         let promiseCount = 0;
         let countPromise = async (promise, callback) => {
             ++promiseCount;
-            if (promiseCount === 1) {
-                let searchingPlaceholder = WI.createMessageTextView("");
-                String.format(WI.UIString("Searching %s"), [(new WI.IndeterminateProgressSpinner).element], String.standardFormatters, searchingPlaceholder, (a, b) => {
-                    a.append(b);
-                    return a;
-                });
-                this.updateEmptyContentPlaceholder(searchingPlaceholder);
-            }
+            if (promiseCount === 1)
+                createSearchingPlaceholder();
 
             let value = await promise;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to