@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Sort project typeahead tokens by display name, not hashtag

Summary:
Fixes T8510. Results are internally ordered by "name", which is the full list of strings a user can type to match a result. On the balance, it is probably good/correct to order by this (particularly, it allows `function(x)` to sort near `x`).

However, the way projects were built put the tags first, so a project like "Discovery" could end up last if it had originally been created with a different name like "Search Team", so that its first slug is "search-team".

Instead, put the display name first in the ordering.

Test Plan:
{F1661775}

To reproduce in particular:

- Create a project named "Zebra".
- Create a lot of projects named "Armadillo-blahblahblah".
- Rename "Zebra" to "Armadillo".

Before the patch, the new "Armadillo" project would still sort as though it were named "Zebra". After the patch, it sorts as expected normally.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8510

Differential Revision: https://secure.phabricator.com/D15981

+4 -1
+4 -1
src/applications/project/typeahead/PhabricatorProjectDatasource.php
··· 82 82 $closed = pht('Archived'); 83 83 } 84 84 85 - $all_strings = mpull($proj->getSlugs(), 'getSlug'); 85 + $all_strings = array(); 86 86 $all_strings[] = $proj->getDisplayName(); 87 + foreach ($proj->getSlugs() as $project_slug) { 88 + $all_strings[] = $project_slug->getSlug(); 89 + } 87 90 $all_strings = implode(' ', $all_strings); 88 91 89 92 $proj_result = id(new PhabricatorTypeaheadResult())