Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

gui: drop dead getFileDiffPatchStats, build deps before lint

Pranav P5cbd0230de67
diff --git a/gui/package.json b/gui/package.json
index 9bb650bf..6f09241a 100644
--- a/gui/package.json
+++ b/gui/package.json
@@ -10,7 +10,7 @@
"gen:desktop-contracts": "cargo run --quiet --manifest-path src-tauri/Cargo.toml --example generate_desktop_contracts",
"build:deps": "bun run --filter '@codegraff/diffs' build",
"build": "bun run build:deps && bun run gen:desktop-contracts && tsc -b && vite build",
- "lint": "bun run gen:desktop-contracts && eslint .",
+ "lint": "bun run build:deps && bun run gen:desktop-contracts && eslint .",
"preview": "vite preview",
"tauri": "tauri",
"test": "bun test"
diff --git a/gui/src/components/chat/activity-results/utils/fileDiff.test.ts b/gui/src/components/chat/activity-results/utils/fileDiff.test.ts
index 23dd66bc..0dfd12c5 100644
--- a/gui/src/components/chat/activity-results/utils/fileDiff.test.ts
+++ b/gui/src/components/chat/activity-results/utils/fileDiff.test.ts
@@ -1,9 +1,8 @@
import { describe, expect, test } from "bun:test";
-import {
- buildRenderableFileDiffPatch,
- getFileDiffPatchStats,
-} from "./fileDiff";
+import { getPatchStats } from "@codegraff/diffs";
+
+import { buildRenderableFileDiffPatch } from "./fileDiff";
describe("fileDiff", () => {
test("converts excerpt-style file diffs into unified git patches", () => {
@@ -19,7 +18,7 @@ describe("fileDiff", () => {
expect(patch).toContain(" const before = true;");
expect(patch).toContain("-removed();");
expect(patch).toContain("+added();");
- expect(getFileDiffPatchStats(patch)).toEqual({ additions: 1, deletions: 1 });
+ expect(getPatchStats(patch)).toEqual({ additions: 1, deletions: 1 });
});
test("keeps surrounding edits when an excerpt contains an unparseable gap line", () => {
@@ -66,7 +65,7 @@ describe("fileDiff", () => {
test("leaves a byte-summary untouched so it routes to the placeholder path", () => {
const summary = "wrote 42 bytes to config.json";
expect(buildRenderableFileDiffPatch("config.json", summary)).toBe(summary);
- expect(getFileDiffPatchStats(summary)).toBeNull();
+ expect(getPatchStats(summary)).toBeNull();
});
test("keeps existing unified patches unchanged", () => {
@@ -80,6 +79,6 @@ describe("fileDiff", () => {
].join("\n");
expect(buildRenderableFileDiffPatch("src/example.ts", patch)).toBe(patch);
- expect(getFileDiffPatchStats(patch)).toEqual({ additions: 1, deletions: 1 });
+ expect(getPatchStats(patch)).toEqual({ additions: 1, deletions: 1 });
});
});
diff --git a/gui/src/components/chat/activity-results/utils/fileDiff.ts b/gui/src/components/chat/activity-results/utils/fileDiff.ts
index aa7e1a56..fa8c72bc 100644
--- a/gui/src/components/chat/activity-results/utils/fileDiff.ts
+++ b/gui/src/components/chat/activity-results/utils/fileDiff.ts
@@ -281,4 +281,4 @@ export function getFileDiffPatchStats(
}
return { additions, deletions };
-}
+}
\ No newline at end of file