Skip to content

Commit a82ade7

Browse files
committed
Refactor API call progress messages by renaming WAITING_FOR_API_RESPONSE to WAITING_FOR_RESPONSE and update preset group quick pick logic to allow running selected presets and improve navigation
1 parent cb58fd0 commit a82ade7

10 files changed

Lines changed: 145 additions & 112 deletions

File tree

‎packages/shared/src/constants/dictionary.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const dictionary = {
22
api_call: {
3-
WAITING_FOR_API_RESPONSE: 'Waiting for API response',
3+
WAITING_FOR_RESPONSE: 'Waiting for response',
44
THINKING: 'Thinking',
55
RECEIVING_RESPONSE: 'Receiving response'
66
},

‎packages/ui/src/components/editor/panel/Dropdown/Dropdown.module.scss‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
.button {
66
display: flex;
77
align-items: center;
8-
gap: var(--padding-2px);
8+
gap: var(--padding-3px);
99
padding: 0 var(--padding-5px) 0 var(--padding-7px);
1010
height: 24px;
1111
border: 1px solid var(--cwc-border-color-dimmed);
@@ -39,7 +39,6 @@
3939

4040
&__icon {
4141
font-size: var(--font-size-14px) !important;
42-
margin-left: var(--padding-2px);
4342
color: var(--vscode-icon-foreground);
4443
}
4544
}

‎packages/ui/src/components/editor/panel/Presets/Presets.tsx‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,8 @@ export const Presets: React.FC<Presets.Props> = (props) => {
534534
}}
535535
>
536536
<IconButton
537-
codicon_icon="run-coverage"
538-
title="Run selected presets in this group"
537+
codicon_icon="run-all-coverage"
538+
title="Run selected presets"
539539
on_click={(e) => {
540540
e.stopPropagation()
541541
props.on_group_click('Ungrouped')
@@ -596,7 +596,7 @@ export const Presets: React.FC<Presets.Props> = (props) => {
596596
}}
597597
>
598598
<IconButton
599-
codicon_icon="run-coverage"
599+
codicon_icon="run-all-coverage"
600600
title="Run"
601601
on_click={(e) => {
602602
e.stopPropagation()
@@ -654,14 +654,17 @@ export const Presets: React.FC<Presets.Props> = (props) => {
654654
selected_count++
655655
}
656656
}
657-
return `${preset_count} ${
658-
preset_count == 1 ? 'preset' : 'presets'
659-
}${
660-
selected_count > 0
661-
? ` · ${selected_count} selected`
662-
: ''
663-
}`
657+
if (preset.is_collapsed) {
658+
let text = `${preset_count} ${
659+
preset_count == 1 ? 'preset' : 'presets'
660+
}`
661+
if (selected_count > 0) {
662+
text += ` · ${selected_count} selected`
663+
}
664+
return text
665+
}
664666
}
667+
665668
return model || ''
666669
}
667670

@@ -759,7 +762,7 @@ export const Presets: React.FC<Presets.Props> = (props) => {
759762
>
760763
{!preset.chatbot && (
761764
<IconButton
762-
codicon_icon="run-coverage"
765+
codicon_icon="run-all-coverage"
763766
title="Run"
764767
on_click={(e) => {
765768
e.stopPropagation()

‎packages/ui/src/components/editor/panel/ResponsePreview/components/TextItem.module.scss‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
code {
2020
font-family: monospace;
2121
font-size: var(--font-size-11px);
22-
background-color: var(--vscode-textCodeBlock-background);
2322
padding: 2px 4px;
2423
border-radius: 3px;
2524
}

‎packages/vscode/src/commands/code-completion-commands.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ const perform_code_completion = async (params: {
402402
await vscode.window.withProgress(
403403
{
404404
location: vscode.ProgressLocation.Notification,
405-
title: dictionary.api_call.WAITING_FOR_API_RESPONSE,
405+
title: dictionary.api_call.WAITING_FOR_RESPONSE,
406406
cancellable: true
407407
},
408408
async (progress, token) => {

‎packages/vscode/src/views/panel/backend/message-handlers/handle-code-completion.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ const perform_code_completion = async (params: {
372372
params.panel_provider.api_call_cancel_token_source = cancel_token_source
373373
params.panel_provider.send_message({
374374
command: 'SHOW_PROGRESS',
375-
title: `${dictionary.api_call.WAITING_FOR_API_RESPONSE}...`
375+
title: `${dictionary.api_call.WAITING_FOR_RESPONSE}...`
376376
})
377377
}
378378

‎packages/vscode/src/views/panel/backend/message-handlers/handle-commit-changes/utils/generate-commit-message-from-diff.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const generate_commit_message_with_api = async (params: {
5555
try {
5656
params.panel_provider.send_message({
5757
command: 'SHOW_PROGRESS',
58-
title: `${dictionary.api_call.WAITING_FOR_API_RESPONSE}...`
58+
title: `${dictionary.api_call.WAITING_FOR_RESPONSE}...`
5959
})
6060

6161
const result = await make_api_request({
@@ -106,7 +106,7 @@ const generate_commit_message_with_api = async (params: {
106106
return await vscode.window.withProgress(
107107
{
108108
location: vscode.ProgressLocation.Notification,
109-
title: dictionary.api_call.WAITING_FOR_API_RESPONSE,
109+
title: dictionary.api_call.WAITING_FOR_RESPONSE,
110110
cancellable: true
111111
},
112112
async (progress, token) => {

‎packages/vscode/src/views/panel/backend/message-handlers/handle-edit-context.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ const perform_context_editing = async (params: {
393393
if (params.panel_provider) {
394394
params.panel_provider.send_message({
395395
command: 'SHOW_PROGRESS',
396-
title: `${dictionary.api_call.WAITING_FOR_API_RESPONSE}...`
396+
title: `${dictionary.api_call.WAITING_FOR_RESPONSE}...`
397397
})
398398
}
399399
const result = await make_api_request({

‎packages/vscode/src/views/panel/backend/message-handlers/handle-intelligent-update-file-in-preview.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export const handle_intelligent_update_file_in_preview = async (
227227
await vscode.window.withProgress(
228228
{
229229
location: vscode.ProgressLocation.Notification,
230-
title: dictionary.api_call.WAITING_FOR_API_RESPONSE,
230+
title: dictionary.api_call.WAITING_FOR_RESPONSE,
231231
cancellable: true
232232
},
233233
async (progress, token) => {

0 commit comments

Comments
 (0)