-
-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Search people's names modulo diacritics, in autocomplete #3710
Comments
Thanks @maxandersen ! I agree this would be a useful feature. It looks like the webapp added this feature earlier this year, in zulip/zulip#11183 / zulip/zulip@b7a0a45f0. Before that, it had similar logic which it used for searching for a user in the right sidebar; we probably also want to use similar logic when searching for a user to e.g. start a PM thread. A note on how to implement this: this looks like an example of some logic it'd be great to share the code for between web and mobile. For whoever takes this on, see
In particular:
|
export const remove_diacritics = (str: string): string =>
str.normalize("NFD")
.replace(/[\u0300-\u036F\u1AB0-\u1AFF\u20D0-\u20FF\uFE20-\uFE2F]/g,''); (This isn't quite complete; it will notably not remove strokes, such as those found in Ħ, Ł, Đ, or Ð [sic!], nor unify i with Turkish ı. Also, we may or may not want it to unify homographs.) |
zulip/zulip#13485 is an improved implementation we just merged for the webapp for this. |
Neat! Here's the new version there, which is in a very similar spirit to Ray's comment above:
At that length it'd feel less bad to me to duplicate it. ... But also that change itself illustrates why it'd be better to share it. (The possibility we might add more normalization in the future -- so e.g. "Luk" finds "Łukasz", following on an example above -- is another reason.) Since it should be an easy one to share, I think that'll still be the preferred way to solve this issue. |
|
When invoking the typeahead filter for users it is desirable to be able to see results for users with diacritics in their names even if the filter does not contain the matching diacritics. This PR leverages @zulip/shared typeahead module in order to strip diacritics out of the filtering process, unless the user explicitly uses them in the filter. Fixes: zulip#3710
When invoking the typeahead filter for users it is desirable to be able to see results for users with diacritics in their names even if the filter does not contain the matching diacritics. This PR leverages @zulip/shared typeahead module in order to strip diacritics out of the filtering process, unless the user explicitly uses them in the filter. Fixes: zulip#3710
When invoking the typeahead filter for users it is desirable to be able to see results for users with diacritics in their names even if the filter does not contain the matching diacritics. This PR leverages @zulip/shared typeahead module in order to strip diacritics out of the filtering process, unless the user explicitly uses them in the filter. Fixes: zulip#3710
When invoking the typeahead filter for users it is desirable to be able to see results for users with diacritics in their names even if the filter does not contain the matching diacritics. This PR leverages @zulip/shared typeahead module in order to strip diacritics out of the filtering process, unless the user explicitly uses them in the filter. Fixes: zulip#3710
When invoking the typeahead filter for users it is desirable to be able to see results for users with diacritics in their names even if the filter does not contain the matching diacritics. This PR leverages @zulip/shared typeahead module in order to strip diacritics out of the filtering process, unless the user explicitly uses them in the filter. Fixes: zulip#3710
When invoking the typeahead filter for users it is desirable to be able to see results for users with diacritics in their names even if the filter does not contain the matching diacritics. This PR leverages @zulip/shared typeahead module in order to strip diacritics out of the filtering process, unless the user explicitly uses them in the filter. Fixes: zulip#3710
autocomplete seem to not work consistently for characters like
àåä
If someone is named
ståhle
I can't get that to autocomplete it using@sta
but if you are named
stéph
autocomplete works with@ste
The text was updated successfully, but these errors were encountered: