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

When autocompleting, add a space if a user didn't already add something

Summary: Ref T10163. When a user autocompletes, add a space for them, unless they already added a comma, colon, or space themsevles.

Test Plan: Autocompleted `@dog`, got `@dog `. Autocompleted `@epriestley,` got `@epriestley,`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10163

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

+16 -9
+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' => '8bbbad27', 510 + 'rsrc/js/phuix/PHUIXAutocomplete.js' => 'fc10c813', 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' => '8bbbad27', 839 + 'phuix-autocomplete' => 'fc10c813', 840 840 'phuix-dropdown-menu' => 'bd4c8dca', 841 841 'phuix-form-control-view' => '8fba1997', 842 842 'phuix-icon-view' => 'bff6884b', ··· 1489 1489 'javelin-stratcom', 1490 1490 'javelin-vector', 1491 1491 ), 1492 - '8bbbad27' => array( 1493 - 'javelin-install', 1494 - 'javelin-dom', 1495 - 'phuix-icon-view', 1496 - 'phabricator-prefab', 1497 - ), 1498 1492 '8bdb2835' => array( 1499 1493 'phui-fontkit-css', 1500 1494 ), ··· 2091 2085 'javelin-mask', 2092 2086 'javelin-behavior-device', 2093 2087 'phabricator-keyboard-shortcut', 2088 + ), 2089 + 'fc10c813' => array( 2090 + 'javelin-install', 2091 + 'javelin-dom', 2092 + 'phuix-icon-view', 2093 + 'phabricator-prefab', 2094 2094 ), 2095 2095 'fc91ab6c' => array( 2096 2096 'javelin-behavior',
+8 -1
webroot/rsrc/js/phuix/PHUIXAutocomplete.js
··· 600 600 return false; 601 601 } 602 602 603 - // If the user types a string like "@username:" (with a trailing comma), 603 + // If the user types a string like "@username:" (with a trailing colon), 604 604 // then presses tab or return to pick the completion, don't destroy the 605 605 // trailing character. 606 606 var suffixes = this._getSuffixes(); 607 607 var value = this._value; 608 + var found_suffix = false; 608 609 for (var ii = 0; ii < suffixes.length; ii++) { 609 610 var last = value.substring(value.length - suffixes[ii].length); 610 611 if (last == suffixes[ii]) { 611 612 ref += suffixes[ii]; 613 + found_suffix = true; 612 614 break; 613 615 } 616 + } 617 + 618 + // If we didn't find an existing suffix, add a space. 619 + if (!found_suffix) { 620 + ref = ref + ' '; 614 621 } 615 622 616 623 area.value = text.substring(0, head - 1) + ref + text.substring(tail);