Add a searchPrefix option to rbautocomplete.

Review Request #6807 — Created Jan. 18, 2015 and discarded — Latest diff uploaded

Information

Review Board
master

Reviewers

There are some installs of Review Board where the user list is so large,
with so many similar names, that it's necessary to find a new way of
differentiating them when searching for their entries for autocomplete.

An example of this is Mozilla's instance of Review Board. Mozilla's
convention is to have the fullnames of their users followed by their
IRC Nick, prefixed with a colon, for example:

Mike Conley (:mconley)

RB's autocomplete widget isn't prepared to handle searches for ":mconley",
and map them to the actual Review Board username "mconley". This works
around that issue.

Really, this just supports the perpetuation of a habit that Mozillians
have developed over time. It's true that they could just start entering
the IRC nick and get the result they're looking for, but the colon prefix
is what they're used to.

In a local instance, I made sure that searching for normal usernames (without a search prefix) worked properly to make sure we didn't regress. I tested both selecting an autocomplete entry by pressing "enter" and "tab", as well as selecting an entry with the mouse.

Then, in our RBMozUI extension, where we've forked rbautocomplete with this patch, I used searchPrefix to make sure the colon prefix work around still worked. I was able to autocomplete with the colon prefix, and was able to select a reviewer both by pressing "enter" and "tab", as well as selecting one with the mouse.