From 46f3b69e0e0c66a8b3cc05af924970111e042d3b Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Tue, 5 Aug 2025 18:19:05 +0200 Subject: [PATCH] Rename Advanced Search to Global Search and app searches Summary: * Remove the term "Advanced Search". Everything is an "Advanced Search" anyway, even cross-application search at https://we.phorge.it/search/query/advanced/ calls itself "Advanced Search". * Call the Search provided by the Search application "Global Search" in the sidebar (previously called "Advanced Search" like everything) and in the breadcrumbs, so users have a chance to realize that application searches also exist. Similarly, rename the "Queries" heading in the sidebar to "Global Queries". * Rename each application search from generic "Advanced Search" (which did not allow understanding that an application search is a different Advanced Search than the Advanced Search provided by the Search application) to "$application_name Search" (prefixing the actual name of the current application) to make its scope clear. Similarly, rename "Queries" in the sidebar to "$application_name Queries". * In the Search Scope dropdown in the top bar, rename the "Search" heading to "Global Search" and rename the "Saved Queries" heading to "Global Saved Queries". Rename the "Advanced Search" item under "More Options" to "Global Search" (which may get removed in D26240). * Rename "Global Saved Queries" to "System Saved Queries" not to use "global" with two different meanings (cross-application versus not by an individual user). This confusion is not new; https://we.phorge.it/book/phorge/article/search/ already called the Search in the Search application "global search" anyway. * Update a sentence in the documentation. Closes T16168 Test Plan: * Go to http://phorge.localhost/search/query/advanced/, see "Global Search" in the sidebar and "Global Search" in breadcrumbs and title, still see "Queries" section heading in sidebar * Go to http://phorge.localhost/feed/query/advanced/ or any other application, see "Feed Search" in the sidebar and "Search" in breadcrumbs and title (to avoid ugly repetition of the application name in the breadcrumbs), see "Feed Queries" section heading in sidebar * Go to http://phorge.localhost, click the Search Scope dropdown in the top bar, see "Global Search" instead of "Advanced Search" under "More Options" (until D26240 gets merged) * Go to http://phorge.localhost, click the Search Scope dropdown in the top bar, see "Global Search" instead of ""Search" and "Saved Global Queries" instead of "Saved Queries" section headings * Go to http://phorge.localhost/diviner/, see that search button says "Diviner Search" instead of "Advanced Search" * Go to http://phorge.localhost/search/query/edit/, see that "Global Saved Queries" is called "System Saved Queries" Reviewers: O1 Blessed Committers, mainframe98 Reviewed By: O1 Blessed Committers, mainframe98 Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T16168 Differential Revision: https://we.phorge.it/D26242 --- .../base/controller/PhabricatorController.php | 3 +++ .../controller/DivinerMainController.php | 2 +- .../PhabricatorApplicationSearchController.php | 12 ++++++++++-- .../PhabricatorApplicationSearchEngine.php | 18 ++++++++++++++++-- src/docs/user/userguide/search.diviner | 2 +- .../PhabricatorPirateEnglishTranslation.php | 2 +- .../PhabricatorVeryWowEnglishTranslation.php | 2 +- .../menu/PhabricatorMainMenuSearchView.php | 6 +++--- 8 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php index 56a7bec5ed..3c6342296f 100644 --- a/src/applications/base/controller/PhabricatorController.php +++ b/src/applications/base/controller/PhabricatorController.php @@ -323,6 +323,9 @@ abstract class PhabricatorController extends AphrontController { return null; } + /** + * @return PHUICrumbsView + */ protected function buildApplicationCrumbs() { $crumbs = array(); diff --git a/src/applications/diviner/controller/DivinerMainController.php b/src/applications/diviner/controller/DivinerMainController.php index 791e7520b6..2c0032a765 100644 --- a/src/applications/diviner/controller/DivinerMainController.php +++ b/src/applications/diviner/controller/DivinerMainController.php @@ -20,7 +20,7 @@ final class DivinerMainController extends DivinerController { $query_button = id(new PHUIButtonView()) ->setTag('a') ->setHref($this->getApplicationURI('query/')) - ->setText(pht('Advanced Search')) + ->setText(pht('Diviner Search')) ->setIcon('fa-search'); $header = id(new PHUIHeaderView()) diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php index 7e96cc0c62..9127a58f6c 100644 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -211,7 +211,13 @@ final class PhabricatorApplicationSearchController if ($named_query) { $title = $named_query->getQueryName(); } else { - $title = pht('Advanced Search'); + $current_app = $this->getCurrentApplication()->getName(); + $search_app = id(new PhabricatorSearchApplication())->getName(); + if ($current_app === $search_app) { + $title = pht('Global Search'); + } else { + $title = pht('Search'); + } } $header = id(new PHUIHeaderView()) @@ -577,8 +583,10 @@ final class PhabricatorApplicationSearchController 'items' => array(), 'edit' => true, ), + // The name 'global' is a remnant of the time this group was called + // Global Saved Queries. See T16168. 'global' => array( - 'name' => pht('Global Saved Queries'), + 'name' => pht('System Saved Queries'), 'items' => array(), 'edit' => $can_global, ), diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php index 642725bd9f..7f7e45139e 100644 --- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php +++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php @@ -492,7 +492,14 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject { public function addNavigationItems(PHUIListView $menu) { $viewer = $this->requireViewer(); - $menu->newLabel(pht('Queries')); + $current_app = $this->getApplication()->getName(); + $search_app = id(new PhabricatorSearchApplication())->getName(); + + if ($current_app === $search_app) { + $menu->newLabel(pht('Global Queries')); + } else { + $menu->newLabel(pht('%s Queries', $current_app)); + } $named_queries = $this->loadEnabledNamedQueries(); @@ -509,7 +516,14 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject { $menu->newLabel(pht('Search')); $advanced_uri = $this->getQueryResultsPageURI('advanced'); - $menu->newLink(pht('Advanced Search'), $advanced_uri, 'query/advanced'); + if ($current_app === $search_app) { + $menu->newLink(pht('Global Search'), $advanced_uri, 'query/advanced'); + } else { + $menu->newLink( + pht('%s Search', $current_app), + $advanced_uri, + 'query/advanced'); + } foreach ($this->navigationItems as $extra_item) { $menu->addMenuItem($extra_item); diff --git a/src/docs/user/userguide/search.diviner b/src/docs/user/userguide/search.diviner index 008360623a..e4d2644e75 100644 --- a/src/docs/user/userguide/search.diviner +++ b/src/docs/user/userguide/search.diviner @@ -51,7 +51,7 @@ commit hash to jump to the corresponding commit. For a complete list of supported commands, see @{article:Search User Guide: Shortcuts}. After running a search, you can scroll up to add filters and refine the result -set. You can also select **Advanced Search** from the dropdown menu to jump +set. You can also select **Global Search** from the dropdown menu to jump here immediately, or press return in the search box without entering a query. This interface supports standard Phorge search and filtering features, diff --git a/src/infrastructure/internationalization/translation/PhabricatorPirateEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorPirateEnglishTranslation.php index 35b80c9483..c44bc2009d 100644 --- a/src/infrastructure/internationalization/translation/PhabricatorPirateEnglishTranslation.php +++ b/src/infrastructure/internationalization/translation/PhabricatorPirateEnglishTranslation.php @@ -13,7 +13,7 @@ final class PhabricatorPirateEnglishTranslation 'Review Code' => 'Inspect Riggins', 'Tasks and Bugs' => 'Bilge rats', 'Cancel' => 'Belay', - 'Advanced Search' => 'Scour Hard', + 'Global Search' => 'Scour Wide', 'No search results.' => 'We be finding nothin.', 'Send' => 'Aye!', 'Partial' => 'Parrtial', diff --git a/src/infrastructure/internationalization/translation/PhabricatorVeryWowEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorVeryWowEnglishTranslation.php index cbb3e3bc4a..48709962ac 100644 --- a/src/infrastructure/internationalization/translation/PhabricatorVeryWowEnglishTranslation.php +++ b/src/infrastructure/internationalization/translation/PhabricatorVeryWowEnglishTranslation.php @@ -13,7 +13,7 @@ final class PhabricatorVeryWowEnglishTranslation 'Review Code' => 'Wow! Code Review! Wow!', 'Tasks and Bugs' => 'Much Bug! Very Bad!', 'Cancel' => 'Nope!', - 'Advanced Search' => 'Much Search!', + 'Global Search' => 'All The Search!', 'No search results.' => 'No results! Wow!', 'Send' => 'Bark Bark!', 'Partial' => 'Pawtial', diff --git a/src/view/page/menu/PhabricatorMainMenuSearchView.php b/src/view/page/menu/PhabricatorMainMenuSearchView.php index 8f8d53947b..c3de30f9db 100644 --- a/src/view/page/menu/PhabricatorMainMenuSearchView.php +++ b/src/view/page/menu/PhabricatorMainMenuSearchView.php @@ -124,7 +124,7 @@ final class PhabricatorMainMenuSearchView extends AphrontView { $items = array(); $items[] = array( - 'name' => pht('Search'), + 'name' => pht('Global Search'), ); $items[] = array( @@ -147,7 +147,7 @@ final class PhabricatorMainMenuSearchView extends AphrontView { } $items[] = array( - 'name' => pht('Saved Queries'), + 'name' => pht('Saved Global Queries'), ); @@ -185,7 +185,7 @@ final class PhabricatorMainMenuSearchView extends AphrontView { $items[] = array( 'icon' => 'fa-search-plus', - 'name' => pht('Advanced Search'), + 'name' => pht('Global Search'), 'href' => '/search/query/advanced/', ); -- 2.51.2