Skip to content
Permalink
Browse files
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.


Canonical link: https://commits.webkit.org/209427@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
dcrousso committed Feb 26, 2019
1 parent 6fa9d82 commit 063bebb86ede164b36a505b954159ead162c431b
Showing 3 changed files with 41 additions and 8 deletions.
@@ -1,3 +1,19 @@
2019-02-26 Devin Rousso <drousso@apple.com>

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 <pecoraro@apple.com>

Web Inspector: CPU Usage Timeline - Main Thread Indicator
@@ -632,6 +632,11 @@ WI.initializeTarget = function(target)
}
};

WI.targetsAvailable = function()
{
return this._targetsAvailablePromise.settled;
};

WI.whenTargetsAvailable = function()
{
return this._targetsAvailablePromise.promise;
@@ -100,17 +100,29 @@ WI.SearchSidebarPanel = class SearchSidebarPanel extends WI.NavigationSidebarPan
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;

0 comments on commit 063bebb

Please sign in to comment.