Skip to content

Commit 151e1d0

Browse files
committed
Update history quick pick items to display an icon as the label and move the timestamp to the description
1 parent ed93084 commit 151e1d0

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

packages/vscode/src/view/backend/message-handlers/handle-send-prompt.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import { chat_code_completion_instructions } from '@/constants/instructions'
1414
import { ConfigPresetFormat } from '../helpers/preset-format-converters'
1515
import { CHATBOTS } from '@shared/constants/chatbots'
1616

17+
/**
18+
* When preset_names is an emtpy stirng - show quick pick,
19+
* if undefiend - use recently used preset/group.
20+
*/
1721
export const handle_send_prompt = async (params: {
1822
provider: ViewProvider
1923
preset_names?: string[]
@@ -278,7 +282,10 @@ async function resolve_presets(params: {
278282
const last_preset = params.context.workspaceState.get<string>(
279283
LAST_SELECTED_PRESET_KEY
280284
)
281-
if (last_preset && available_preset_names.includes(last_preset)) {
285+
if (
286+
last_preset !== undefined &&
287+
available_preset_names.includes(last_preset)
288+
) {
282289
return [last_preset]
283290
}
284291
} else if (last_choice == GROUP) {

packages/vscode/src/view/backend/message-handlers/handle-show-history-quick-pick.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ export const handle_show_history_quick_pick = async (
8080
total_pinned?: number,
8181
is_searching?: boolean
8282
): vscode.QuickPickItem => ({
83-
label: dayjs(entry.createdAt).fromNow(),
83+
label: '$(history)',
84+
description: dayjs(entry.createdAt).fromNow(),
8485
detail: entry.text,
8586
buttons: [
8687
...(list == 'pinned' &&
@@ -112,16 +113,13 @@ export const handle_show_history_quick_pick = async (
112113
? [
113114
{
114115
iconPath: new vscode.ThemeIcon('pinned'),
115-
tooltip: 'Add to Pinned Prompts'
116+
tooltip: 'Add to pinned'
116117
}
117118
]
118119
: []),
119120
{
120121
iconPath: new vscode.ThemeIcon('close'),
121-
tooltip:
122-
list == 'pinned'
123-
? 'Remove from Pinned Prompts'
124-
: 'Remove from Recent Prompts'
122+
tooltip: list == 'pinned' ? 'Remove from pinned' : 'Remove from recent'
125123
}
126124
]
127125
})

0 commit comments

Comments
 (0)