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

Improve autocomplete behavior in lists and with noncompleting results

Summary:
Ref T10163. Currently, we don't activate on indented lines, but were too aggressive about this, and would not activate on lines like ` - Hey, @user...`, where we should.

Instead, don't activate on indented lines if there's only an indent (i.e., `#` probably means enumerated list).

Also, if results don't have autocompletes (rare but possible with projects missing slugs), improve behavior.

Test Plan:
- Typed ` #a`, got no autocomplete.
- Missing slug thing is a pain to test locallly, `#1 z z z z` reproduces in production. I'll just verify it there.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10163

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

+17 -12
+8 -8
resources/celerity/map.php
··· 507 507 'rsrc/js/phui/behavior-phui-object-box-tabs.js' => '2bfa2836', 508 508 'rsrc/js/phuix/PHUIXActionListView.js' => 'b5c256b8', 509 509 'rsrc/js/phuix/PHUIXActionView.js' => '8cf6d262', 510 - 'rsrc/js/phuix/PHUIXAutocomplete.js' => '0abdd4a8', 510 + 'rsrc/js/phuix/PHUIXAutocomplete.js' => '8bbbad27', 511 511 'rsrc/js/phuix/PHUIXDropdownMenu.js' => 'bd4c8dca', 512 512 'rsrc/js/phuix/PHUIXFormControl.js' => '8fba1997', 513 513 'rsrc/js/phuix/PHUIXIconView.js' => 'bff6884b', ··· 836 836 'phui-workpanel-view-css' => 'adec7699', 837 837 'phuix-action-list-view' => 'b5c256b8', 838 838 'phuix-action-view' => '8cf6d262', 839 - 'phuix-autocomplete' => '0abdd4a8', 839 + 'phuix-autocomplete' => '8bbbad27', 840 840 'phuix-dropdown-menu' => 'bd4c8dca', 841 841 'phuix-form-control-view' => '8fba1997', 842 842 'phuix-icon-view' => 'bff6884b', ··· 916 916 'javelin-workflow', 917 917 'javelin-dom', 918 918 'javelin-router', 919 - ), 920 - '0abdd4a8' => array( 921 - 'javelin-install', 922 - 'javelin-dom', 923 - 'phuix-icon-view', 924 - 'phabricator-prefab', 925 919 ), 926 920 '0b7a4f6e' => array( 927 921 'javelin-behavior', ··· 1494 1488 'javelin-dom', 1495 1489 'javelin-stratcom', 1496 1490 'javelin-vector', 1491 + ), 1492 + '8bbbad27' => array( 1493 + 'javelin-install', 1494 + 'javelin-dom', 1495 + 'phuix-icon-view', 1496 + 'phabricator-prefab', 1497 1497 ), 1498 1498 '8bdb2835' => array( 1499 1499 'phui-fontkit-css',
+9 -4
webroot/rsrc/js/phuix/PHUIXAutocomplete.js
··· 127 127 return; 128 128 } 129 129 130 - // Get all the text on the current line. If the line begins with 131 - // whitespace, don't activate: the user is probably typing code or a 130 + // Get all the text on the current line. If the line only contains 131 + // whitespace, don't actiavte: the user is probably typing code or a 132 132 // numbered list. 133 - var line = area.value.substring(0, head); 133 + var line = area.value.substring(0, head - 1); 134 134 line = line.split('\n'); 135 135 line = line[line.length - 1]; 136 - if (line.match(/^\s+/)) { 136 + if (line.match(/^\s+$/)) { 137 137 return; 138 138 } 139 139 ··· 219 219 for (var ii = 0; ii < nodes.length; ii++) { 220 220 var result = this._datasources[code].getResult(nodes[ii].rel); 221 221 if (!result) { 222 + hits = null; 223 + break; 224 + } 225 + 226 + if (!result.autocomplete || !result.autocomplete.length) { 222 227 hits = null; 223 228 break; 224 229 }