Page MenuHomePhabricator

[web] Hide typeahead if multiple characters are selected
ClosedPublic

Authored by przemek on Feb 3 2023, 5:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 6:40 AM
Unknown Object (File)
Wed, Apr 17, 6:40 AM
Unknown Object (File)
Wed, Apr 17, 6:40 AM
Unknown Object (File)
Wed, Apr 17, 6:39 AM
Unknown Object (File)
Wed, Apr 17, 6:37 AM
Unknown Object (File)
Mar 21 2024, 10:09 AM
Unknown Object (File)
Mar 20 2024, 5:46 AM
Unknown Object (File)
Mar 20 2024, 5:46 AM

Details

Summary

As discussed here: https://linear.app/comm/issue/ENG-2891/refactor-some-of-the-native-typeahead-creation-logic-and-make-web
and here: https://linear.app/comm/issue/ENG-2888/typeahead-decide-what-to-do-with-multi-character-selection-near-symbol
we needed a little refactor in web typeahead.
This diff resolves both.
It is possible to rewrite condtional event tighter, but we would need to wrap them in signle useMemo
which might hurt our performance. This way feel clear enough and we use utility function prepared earlier.

Test Plan

Tested if web typeahead works propery:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

przemek retitled this revision from [web] Typeahead doesn't show if multiple charcaters are selected. to [web] Hide typeahead if multiple characters are selected.Feb 3 2023, 5:07 AM
przemek edited the test plan for this revision. (Show Details)

Looks good to me (although the code comment now feels a little bit unnecessary).

inka added inline comments.
lib/shared/typeahead-utils.js
23–24 ↗(On Diff #21939)

I'd change that a little bit, but it's up to you

This revision is now accepted and ready to land.Feb 8 2023, 3:16 AM

Deleted comment as it was redundant.

przemek added inline comments.
lib/shared/typeahead-utils.js
23–24 ↗(On Diff #21939)

I decided to delete the comment entirely as the code here is self-explanatory

This revision was automatically updated to reflect the committed changes.
przemek marked an inline comment as done.