Skip to content

Commit 3adfd46

Browse files
committed
webview-ui: per-hunk diff highlighting (no cache); replace inline counter colors with VS Code theme classes; use typed diffStats in ChatRow
1 parent 1ff1032 commit 3adfd46

File tree

6 files changed

+561
-120
lines changed

6 files changed

+561
-120
lines changed

webview-ui/src/components/chat/ChatRow.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ export const ChatRowContent = ({
338338
// Unified diff content (provided by backend when relevant)
339339
const unifiedDiff = useMemo(() => {
340340
if (!tool) return undefined
341-
return ((tool as any).content ?? (tool as any).diff) as string | undefined
341+
return (tool.content ?? tool.diff) as string | undefined
342342
}, [tool])
343343

344344
const followUpData = useMemo(() => {
@@ -402,7 +402,7 @@ export const ChatRowContent = ({
402402
isLoading={message.partial}
403403
isExpanded={isExpanded}
404404
onToggleExpand={handleToggleExpand}
405-
diffStats={(tool as any).diffStats ?? undefined}
405+
diffStats={tool.diffStats}
406406
/>
407407
</div>
408408
</>
@@ -440,7 +440,7 @@ export const ChatRowContent = ({
440440
isLoading={message.partial}
441441
isExpanded={isExpanded}
442442
onToggleExpand={handleToggleExpand}
443-
diffStats={(tool as any).diffStats ?? undefined}
443+
diffStats={tool.diffStats}
444444
/>
445445
</div>
446446
</>
@@ -474,7 +474,7 @@ export const ChatRowContent = ({
474474
isLoading={message.partial}
475475
isExpanded={isExpanded}
476476
onToggleExpand={handleToggleExpand}
477-
diffStats={(tool as any).diffStats ?? undefined}
477+
diffStats={tool.diffStats}
478478
/>
479479
</div>
480480
</>
@@ -506,7 +506,7 @@ export const ChatRowContent = ({
506506
return (
507507
<UpdateTodoListToolBlock
508508
todos={todos}
509-
content={(tool as any).content}
509+
content={tool.content}
510510
onChange={(updatedTodos) => {
511511
if (typeof vscode !== "undefined" && vscode?.postMessage) {
512512
vscode.postMessage({ type: "updateTodoList", payload: { todos: updatedTodos } })
@@ -543,7 +543,7 @@ export const ChatRowContent = ({
543543
isExpanded={isExpanded}
544544
onToggleExpand={handleToggleExpand}
545545
onJumpToFile={() => vscode.postMessage({ type: "openFile", text: "./" + tool.path })}
546-
diffStats={(tool as any).diffStats ?? undefined}
546+
diffStats={tool.diffStats}
547547
/>
548548
</div>
549549
</>

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,8 @@ const CodeAccordian = ({
8282
{/* Prefer diff stats over generic progress indicator if available */}
8383
{hasValidStats ? (
8484
<div className="flex items-center gap-2 mr-1">
85-
<span className="text-xs font-medium" style={{ color: "var(--vscode-charts-green)" }}>
86-
+{derivedStats!.added}
87-
</span>
88-
<span className="text-xs font-medium" style={{ color: "var(--vscode-charts-red)" }}>
89-
-{derivedStats!.removed}
90-
</span>
85+
<span className="text-xs font-medium text-vscode-charts-green">+{derivedStats!.added}</span>
86+
<span className="text-xs font-medium text-vscode-charts-red">-{derivedStats!.removed}</span>
9187
</div>
9288
) : (
9389
progressStatus &&

0 commit comments

Comments
 (0)