Skip to content

Commit 1c8071b

Browse files
committed
Clean up the tool progress UX
1 parent e2bdee3 commit 1c8071b

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

src/core/diff/strategies/multi-search-replace.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,18 +368,20 @@ Only use a single line of '=======' between search and replacement content, beca
368368
getProgressStatus(toolUse: ToolUse, result?: DiffResult): ToolProgressStatus {
369369
const diffContent = toolUse.params.diff
370370
if (diffContent) {
371+
const icon = "diff-multiple"
372+
const searchBlockCount = (diffContent.match(/SEARCH/g) || []).length
371373
if (toolUse.partial) {
372374
if (diffContent.length < 1000 || (diffContent.length / 50) % 10 === 0) {
373-
return { text: `progressing ${(diffContent.match(/SEARCH/g) || []).length} blocks...` }
375+
return { icon, text: `${searchBlockCount}` }
374376
}
375377
} else if (result) {
376-
const searchBlockCount = (diffContent.match(/SEARCH/g) || []).length
377-
if (result.failParts) {
378+
if (result.failParts?.length) {
378379
return {
379-
text: `progressed ${searchBlockCount - result.failParts.length}/${searchBlockCount} blocks.`,
380+
icon,
381+
text: `${searchBlockCount - result.failParts.length}/${searchBlockCount}`,
380382
}
381383
} else {
382-
return { text: `progressed ${searchBlockCount} blocks.` }
384+
return { icon, text: `${searchBlockCount}` }
383385
}
384386
}
385387
}

src/shared/ExtensionMessage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,5 +277,6 @@ export interface HumanRelayCancelMessage {
277277
export type ClineApiReqCancelReason = "streaming_failed" | "user_cancelled"
278278

279279
export type ToolProgressStatus = {
280+
icon?: string
280281
text?: string
281282
}

webview-ui/src/components/common/CodeAccordian.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,12 @@ const CodeAccordian = ({
9999
)}
100100
<div style={{ flexGrow: 1 }}></div>
101101
{progressStatus && progressStatus.text && (
102-
<span
103-
style={{
104-
color: "var(--vscode-descriptionForeground)",
105-
borderTop: isExpanded ? "1px solid var(--vscode-editorGroup-border)" : "none",
106-
marginLeft: "auto", // Right-align the text
107-
}}>
108-
{progressStatus.text}
109-
</span>
102+
<>
103+
{progressStatus.icon && <span className={`codicon codicon-${progressStatus.icon} mr-1`} />}
104+
<span className="mr-1 ml-auto text-vscode-descriptionForeground">
105+
{progressStatus.text}
106+
</span>
107+
</>
110108
)}
111109
<span className={`codicon codicon-chevron-${isExpanded ? "up" : "down"}`}></span>
112110
</div>

0 commit comments

Comments
 (0)