Skip to content

Commit afb16e6

Browse files
committed
Enhance fix-all failed files functionality with per-file progress tracking and refine UI consistency using custom theme variables
1 parent 9f890df commit afb16e6

31 files changed

Lines changed: 363 additions & 155 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ Code Web Chat is a free and open-source AI coding toolkit. You can use CWC in **
3232

3333
## Introduction
3434

35-
With its focus on context engineering, CWC proposes a non-agentic workflow, where all the necessary for the task files, includnig useful examples, are picked with engineer's intent. Such guided model is easy to prompt and as accurate as it can get. The tool a perfect companion for all kinds of coding tasks; from mass renamings to complex features.
35+
With its focus on context engineering, CWC proposes a non-agentic workflow, where all the necessary for the task files, includnig useful examples, are picked with engineer's intent. Such guided model works well with simple prompts and as accurate as it can get. The tool is a perfect companion for all kinds of coding tasks; from mass renamings to complex features.
3636

3737
> [!TIP]
38-
> Feeling lost in the codebase? Pick context roughly, switch prompt type to _Prune context_, include your task and AI will help narrowing it down to reasonable size.
38+
> Feeling lost in the codebase? Just pick a broad context, set _Prune context_, type what you're about to do and AI will help narrow it down to a reasonable size.
3939
40-
When pair-programming with Code Web Chat you foster codebase understanding, iterate on changes easier to review, and enter the flow state like in the good old days!
40+
When pair-programming with Code Web Chat you foster codebase understanding, iterate on changes easy to review, and enter the flow state like in the good old days!
4141

4242
## Enabling autofill in browser
4343

‎apps/editor/src/views/panel/backend/message-handlers/handle-fix-all-failed-files.ts‎

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ import { Logger } from '@shared/utils/logger'
1919
import { set_file_fixed_with_intelligent_update } from '@/commands/apply-chat-response-command/utils/preview'
2020

2121
export const handle_fix_all_failed_files = async (
22-
panel_provider: PanelProvider
22+
panel_provider: PanelProvider,
23+
files_to_fix: { file_path: string; workspace_name?: string }[]
2324
): Promise<void> => {
2425
const original_states = panel_provider.context.workspaceState.get<
2526
OriginalFileState[]
@@ -36,7 +37,13 @@ export const handle_fix_all_failed_files = async (
3637
}
3738

3839
const failed_files = original_states.filter(
39-
(s) => s.apply_failed && !s.fixed_with_intelligent_update
40+
(s) =>
41+
s.apply_failed &&
42+
!s.fixed_with_intelligent_update &&
43+
files_to_fix.some(
44+
(f) =>
45+
f.file_path == s.file_path && f.workspace_name == s.workspace_name
46+
)
4047
)
4148

4249
if (failed_files.length == 0) {
@@ -72,10 +79,6 @@ export const handle_fix_all_failed_files = async (
7279
}
7380

7481
const max_concurrency = intelligent_update_config.max_concurrency ?? 4
75-
const cancel_token_source = axios.CancelToken.source()
76-
panel_provider.intelligent_update_cancel_token_sources.push(
77-
cancel_token_source
78-
)
7982

8083
const default_workspace_path =
8184
vscode.workspace.workspaceFolders?.[0]?.uri.fsPath
@@ -136,6 +139,13 @@ export const handle_fix_all_failed_files = async (
136139
const file_path = file_state.file_path
137140
const workspace_name = file_state.workspace_name
138141

142+
const cancel_token_source = axios.CancelToken.source()
143+
panel_provider.intelligent_update_cancel_token_sources.push({
144+
source: cancel_token_source,
145+
file_path,
146+
workspace_name
147+
})
148+
139149
panel_provider.send_message({
140150
command: 'UPDATE_FILE_PROGRESS',
141151
file_path,
@@ -268,16 +278,19 @@ export const handle_fix_all_failed_files = async (
268278
workspace_name,
269279
is_applying: false
270280
})
281+
282+
const index =
283+
panel_provider.intelligent_update_cancel_token_sources.findIndex(
284+
(s) => s.source === cancel_token_source
285+
)
286+
if (index > -1) {
287+
panel_provider.intelligent_update_cancel_token_sources.splice(
288+
index,
289+
1
290+
)
291+
}
271292
}
272293
})
273294
)
274295
}
275-
276-
const index =
277-
panel_provider.intelligent_update_cancel_token_sources.indexOf(
278-
cancel_token_source
279-
)
280-
if (index > -1) {
281-
panel_provider.intelligent_update_cancel_token_sources.splice(index, 1)
282-
}
283296
}

‎apps/editor/src/views/panel/backend/message-handlers/handle-hash-sign-quick-pick/handle-hash-sign-quick-pick.ts‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ const hash_sign_quick_pick = async (params: {
4545
},
4646
{
4747
label: skill_label,
48-
description: 'Reference an installed skill'
48+
description: 'Reference an installed skill',
49+
buttons: [
50+
{
51+
iconPath: new vscode.ThemeIcon('globe'),
52+
tooltip: 'Discover skills at skills.sh'
53+
}
54+
]
4955
}
5056
]
5157

@@ -85,6 +91,13 @@ const hash_sign_quick_pick = async (params: {
8591
quick_pick.onDidTriggerButton(() => {
8692
quick_pick.hide()
8793
})
94+
quick_pick.onDidTriggerItemButton(async (e) => {
95+
if (e.item.label === skill_label) {
96+
await vscode.env.openExternal(
97+
vscode.Uri.parse('https://skills.sh/')
98+
)
99+
}
100+
})
88101
quick_pick.onDidAccept(() => {
89102
is_accepted = true
90103
resolve(quick_pick.selectedItems[0])

‎apps/editor/src/views/panel/backend/panel-provider.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ export class PanelProvider implements vscode.WebviewViewProvider {
736736
} else if (message.command == 'REQUEST_CAN_UNDO') {
737737
handle_request_can_undo(this)
738738
} else if (message.command == 'FIX_ALL_FAILED_FILES') {
739-
await handle_fix_all_failed_files(this)
739+
await handle_fix_all_failed_files(this, message.files)
740740
} else if (
741741
message.command == 'GET_PRUNE_CONTEXT_INSTRUCTIONS_PREFIX'
742742
) {

‎apps/editor/src/views/panel/frontend/Main/MainView/MainView.module.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
> span {
3232
font-size: 12px;
33-
color: var(--vscode-descriptionForeground);
33+
color: var(--cwc-text-color-dimmed);
3434
}
3535
}
3636

‎apps/editor/src/views/panel/frontend/Panel.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,10 @@ export const Panel = () => {
603603
content: file.content
604604
})
605605
}}
606-
on_fix_all_failed={() => {
606+
on_fix_all_failed={(files) => {
607607
post_message(vscode, {
608-
command: 'FIX_ALL_FAILED_FILES'
608+
command: 'FIX_ALL_FAILED_FILES',
609+
files
609610
})
610611
}}
611612
/>

‎apps/editor/src/views/panel/types/messages.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ export interface CancelIntelligentUpdateFileInPreviewMessage extends BaseMessage
365365

366366
export interface FixAllFailedFilesMessage extends BaseMessage {
367367
command: 'FIX_ALL_FAILED_FILES'
368+
files: { file_path: string; workspace_name?: string }[]
368369
}
369370

370371
export interface CommitChangesMessage extends BaseMessage {

‎packages/ui/.storybook/styles.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
--vscode-editor-font-size: 15px;
66
--vscode-foreground: #f3eff5;
77
--vscode-errorForeground: #f48771;
8-
--vscode-descriptionForeground: rgba(243, 239, 245, 0.7);
8+
--cwc-text-color-dimmed: rgba(243, 239, 245, 0.7);
99
--vscode-icon-foreground: #c5c5c5;
1010
--vscode-focusBorder: #263354;
1111
--vscode-selection-background: rgba(243, 239, 245, 0.31);

‎packages/ui/src/components/editor/common/DropdownMenu/DropdownMenu.module.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
display: flex;
2222
justify-content: space-between;
2323
align-items: center;
24-
gap: 8px;
24+
gap: 12px;
2525
padding: 0 6px;
2626
height: 24px;
2727
cursor: pointer;

‎packages/ui/src/components/editor/common/SimpleCheckbox/SimpleCheckbox.module.scss‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
&::before {
1616
font-family: 'codicon';
1717
content: '\eab2';
18-
font-size: 13px;
18+
font-size: 15px;
1919
position: absolute;
2020
top: 50%;
2121
left: 50%;

0 commit comments

Comments
 (0)