zulip / zulip-flutter

Future Zulip client using Flutter
Apache License 2.0
160 stars 133 forks source link

In topic autocomplete, rank results by match relevance #881

Open gnprice opened 1 month ago

gnprice commented 1 month ago

In the initial implementation of #310 (in #627), we'll order the suggested topics purely by recency (see https://github.com/zulip/zulip-flutter/pull/627#discussion_r1713064079). That matches zulip-mobile's behavior, and is enough to be quite useful.

In Zulip web, though, there's some further ranking: an exact match comes first, then prefix matches, then matches that start at a word boundary. (Plus prefix matches are further split by case-exact vs. case-insensitive.) See initialize_topic_edit_typeahead in web/src/composebox_typeahead.ts; and then follow the indirections to triage_raw in web/shared/src/typeahead.ts for the implementation.

I'm not sure all the nuances of that are good to copy — in particular the case behavior, which should perhaps just be all case-insensitive. But we should do either that or something like it.

The additional ordering should, like in web, be stable — results that have the same priority in this ranking should remain ordered by recency.

This is a post-launch issue because the zulip-mobile legacy app doesn't do this ranking.

alya commented 2 weeks ago

If we decide to get rid of the case-sensitive behavior, we might want to do the same for web.

Case-insensitive does seems especially helpful for mobile, where managing capitals vs. lowercase letters is often a bother.