1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-29 17:00:59 +01:00
phorge-phorge/webroot/rsrc/js/phuix
epriestley dba1b10720 Deactivate the remarkup autosuggest once text can't match "[[" or "((" rules
Summary:
See PHI1185, which reports a performance issue with "(" in remarkup in certain contexts.

I can't reproduce the performance issue, but I can reproduce the autosuggester incorrectly remaining active and swallowing return characters.

When the user types `(` or `[`, we wait for a prefix for the `((` (Phurl) or `[[` (Phriction) rules. We currently continue looking for that prefix until a character is entered that explicitly interrupts the search.

For example, typing `(xxx<return>` does not insert a return character, because we're stuck on matching the prefix.

Instead, as soon as the user has entered text that we know won't ever match the prefix, deactivate the autocomplete. We can slightly cheat through this by just looking for at least one character of text, since all prefixes are exactly one character long. If we eventually have some kind of `~~@(xyz)` rule we might need to add a more complicated piece of rejection logic.

Test Plan: Typed `(xxx<return>`, got a return. Used `((` and `[[` autosuggest rules normally. Used `JX.log()` to sanity check that nothing too crazy seems to be happening.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D20365
2019-04-01 15:40:38 -07:00
..
PHUIXActionListView.js Begin rebuilding dropdown menus on ActionList 2014-05-05 10:56:14 -07:00
PHUIXActionView.js Support text encoding and syntax highlighting options in document rendering 2018-03-30 11:28:52 -07:00
PHUIXAutocomplete.js Deactivate the remarkup autosuggest once text can't match "[[" or "((" rules 2019-04-01 15:40:38 -07:00
PHUIXButtonView.js Add more accessibility labels for screen readers 2018-08-17 13:31:51 -07:00
PHUIXDropdownMenu.js Fix spelling 2017-10-09 10:48:04 -07:00
PHUIXExample.js Add PHUIXButtonView and a UIExample 2017-05-30 18:01:16 -07:00
PHUIXFormControl.js Use a tokenizer, not a gigantic poorly-ordered "<select />", to choose repositories in Owners 2018-03-07 20:57:24 -08:00
PHUIXIconView.js Basic stacked action support for EditEngine 2015-12-03 12:32:02 -08:00