Skip to content

Commit 11708cc

Browse files
committed
Enhance quick pick display for presets, using chatbot names for unnamed entries and improved descriptions
1 parent a845873 commit 11708cc

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

packages/vscode/src/utils/at-sign-quick-pick.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export async function at_sign_quick_pick(
1515
},
1616
{
1717
label: '@Changes',
18-
description: 'Inject changes between current branch and selected branch'
18+
description:
19+
'Inject changes between the current branch and the selected branch'
1920
},
2021
{
2122
label: '@SavedContext',

packages/vscode/src/view/backend/message-handlers/handle-show-preset-picker.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export const handle_show_preset_picker = async (
1010
const config = vscode.workspace.getConfiguration('codeWebChat')
1111
const web_chat_presets = config.get<ConfigPresetFormat[]>('presets', [])
1212

13-
// Determine which global state key to use based on mode
1413
const selected_preset_names_state_key =
1514
provider.web_mode == 'code-completions'
1615
? 'selectedCodeCompletionPresets'
@@ -34,7 +33,6 @@ export const handle_show_preset_picker = async (
3433
available_preset_names.includes(name)
3534
)
3635

37-
// Update the global state with validated selection
3836
await provider.context.globalState.update(
3937
selected_preset_names_state_key,
4038
selected_preset_names
@@ -46,13 +44,21 @@ export const handle_show_preset_picker = async (
4644
? preset
4745
: !preset.promptPrefix && !preset.promptSuffix
4846
)
49-
.map((preset) => ({
50-
label: preset.name,
51-
description: `${preset.chatbot}${
52-
preset.model ? ` - ${preset.model}` : ''
53-
}`,
54-
picked: selected_preset_names.includes(preset.name)
55-
}))
47+
.map((preset) => {
48+
const is_unnamed = !preset.name || /^\(\d+\)$/.test(preset.name.trim())
49+
const model = preset.model
50+
? (CHATBOTS[preset.chatbot] as any).models[preset.model] || preset.model
51+
: ''
52+
53+
return {
54+
label: is_unnamed ? preset.chatbot : preset.name,
55+
name: preset.name,
56+
description: is_unnamed
57+
? model
58+
: `${preset.chatbot}${model ? ` · ${model}` : ''}`,
59+
picked: selected_preset_names.includes(preset.name)
60+
}
61+
})
5662

5763
const placeholder =
5864
provider.web_mode == 'code-completions'

0 commit comments

Comments
 (0)