element-portable/src/autocomplete
commonlawfeature 08a2d81d6b
Resolve emoji autocomplete not being temporally consistent (#8086)
* Adds a test to demonstrate the issue with emoji autocomplete reported in https://github.com/vector-im/element-web/issues/19302.

Signed-off-by: Ryan Browne <code@commonlawfeature.com>

* Trim trailing `:` when checking for autocompletes for emoji.

Closes https://github.com/vector-im/element-web/issues/19302

Signed-off-by: Ryan Browne <code@commonlawfeature.com>

* Move all references to the emoji delimiter character to reference a constant.

Signed-off-by: Ryan Browne <code@commonlawfeature.com>

* Revert "Move all references to the emoji delimiter character to reference a constant."

This reverts commit ac09e71e4c6151e35d21f612c9b329ead2a381f1.

Signed-off-by: Ryan Browne <code@commonlawfeature.com>

* Rename variable.

Signed-off-by: Ryan Browne <code@commonlawfeature.com>

* Make the test file a .js file.

Signed-off-by: Ryan Browne <code@commonlawfeature.com>

* Update quotes to match style and make a valid stubbed room.

Signed-off-by: Ryan Browne <code@commonlawfeature.com>

* Fix variable name and test reporting.

Signed-off-by: Ryan Browne <code@commonlawfeature.com>

* Use str.replace with a regex.

Signed-off-by: Ryan Browne <code@commonlawfeature.com>

* Use an improved regex that does not have have to iterate through the entire string, and can just backtrack at most the last 2 characters.

Signed-off-by: Ryan Browne <code@commonlawfeature.com>

* Revert "Use an improved regex that does not have have to iterate through the
entire string, and can just backtrack at most the last 2 characters."

This regex is very efficient, but requires a specific form of the emoji
shortcode that it is not clear is within our control. This is a restriction
that is not required by the technicalities of solving the bug this PR is
attempting to fix. (It requires that an emoji shortcode end with a colon.)

This reverts commit 220cb0efb8de247158c11daf9170464a57cc3af2.

Signed-off-by: Ryan Browne <code@commonlawfeature.com>

Co-authored-by: Ryan Browne <code@commonlawfeature.com>
2022-04-14 20:31:50 +00:00
..
AutocompleteProvider.tsx Auto fix 2021-12-09 09:10:23 +00:00
Autocompleter.ts Delete groups (legacy communities system) (#8027) 2022-03-22 23:07:37 +00:00
CommandProvider.tsx Replace deprecated String#substr with String#slice (#8314) 2022-04-14 07:52:42 +00:00
Components.tsx A11y fix role-has-required-aria-props (#7455) 2022-01-04 08:46:21 +00:00
EmojiProvider.tsx Resolve emoji autocomplete not being temporally consistent (#8086) 2022-04-14 20:31:50 +00:00
NotifProvider.tsx Suggest @room when @channel, @everyone, or @here is typed in composer (#7737) 2022-02-09 09:03:28 +00:00
QueryMatcher.ts Improve QueryMatcher TypeScript definition (#7555) 2022-01-17 14:08:36 +00:00
RoomProvider.tsx Delete groups (legacy communities system) (#8027) 2022-03-22 23:07:37 +00:00
SpaceProvider.tsx Auto-fix lint errors 2021-06-29 13:11:58 +01:00
UserProvider.tsx Prefer RoomStateEvent.Update where possible as it fires far less (#7878) 2022-02-24 14:39:25 +00:00