Skip to content

Commit e9806c9

Browse files
authored
Issues - labels picker should show selected labels at the top (#6857)
Fixes #6844
1 parent 8e90cf5 commit e9806c9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/github/quickPicks.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@ export async function getLabelOptions(
393393
<rect x="2" y="2" width="12" height="12" rx="6" fill="#${label.color}"/>
394394
</svg>`, 'utf8'))
395395
};
396+
}).sort((a, b) => {
397+
// Sort so that already picked labels are at the top
398+
if (a.picked === b.picked) {
399+
return a.label.localeCompare(b.label);
400+
}
401+
return a.picked ? -1 : 1;
396402
});
397403
return { newLabels, labelPicks };
398404
}

0 commit comments

Comments
 (0)