Skip to content

Commit f769aac

Browse files
committed
Make configuration profile drop-down alpha order
1 parent 2773208 commit f769aac

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/few-impalas-flow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
small function that alphabetizes the configuration profile names in the dropdown

webview-ui/src/components/settings/ApiConfigManager.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ interface ApiConfigManagerProps {
1515
onUpsertConfig: (configName: string) => void
1616
}
1717

18+
const sortConfigOptions = (configs: ApiConfigMeta[]) => {
19+
return [...configs].sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()))
20+
}
21+
1822
const ApiConfigManager = ({
1923
currentApiConfigName = "",
2024
listApiConfigMeta = [],
@@ -225,7 +229,7 @@ const ApiConfigManager = ({
225229
zIndex: 1002,
226230
}}
227231
role="combobox"
228-
options={listApiConfigMeta.map((config) => ({
232+
options={sortConfigOptions(listApiConfigMeta).map((config) => ({
229233
value: config.name,
230234
label: config.name,
231235
}))}

0 commit comments

Comments
 (0)