Skip to content

Commit 277fd69

Browse files
committed
fix(tui): sort skills list alphabetically in dialog
Skills were displayed in arbitrary API response order. Sort by name using localeCompare before rendering options.
1 parent 47f2112 commit 277fd69

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/tui/src/component/dialog-skill.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function DialogSkill(props: DialogSkillProps) {
3434

3535
const options = createMemo<DialogSelectOption<string>[]>(() => {
3636
if (showError()) return []
37-
const list = skills() ?? []
37+
const list = (skills() ?? []).toSorted((a, b) => a.name.localeCompare(b.name))
3838
const maxWidth = Math.max(0, ...list.map((s) => s.name.length))
3939
return list.map((skill) => ({
4040
title: skill.name.padEnd(maxWidth),

0 commit comments

Comments
 (0)