@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.

Remove "Search Preferences"

Summary:
Ref T4103. This removes these options:

{F1660585}

The jump nav option came from T916, when we had a separate jump nav on the home page. Essentially no one has ever been confused by the behavior of search or disabled this feature. Here are the stats for this install:

| Total Users | 36656 |
| Have Set Any Preference | 3084 |
| Have Disabled Jump | 6
| Are Not "Security Researchers" | 2
| Any Account Activity | 0

The "/" option came in the same change, but the preference came from T989. This keystroke conflicts with a default Firefox keystroke. Almost no one cares about this either, but I count 6 real users who have disabled the behavior. I suspect the number of real users who //use// it may be smaller.

In Safari and Firefox, the "tab" key does the same thing.

In Chrome, the "tab" key does the same thing if {nav Preferences > Web Content > "Pressing Tab highlights..."} is disabled.

Upshot: jump nav is great, bulk of the change in T989 was clearly great, specific preferences that came out of it seem not-so-great and now is a good time to kill them as we head into T4103.

Test Plan:
- Grepped for removed constants.
- Pressed "/".
- Searched for `T123`.
- Viewed settings.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4103

Differential Revision: https://secure.phabricator.com/D15976

+15 -99
+10 -10
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => '8aeacc63', 11 - 'core.pkg.js' => '50e9228e', 11 + 'core.pkg.js' => '3f15fa62', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '33da0633', 14 14 'differential.pkg.js' => '4b7d8f19', ··· 490 490 'rsrc/js/core/behavior-history-install.js' => '7ee2b591', 491 491 'rsrc/js/core/behavior-hovercard.js' => 'bcaccd64', 492 492 'rsrc/js/core/behavior-keyboard-pager.js' => 'a8da01f0', 493 - 'rsrc/js/core/behavior-keyboard-shortcuts.js' => 'd75709e6', 493 + 'rsrc/js/core/behavior-keyboard-shortcuts.js' => '7835f8c9', 494 494 'rsrc/js/core/behavior-lightbox-attachments.js' => 'f8ba29d7', 495 495 'rsrc/js/core/behavior-line-linker.js' => '1499a8cb', 496 496 'rsrc/js/core/behavior-more.js' => 'a80d0378', ··· 651 651 'javelin-behavior-phabricator-gesture' => '3ab51e2c', 652 652 'javelin-behavior-phabricator-gesture-example' => '558829c2', 653 653 'javelin-behavior-phabricator-keyboard-pager' => 'a8da01f0', 654 - 'javelin-behavior-phabricator-keyboard-shortcuts' => 'd75709e6', 654 + 'javelin-behavior-phabricator-keyboard-shortcuts' => '7835f8c9', 655 655 'javelin-behavior-phabricator-line-linker' => '1499a8cb', 656 656 'javelin-behavior-phabricator-nav' => '56a1ca03', 657 657 'javelin-behavior-phabricator-notification-example' => '8ce821c5', ··· 1492 1492 'multirow-row-manager', 1493 1493 'javelin-json', 1494 1494 ), 1495 + '7835f8c9' => array( 1496 + 'javelin-behavior', 1497 + 'javelin-workflow', 1498 + 'javelin-json', 1499 + 'javelin-dom', 1500 + 'phabricator-keyboard-shortcut', 1501 + ), 1495 1502 '7927a7d3' => array( 1496 1503 'javelin-behavior', 1497 1504 'javelin-quicksand', ··· 1972 1979 'javelin-stratcom', 1973 1980 'javelin-json', 1974 1981 'phabricator-prefab', 1975 - ), 1976 - 'd75709e6' => array( 1977 - 'javelin-behavior', 1978 - 'javelin-workflow', 1979 - 'javelin-json', 1980 - 'javelin-dom', 1981 - 'phabricator-keyboard-shortcut', 1982 1982 ), 1983 1983 'd7a74243' => array( 1984 1984 'javelin-behavior',
-2
src/__phutil_library_map__.php
··· 3331 3331 'PhabricatorSearchNgramsDestructionEngineExtension' => 'applications/search/engineextension/PhabricatorSearchNgramsDestructionEngineExtension.php', 3332 3332 'PhabricatorSearchOrderController' => 'applications/search/controller/PhabricatorSearchOrderController.php', 3333 3333 'PhabricatorSearchOrderField' => 'applications/search/field/PhabricatorSearchOrderField.php', 3334 - 'PhabricatorSearchPreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorSearchPreferencesSettingsPanel.php', 3335 3334 'PhabricatorSearchRelationship' => 'applications/search/constants/PhabricatorSearchRelationship.php', 3336 3335 'PhabricatorSearchResultBucket' => 'applications/search/buckets/PhabricatorSearchResultBucket.php', 3337 3336 'PhabricatorSearchResultBucketGroup' => 'applications/search/buckets/PhabricatorSearchResultBucketGroup.php', ··· 8044 8043 'PhabricatorSearchNgramsDestructionEngineExtension' => 'PhabricatorDestructionEngineExtension', 8045 8044 'PhabricatorSearchOrderController' => 'PhabricatorSearchBaseController', 8046 8045 'PhabricatorSearchOrderField' => 'PhabricatorSearchField', 8047 - 'PhabricatorSearchPreferencesSettingsPanel' => 'PhabricatorSettingsPanel', 8048 8046 'PhabricatorSearchRelationship' => 'Phobject', 8049 8047 'PhabricatorSearchResultBucket' => 'Phobject', 8050 8048 'PhabricatorSearchResultBucketGroup' => 'Phobject',
+5 -8
src/applications/search/controller/PhabricatorSearchController.php
··· 13 13 $viewer = $this->getViewer(); 14 14 15 15 if ($request->getStr('jump') != 'no') { 16 - $pref_jump = PhabricatorUserPreferences::PREFERENCE_SEARCHBAR_JUMP; 17 - if ($viewer->loadPreferences($pref_jump, 1)) { 18 - $response = PhabricatorJumpNavHandler::getJumpResponse( 19 - $viewer, 20 - $request->getStr('query')); 21 - if ($response) { 22 - return $response; 23 - } 16 + $response = PhabricatorJumpNavHandler::getJumpResponse( 17 + $viewer, 18 + $request->getStr('query')); 19 + if ($response) { 20 + return $response; 24 21 } 25 22 } 26 23
-62
src/applications/settings/panel/PhabricatorSearchPreferencesSettingsPanel.php
··· 1 - <?php 2 - 3 - final class PhabricatorSearchPreferencesSettingsPanel 4 - extends PhabricatorSettingsPanel { 5 - 6 - public function getPanelKey() { 7 - return 'search'; 8 - } 9 - 10 - public function getPanelName() { 11 - return pht('Search Preferences'); 12 - } 13 - 14 - public function getPanelGroup() { 15 - return pht('Application Settings'); 16 - } 17 - 18 - public function processRequest(AphrontRequest $request) { 19 - $user = $request->getUser(); 20 - $preferences = $user->loadPreferences(); 21 - 22 - $pref_jump = PhabricatorUserPreferences::PREFERENCE_SEARCHBAR_JUMP; 23 - $pref_shortcut = PhabricatorUserPreferences::PREFERENCE_SEARCH_SHORTCUT; 24 - 25 - if ($request->isFormPost()) { 26 - $preferences->setPreference($pref_jump, 27 - $request->getBool($pref_jump)); 28 - 29 - $preferences->setPreference($pref_shortcut, 30 - $request->getBool($pref_shortcut)); 31 - 32 - $preferences->save(); 33 - return id(new AphrontRedirectResponse()) 34 - ->setURI($this->getPanelURI('?saved=true')); 35 - } 36 - 37 - $form = id(new AphrontFormView()) 38 - ->setUser($user) 39 - ->appendChild( 40 - id(new AphrontFormCheckboxControl()) 41 - ->addCheckbox($pref_jump, 42 - 1, 43 - pht('Enable jump nav functionality in all search boxes.'), 44 - $preferences->getPreference($pref_jump, 1)) 45 - ->addCheckbox($pref_shortcut, 46 - 1, 47 - pht("Press '%s' to focus the search input.", '/'), 48 - $preferences->getPreference($pref_shortcut, 1))) 49 - ->appendChild( 50 - id(new AphrontFormSubmitControl()) 51 - ->setValue(pht('Save'))); 52 - 53 - $form_box = id(new PHUIObjectBoxView()) 54 - ->setHeaderText(pht('Search Preferences')) 55 - ->setFormSaved($request->getStr('saved') === 'true') 56 - ->setForm($form); 57 - 58 - return array( 59 - $form_box, 60 - ); 61 - } 62 - }
-2
src/applications/settings/storage/PhabricatorUserPreferences.php
··· 19 19 const PREFERENCE_VARY_SUBJECT = 'vary-subject'; 20 20 const PREFERENCE_HTML_EMAILS = 'html-emails'; 21 21 22 - const PREFERENCE_SEARCHBAR_JUMP = 'searchbar-jump'; 23 - const PREFERENCE_SEARCH_SHORTCUT = 'search-shortcut'; 24 22 const PREFERENCE_SEARCH_SCOPE = 'search-scope'; 25 23 26 24 const PREFERENCE_DIFFUSION_BLAME = 'diffusion-blame';
-5
src/view/page/menu/PhabricatorMainMenuView.php
··· 186 186 } 187 187 188 188 $result = $search; 189 - 190 - $pref_shortcut = PhabricatorUserPreferences::PREFERENCE_SEARCH_SHORTCUT; 191 - if ($viewer->loadPreferences()->getPreference($pref_shortcut, true)) { 192 - $keyboard_config['searchID'] = $search->getID(); 193 - } 194 189 } 195 190 196 191 Javelin::initBehavior('phabricator-keyboard-shortcuts', $keyboard_config);
-10
webroot/rsrc/js/core/behavior-keyboard-shortcuts.js
··· 30 30 }) 31 31 .register(); 32 32 33 - if (config.searchID) { 34 - desc = 'Give keyboard focus to the search box.'; 35 - new JX.KeyboardShortcut('/', desc) 36 - .setHandler(function() { 37 - var search = JX.$(config.searchID); 38 - search.focus(); 39 - search.select(); 40 - }) 41 - .register(); 42 - } 43 33 });