1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-04 03:41:01 +01:00
phorge-phorge/src/view/form/control
epriestley 492d047a49 Improve tokenizer sorting rules
Summary:
Currently, we sort all results alphabetically. This isn't ideal. Instead, sort them like this:

  - If the viewing user appears in the list, always sort them first. This is common in a lot of contexts and some "Ben Evans" guy is sorting first on secure.phabricator.com and causing me no end of aggravation.
  - If the tokens match a "priority" component (e.g., username), sort that before results which do not have a "priority" match.
  - Within a group (self, priority, everything else) sort tokens alphabetically.

NOTE: I need to go add setUser() to all the tokenizers to make the "self" rule work, but that's trivial so I figured I'd get this out first.

Test Plan:
https://secure.phabricator.com/file/data/4s2a72l5hhyyqqkq4bnd/PHID-FILE-x2r6ubk7s7dz54kxmtwx/Screen_Shot_2012-03-07_at_9.18.03_AM.png

Previously, "aaaaaepriestley" (first alphabetic match) would sort before "epriestley" (the viewing user). Now, "epriestley" sorts first because that is the viewer.

https://secure.phabricator.com/file/data/rmnxgnafz42f23fsjwui/PHID-FILE-yrnn55jl3ysbntldq3af/Screen_Shot_2012-03-07_at_9.18.09_AM.png

Previously, "aaaagopher" (first alphabetic match) would sort before "banana" (the "priority" match). Now, "banana" sorts first because it priority matches on username.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T946

Differential Revision: https://secure.phabricator.com/D1807
2012-03-07 13:17:44 -08:00
..
base Get rid of +x on a bunch of nonexecutable files because I failed to set 2011-04-02 16:47:20 -07:00
checkbox Admin and disabled flags for users 2011-05-12 11:17:50 -07:00
divider Get rid of +x on a bunch of nonexecutable files because I failed to set 2011-04-02 16:47:20 -07:00
draganddropupload Improve file preview in Maniphest 2011-05-27 09:35:56 -07:00
file Get rid of +x on a bunch of nonexecutable files because I failed to set 2011-04-02 16:47:20 -07:00
markup Get rid of +x on a bunch of nonexecutable files because I failed to set 2011-04-02 16:47:20 -07:00
password Get rid of +x on a bunch of nonexecutable files because I failed to set 2011-04-02 16:47:20 -07:00
radio Improve Herald personal/global UI/UX 2012-01-31 12:09:29 -08:00
recaptcha Prevent login brute forcing with captchas 2012-01-12 15:22:05 -08:00
select Add a contextual "scope" dropdown for searches 2012-02-14 17:00:12 -08:00
static Get rid of +x on a bunch of nonexecutable files because I failed to set 2011-04-02 16:47:20 -07:00
submit Get rid of +x on a bunch of nonexecutable files because I failed to set 2011-04-02 16:47:20 -07:00
text Get rid of +x on a bunch of nonexecutable files because I failed to set 2011-04-02 16:47:20 -07:00
textarea Add Basic Auditing Functionalities 2011-12-20 13:36:53 -08:00
togglebuttons Unify "toggle buttons" controls 2012-02-27 12:59:05 -08:00
tokenizer Improve tokenizer sorting rules 2012-03-07 13:17:44 -08:00