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

Search Typeahead - make exact matches show up first

Summary: Fixes T6102. Give "priority" treatment to strings that are exact matches.

Test Plan:
made a bunch of projects with the word project in them including "Project". before patch, "Project" wouldn't even show up if I typed "Project" - now its the second result right after the application "Projects".

{F235120}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6102

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

+22 -15
+13 -13
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => '0784ef1d', 11 - 'core.pkg.js' => 'cbdbd552', 11 + 'core.pkg.js' => 'e5f7f2ba', 12 12 'darkconsole.pkg.js' => 'df001cab', 13 13 'differential.pkg.css' => '8af45893', 14 14 'differential.pkg.js' => '42c10e78', ··· 481 481 'rsrc/js/core/behavior-remarkup-preview.js' => 'f7379f45', 482 482 'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e', 483 483 'rsrc/js/core/behavior-reveal-content.js' => '60821bc7', 484 - 'rsrc/js/core/behavior-search-typeahead.js' => 'd712ac5f', 484 + 'rsrc/js/core/behavior-search-typeahead.js' => '724b1247', 485 485 'rsrc/js/core/behavior-select-on-click.js' => '4e3e79a6', 486 486 'rsrc/js/core/behavior-toggle-class.js' => 'e566f52c', 487 487 'rsrc/js/core/behavior-tokenizer.js' => 'b3a4b884', ··· 622 622 'javelin-behavior-phabricator-oncopy' => '2926fff2', 623 623 'javelin-behavior-phabricator-remarkup-assist' => 'e32d14ab', 624 624 'javelin-behavior-phabricator-reveal-content' => '60821bc7', 625 - 'javelin-behavior-phabricator-search-typeahead' => 'd712ac5f', 625 + 'javelin-behavior-phabricator-search-typeahead' => '724b1247', 626 626 'javelin-behavior-phabricator-show-all-transactions' => '7c273581', 627 627 'javelin-behavior-phabricator-tooltips' => '3ee3408b', 628 628 'javelin-behavior-phabricator-transaction-comment-form' => '9f7309fb', ··· 1278 1278 'phabricator-phtize', 1279 1279 'changeset-view-manager', 1280 1280 ), 1281 + '724b1247' => array( 1282 + 'javelin-behavior', 1283 + 'javelin-typeahead-ondemand-source', 1284 + 'javelin-typeahead', 1285 + 'javelin-dom', 1286 + 'javelin-uri', 1287 + 'javelin-util', 1288 + 'javelin-stratcom', 1289 + 'phabricator-prefab', 1290 + ), 1281 1291 '7319e029' => array( 1282 1292 'javelin-behavior', 1283 1293 'javelin-dom', ··· 1732 1742 'javelin-request', 1733 1743 'javelin-stratcom', 1734 1744 'javelin-dom', 1735 - ), 1736 - 'd712ac5f' => array( 1737 - 'javelin-behavior', 1738 - 'javelin-typeahead-ondemand-source', 1739 - 'javelin-typeahead', 1740 - 'javelin-dom', 1741 - 'javelin-uri', 1742 - 'javelin-util', 1743 - 'javelin-stratcom', 1744 - 'phabricator-prefab', 1745 1745 ), 1746 1746 'd75709e6' => array( 1747 1747 'javelin-behavior',
+9 -2
webroot/rsrc/js/core/behavior-search-typeahead.js
··· 62 62 var ii; 63 63 for (ii = 0; ii < list.length; ii++) { 64 64 var item = list[ii]; 65 + 66 + for (var jj = 0; jj < tokens.length; jj++) { 67 + if (item.name.indexOf(tokens[jj]) === 0) { 68 + priority_hits[item.id] = true; 69 + } 70 + } 71 + 65 72 if (!item.priority) { 66 73 continue; 67 74 } 68 75 69 - for (var jj = 0; jj < tokens.length; jj++) { 70 - if (item.priority.substr(0, tokens[jj].length) == tokens[jj]) { 76 + for (var hh = 0; hh < tokens.length; hh++) { 77 + if (item.priority.substr(0, tokens[hh].length) == tokens[hh]) { 71 78 priority_hits[item.id] = true; 72 79 } 73 80 }