Skip to content

Commit a71f822

Browse files
committed
Move hash sign quick pick translations to shared utils and add multi-commit reference support
- once commit symbol is selected, 'Symbols' quick pick should not reopen, instead we should show notification 'add another' like we already do in other place, when clicked reopen commits while highlighting last chosen one - translations for hash sign quick pick should be in `apps/editor/src/i18n/translations/views/shared...` └── apps └── editor └── src ├── i18n │ ├── index.ts │ └── translations │ ├── common.ts │ └── views │ ├── index.ts │ ├── prompt │ │ ├── handlers │ │ │ └── index.ts │ │ └── index.ts │ └── shared │ ├── actions │ │ ├── agent │ │ │ ├── create.ts │ │ │ ├── delete.ts │ │ │ ├── index.ts │ │ │ └── pick-agent.ts │ │ ├── api │ │ │ ├── add-provider.ts │ │ │ ├── common.ts │ │ │ ├── create │ │ │ │ ├── index.ts │ │ │ │ └── interactions │ │ │ │ ├── index.ts │ │ │ │ ├── initial-select-model.ts │ │ │ │ ├── initial-select-provider.ts │ │ │ │ └── verify-model.ts │ │ │ ├── delete.ts │ │ │ ├── index.ts │ │ │ ├── pick-extended-provider.ts │ │ │ ├── pick-reasoning-effort.ts │ │ │ └── update │ │ │ ├── index.ts │ │ │ └── interactions │ │ │ ├── edit-model-for-api-config.ts │ │ │ ├── edit-reasoning-effort-for-api-config.ts │ │ │ └── index.ts │ │ ├── common.ts │ │ ├── index.ts │ │ └── web │ │ ├── create.ts │ │ ├── delete.ts │ │ ├── index.ts │ │ ├── pick-chatbot.ts │ │ ├── pick-model.ts │ │ └── update.ts │ ├── index.ts │ └── utils │ ├── hash-sign-quick-pick.ts │ └── index.ts └── views ├── prompt │ ├── backend │ │ ├── message-handlers │ │ │ ├── handle-hash-sign-quick-pick.ts │ │ │ └── index.ts │ │ └── prompt-view-provider.ts │ ├── frontend │ │ └── Main │ │ └── Main.tsx │ └── types │ └── messages.ts └── shared └── utils └── hash-sign-quick-pick ├── hash-sign-quick-pick.ts ├── index.ts └── symbols ├── changes-symbol.ts ├── commit-symbol.ts ├── index.ts ├── saved-context-symbol.ts └── skill-symbol.ts
1 parent 8014a4c commit a71f822

9 files changed

Lines changed: 210 additions & 166 deletions

File tree

‎apps/editor/src/i18n/translations/views/prompt/handlers/index.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { translations as handle_delete_task } from './handle-delete-task'
2-
import { translations as handle_hash_sign_quick_pick } from './handle-hash-sign-quick-pick'
32
import { translations as handle_make_api_call } from './handle-make-api-call'
43
import { translations as handle_select_edit_format_instructions } from './handle-select-edit-format-instructions'
54
import { translations as handle_voice_input } from './handle-voice-input'
@@ -16,7 +15,6 @@ import { translations as handle_clear_completed_tasks } from './handle-clear-com
1615

1716
export const translations = {
1817
...handle_delete_task,
19-
...handle_hash_sign_quick_pick,
2018
...handle_make_api_call,
2119
...handle_select_edit_format_instructions,
2220
...handle_voice_input,
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { translations as actions } from './actions'
2+
import { translations as utils } from './utils'
23

34
export const translations = {
4-
...actions
5+
...actions,
6+
...utils
57
}

apps/editor/src/i18n/translations/views/prompt/handlers/handle-hash-sign-quick-pick.ts renamed to apps/editor/src/i18n/translations/views/shared/utils/hash-sign-quick-pick.ts

Lines changed: 172 additions & 143 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { translations as hash_sign_quick_pick } from './hash-sign-quick-pick'
2+
3+
export const translations = {
4+
...hash_sign_quick_pick
5+
}

‎apps/editor/src/views/shared/utils/hash-sign-quick-pick/hash-sign-quick-pick.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import {
88
handle_skill_item
99
} from './symbols'
1010

11-
const changes_label = `$(git-pull-request-draft) ${t('views.prompt.handlers.handle-hash-sign-quick-pick.quick-pick.changes.label')}`
12-
const commit_label = `$(git-commit) ${t('views.prompt.handlers.handle-hash-sign-quick-pick.quick-pick.commit.label')}`
13-
const saved_context_label = `$(checklist) ${t('views.prompt.handlers.handle-hash-sign-quick-pick.quick-pick.saved-context.label')}`
14-
const skill_label = `$(thinking) ${t('views.prompt.handlers.handle-hash-sign-quick-pick.quick-pick.skill.label')}`
11+
const changes_label = `$(git-pull-request-draft) ${t('views.shared.utils.hash-sign-quick-pick.quick-pick.changes.label')}`
12+
const commit_label = `$(git-commit) ${t('views.shared.utils.hash-sign-quick-pick.quick-pick.commit.label')}`
13+
const saved_context_label = `$(checklist) ${t('views.shared.utils.hash-sign-quick-pick.quick-pick.saved-context.label')}`
14+
const skill_label = `$(thinking) ${t('views.shared.utils.hash-sign-quick-pick.quick-pick.skill.label')}`
1515

1616
export const hash_sign_quick_pick = async (params: {
1717
extension_context: vscode.ExtensionContext
@@ -21,31 +21,31 @@ export const hash_sign_quick_pick = async (params: {
2121
{
2222
label: changes_label,
2323
description: t(
24-
'views.prompt.handlers.handle-hash-sign-quick-pick.quick-pick.changes.description'
24+
'views.shared.utils.hash-sign-quick-pick.quick-pick.changes.description'
2525
)
2626
},
2727
{
2828
label: commit_label,
2929
description: t(
30-
'views.prompt.handlers.handle-hash-sign-quick-pick.quick-pick.commit.description'
30+
'views.shared.utils.hash-sign-quick-pick.quick-pick.commit.description'
3131
)
3232
},
3333
{
3434
label: saved_context_label,
3535
description: t(
36-
'views.prompt.handlers.handle-hash-sign-quick-pick.quick-pick.saved-context.description'
36+
'views.shared.utils.hash-sign-quick-pick.quick-pick.saved-context.description'
3737
)
3838
},
3939
{
4040
label: skill_label,
4141
description: t(
42-
'views.prompt.handlers.handle-hash-sign-quick-pick.quick-pick.skill.description'
42+
'views.shared.utils.hash-sign-quick-pick.quick-pick.skill.description'
4343
),
4444
buttons: [
4545
{
4646
iconPath: new vscode.ThemeIcon('globe'),
4747
tooltip: t(
48-
'views.prompt.handlers.handle-hash-sign-quick-pick.quick-pick.skill.tooltip'
48+
'views.shared.utils.hash-sign-quick-pick.quick-pick.skill.tooltip'
4949
)
5050
}
5151
]
@@ -64,11 +64,11 @@ export const hash_sign_quick_pick = async (params: {
6464
const quick_pick = vscode.window.createQuickPick()
6565
quick_pick.items = items
6666
quick_pick.placeholder = t(
67-
'views.prompt.handlers.handle-hash-sign-quick-pick.quick-pick.placeholder'
67+
'views.shared.utils.hash-sign-quick-pick.quick-pick.placeholder'
6868
)
6969
quick_pick.matchOnDescription = true
7070
quick_pick.title = t(
71-
'views.prompt.handlers.handle-hash-sign-quick-pick.quick-pick.title'
71+
'views.shared.utils.hash-sign-quick-pick.quick-pick.title'
7272
)
7373
quick_pick.buttons = [
7474
{

‎apps/editor/src/views/shared/utils/hash-sign-quick-pick/symbols/changes-symbol.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ export const handle_changes_item = async (
290290
} catch (error) {
291291
vscode.window.showErrorMessage(
292292
t(
293-
'views.prompt.handlers.handle-hash-sign-quick-pick.changes-symbol.failed-to-get-git-branches'
293+
'views.shared.utils.hash-sign-quick-pick.changes-symbol.failed-to-get-git-branches'
294294
)
295295
)
296296
return 'continue'

‎apps/editor/src/views/shared/utils/hash-sign-quick-pick/symbols/commit-symbol.ts‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export const handle_commit_item = async (
122122
if (!log_output.trim()) {
123123
vscode.window.showErrorMessage(
124124
t(
125-
'views.prompt.handlers.handle-hash-sign-quick-pick.commit-symbol.no-commits'
125+
'views.shared.utils.hash-sign-quick-pick.commit-symbol.no-commits'
126126
).replace('{0}', selected_folder.name)
127127
)
128128
if (git_folders.length > 1) {
@@ -317,7 +317,19 @@ export const handle_commit_item = async (
317317
`#${symbol}(${selected_folder.name}:${selected_commit.label} "${message}") `
318318
)
319319

320-
continue
320+
const add_another_label = t(
321+
'views.shared.utils.hash-sign-quick-pick.quick-pick.commit.add-another'
322+
)
323+
const action = await vscode.window.showInformationMessage(
324+
t('views.shared.utils.hash-sign-quick-pick.quick-pick.commit.added'),
325+
add_another_label
326+
)
327+
328+
if (action === add_another_label) {
329+
continue
330+
}
331+
332+
return undefined
321333
}
322334

323335
if (go_back_to_folders) {
@@ -329,7 +341,7 @@ export const handle_commit_item = async (
329341
} catch (error) {
330342
vscode.window.showErrorMessage(
331343
t(
332-
'views.prompt.handlers.handle-hash-sign-quick-pick.commit-symbol.failed-to-get-commits'
344+
'views.shared.utils.hash-sign-quick-pick.commit-symbol.failed-to-get-commits'
333345
)
334346
)
335347
return 'continue'

‎apps/editor/src/views/shared/utils/hash-sign-quick-pick/symbols/saved-context-symbol.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export const handle_saved_context_item = async (
215215
} catch (error) {
216216
vscode.window.showErrorMessage(
217217
t(
218-
'views.prompt.handlers.handle-hash-sign-quick-pick.saved-context-symbol.failed-to-load'
218+
'views.shared.utils.hash-sign-quick-pick.saved-context-symbol.failed-to-load'
219219
)
220220
)
221221
return 'continue'

‎apps/editor/src/views/shared/utils/hash-sign-quick-pick/symbols/skill-symbol.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,7 @@ export const handle_skill_item = async (): Promise<
259259

260260
if (detected_agents.length == 0) {
261261
vscode.window.showInformationMessage(
262-
t(
263-
'views.prompt.handlers.handle-hash-sign-quick-pick.skill-symbol.no-agents'
264-
)
262+
t('views.shared.utils.hash-sign-quick-pick.skill-symbol.no-agents')
265263
)
266264
return 'continue'
267265
}
@@ -338,7 +336,7 @@ export const handle_skill_item = async (): Promise<
338336
if (skills.length == 0) {
339337
vscode.window.showInformationMessage(
340338
t(
341-
'views.prompt.handlers.handle-hash-sign-quick-pick.skill-symbol.no-skills'
339+
'views.shared.utils.hash-sign-quick-pick.skill-symbol.no-skills'
342340
).replace('{0}', agent.display_name)
343341
)
344342
continue

0 commit comments

Comments
 (0)