Skip to content

Commit 2b5711b

Browse files
committed
autocomplete: Add "alphabetical order" criterion
In @-mention autocomplete, users are suggested based on: 1. Recent activity in the current stream. 2. Recent DM conversations. 3. Human vs. Bot users. 4. Alphabetical order. Fixes: #228
1 parent 5448993 commit 2b5711b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/model/autocomplete.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,12 @@ class MentionAutocompleteView extends ChangeNotifier {
293293
} else if (userA.isBot && !userB.isBot) {
294294
return 1;
295295
}
296-
return 0;
296+
297+
final userAName = store.autocompleteViewManager.autocompleteDataCache
298+
.normalizedNameForUser(userA);
299+
final userBName = store.autocompleteViewManager.autocompleteDataCache
300+
.normalizedNameForUser(userB);
301+
return userAName.compareTo(userBName);
297302
}
298303

299304
List<User> sortByRelevance({

0 commit comments

Comments
 (0)