fix(vscode): repair apply_patch tool display (#7682)

* fix(vscode): repair apply_patch tool display

* fix(vscode): preserve apply_patch diff metadata
This commit is contained in:
Marius
2026-03-26 13:22:53 +01:00
committed by GitHub
parent 6a8f852356
commit 8a17cd73ce
2 changed files with 3 additions and 4 deletions
@@ -2063,7 +2063,6 @@ ToolRegistry.register({
path={file().relativePath.includes("/") ? getDirectory(file().relativePath) : undefined}
changes={{ additions: file().additions, deletions: file().deletions }}
animate={reveal()}
soft
onClick={
data.openFile && file().filePath
? (e: MouseEvent) => {
@@ -6,7 +6,7 @@
*/
/** Strip a filediff down to path + addition/deletion counts. */
function slimMeta(meta: unknown): Record<string, unknown> | undefined {
function slimEditMeta(meta: unknown): Record<string, unknown> | undefined {
if (!meta || typeof meta !== "object") return undefined
const obj = meta as Record<string, unknown>
@@ -30,7 +30,7 @@ function slimMeta(meta: unknown): Record<string, unknown> | undefined {
return result
}
/** Strip heavy metadata from a single edit tool part; pass-through for all other part types. */
/** Strip heavy metadata from a single edit tool part; pass-through for everything else. */
export function slimPart<T>(part: T): T {
if (!part || typeof part !== "object") return part
@@ -41,7 +41,7 @@ export function slimPart<T>(part: T): T {
if (!state || typeof state !== "object") return part
const next = { ...(state as Record<string, unknown>) }
const meta = slimMeta(next.metadata)
const meta = slimEditMeta(next.metadata)
if (meta) next.metadata = meta
else delete next.metadata