Просмотр исходного кода

fix: Sort themes in the /theme modal alphabetically (resolves #5217) (#5219)

Co-authored-by: Aiden Cline <[email protected]>
Ariane Emory 2 месяцев назад
Родитель
Сommit
63e54541fe
1 измененных файлов с 6 добавлено и 4 удалено
  1. 6 4
      packages/opencode/src/cli/cmd/tui/component/dialog-theme-list.tsx

+ 6 - 4
packages/opencode/src/cli/cmd/tui/component/dialog-theme-list.tsx

@@ -5,10 +5,12 @@ import { onCleanup, onMount } from "solid-js"
 
 export function DialogThemeList() {
   const theme = useTheme()
-  const options = Object.keys(theme.all()).map((value) => ({
-    title: value,
-    value: value,
-  }))
+  const options = Object.keys(theme.all())
+    .sort((a, b) => a.localeCompare(b, undefined, { sensitivity: 'base' }))
+    .map((value) => ({
+      title: value,
+      value: value,
+    }))
   const dialog = useDialog()
   let confirmed = false
   let ref: DialogSelectRef<string>