@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Global Search Scope: Remove "Current Application" when not searchable

Summary:
Do not offer "Current Application" in the global search scope dropdown in the top bar's search area when there is no Current Application or when the Current Application does not have any searchable document types defined.

Unconditionally exposing "Current Application" is a source of confusion:
* Currently the user has no way to find out if the Current Application has any searchable document types (for example, the Search or Legalpad applications do not). In this case, selecting "Current Application" does the same as the previous option "All Documents". But you cannot find out when that's the case so it "feels" unreliable for reasons you may not understand.
* Furthermore, the user might not even know or understand Phorge's concept of "applications" and/or which application they are in. Ideally every user understands every paradigm of a software application like Phorge; in reality nearly nobody has time for that.

Plus also remove an unused `$application_value` variable in the code.

Closes T16158

Test Plan:
* Go to http://phorge.localhost/whatever404, click the Search Scope dropdown in the top bar, get no "Current Application" option as there is no application
* Go to http://phorge.localhost/search or http://phorge.localhost/legalpad, click the Search Scope dropdown in the top bar, get no "Current Application" option as the application has no searchable documents
* Go to http://phorge.localhost/maniphest, click the Search Scope dropdown in the top bar, get "Current Application" option as there is an application and it has searchable documents

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16158

Differential Revision: https://we.phorge.it/D26175

+10 -13
+1 -1
src/docs/user/userguide/search.diviner
··· 41 41 42 42 Some pages (like the 404 page) don't belong to an application, or belong to an 43 43 application which doesn't have any searchable items. In these cases, 44 - Phorge will search all items. 44 + the **Current Application** scope is not available for selection. 45 45 46 46 To quickly **jump to an object** like a task, enter the object's ID in the 47 47 global search box and search for it. For example, you can enter `T123` or
+9 -12
src/view/page/menu/PhabricatorMainMenuSearchView.php
··· 133 133 'value' => 'all', 134 134 ); 135 135 136 - $application_value = null; 137 - $application_icon = self::DEFAULT_APPLICATION_ICON; 138 - if ($application) { 139 - $application_value = get_class($application); 140 - if ($application->getApplicationSearchDocumentTypes()) { 141 - $application_icon = $application->getIcon(); 136 + if ($application && $application->getApplicationSearchDocumentTypes()) { 137 + $application_icon = $application->getIcon(); 138 + if (!$application_icon) { 139 + $application_icon = self::DEFAULT_APPLICATION_ICON; 142 140 } 141 + $items[] = array( 142 + 'icon' => $application_icon, 143 + 'name' => pht('Current Application'), 144 + 'value' => PhabricatorSearchController::SCOPE_CURRENT_APPLICATION, 145 + ); 143 146 } 144 - 145 - $items[] = array( 146 - 'icon' => $application_icon, 147 - 'name' => pht('Current Application'), 148 - 'value' => PhabricatorSearchController::SCOPE_CURRENT_APPLICATION, 149 - ); 150 147 151 148 $items[] = array( 152 149 'name' => pht('Saved Queries'),