1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-03 11:21:01 +01:00
phorge-phorge/webroot/rsrc/js/application
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
..
aphlict Make Aphlict client somewhat more approachable 2012-03-06 20:14:03 -08:00
core Improve tokenizer sorting rules 2012-03-07 13:17:44 -08:00
countdown Remove usage of JX.defer in favor of setTimeout 2011-08-10 18:09:59 -07:00
differential Don't provide Undo for empty text in Differential inline comment 2012-02-29 23:44:42 -08:00
diffusion Add preview and drafts to audits 2012-02-27 13:00:23 -08:00
herald Allow Herald to trigger audits for users or projects 2012-02-27 09:36:30 -08:00
maniphest Iterate on Maniphest reports 2012-03-01 14:19:11 -08:00
owners Bring Javelin into Phabricator via git submodule, not copy-and-paste 2011-05-08 13:20:10 -07:00
phriction Add a document preview to Phriction 2011-07-16 18:48:27 -07:00
projects Remove "Former" project members 2011-12-16 17:46:02 -08:00
repository Tie all the pieces for symbol cross-references together 2011-10-09 17:58:17 -07:00
uiexample Examples using JX.View 2011-11-06 15:17:00 -08:00