Skip to content

Commit 9f01453

Browse files
committed
Fix sorting
1 parent 23da367 commit 9f01453

1 file changed

Lines changed: 20 additions & 11 deletions

File tree

tool/generate_release_notes.dart

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,32 @@ List<String> _sortLabels(List<String> labels,
125125
{required bool forPrimarySelection}) {
126126
// Use this label first for primary selection, but sort it at the end for
127127
// display.
128-
final reliesOnSdkRank = forPrimarySelection ? -1000 : 10;
129-
const priorities = {
130-
'in flutter': -10,
131-
'in editor': -9,
132-
'in testing': -8,
133-
'in debugger': -7,
134-
'in commands': -6,
135-
'in views': -5,
136-
'in cli': 1,
128+
final reliesOnSdkRank = forPrimarySelection ? 0 : 10000;
129+
const priorities = <String, int?>{
130+
'in flutter': 1,
131+
'in editor': 2,
132+
'in ai': 3,
133+
'in devtools': 4,
134+
'in flutter sidebar': 5,
135+
'in testing': 6,
136+
'in debugging': 7,
137+
'in commands': 8,
138+
'in cli': 9,
139+
'in views': 10,
140+
'in remote': 11,
141+
'in tasks': 12,
142+
'in dtd': 13,
143+
'in api': 14,
144+
'in docs / website': 15,
145+
'in misc': 16,
137146
};
138147
final labelRanks = {
139148
for (final label in labels)
140149
label: priorities[label] ??
141-
(label.startsWith('relies on sdk') ? reliesOnSdkRank : 0),
150+
(label.startsWith('relies on sdk') ? reliesOnSdkRank : null),
142151
};
143152

144-
return labels.sortedBy<num>((label) => labelRanks[label] ?? 0);
153+
return labels.sortedBy<num>((label) => labelRanks[label] ?? 1000);
145154
}
146155

147156
Future<dynamic> fetchJson(String uri) async {

0 commit comments

Comments
 (0)