@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 when typing ordered lists

Summary:
Ref T10163.

- If a user types an autocomplete character ("@" or "#") and then a space, deactivate immediately (probably an ordered list).
- If a user types an autocomplete character indented on a line with no other prior text, don't activate (probably an ordered list or code block).

Test Plan:
Typed:

- `# `, saw immediate deactivation.
- ` #`, saw no activation in the first place.
- `#x`, saw activation.
- `asdf #x`, saw activation.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10163

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

+20 -3
+3 -3
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' => '3d6e37cc', 510 + 'rsrc/js/phuix/PHUIXAutocomplete.js' => '3dfff01f', 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' => '3d6e37cc', 839 + 'phuix-autocomplete' => '3dfff01f', 840 840 'phuix-dropdown-menu' => 'bd4c8dca', 841 841 'phuix-form-control-view' => '8fba1997', 842 842 'phuix-icon-view' => 'bff6884b', ··· 1080 1080 'javelin-util', 1081 1081 'javelin-uri', 1082 1082 ), 1083 - '3d6e37cc' => array( 1083 + '3dfff01f' => array( 1084 1084 'javelin-install', 1085 1085 'javelin-dom', 1086 1086 'phuix-icon-view',
+17
webroot/rsrc/js/phuix/PHUIXAutocomplete.js
··· 119 119 return; 120 120 } 121 121 122 + // Get all the text on the current line. If the line begins with 123 + // whitespace, don't activate: the user is probably typing code or a 124 + // numbered list. 125 + var line = area.value.substring(0, head); 126 + line = line.split('\n'); 127 + line = line[line.length - 1]; 128 + if (line.match(/^\s+/)) { 129 + return; 130 + } 131 + 122 132 this._cursorHead = head; 123 133 this._cursorTail = range.end; 124 134 this._pixelHead = JX.TextAreaUtils.getPixelDimensions( ··· 369 379 370 380 var x = this._pixelHead.start.x; 371 381 var y = Math.max(this._pixelHead.end.y, pixels.end.y) + 24; 382 + 383 + // If the first character after the trigger is a space, just deactivate 384 + // immediately. This occurs if a user types a numbered list using "#". 385 + if (text.length && text[0] == ' ') { 386 + this._deactivate(); 387 + return; 388 + } 372 389 373 390 var trim = this._trim(text); 374 391