Clean up old stuff & fix ui errors
Build and Push Spoon Images / quality (push) Successful in 2m22s
Build and Push Spoon Images / build-images (push) Successful in 23m10s

This commit is contained in:
Gabriel Brown
2026-06-23 14:57:05 -04:00
parent d207b8b0b8
commit a6f7ea7f78
34 changed files with 1565 additions and 551 deletions
@@ -0,0 +1,26 @@
export const extractFileDiff = (diff: string | undefined, filePath: string) => {
if (!diff?.trim() || filePath === '.') return '';
const lines = diff.split('\n');
const sections: string[][] = [];
let current: string[] | null = null;
for (const line of lines) {
if (line.startsWith('diff --git ')) {
if (current) sections.push(current);
current = [line];
continue;
}
current?.push(line);
}
if (current) sections.push(current);
const normalizedPath = filePath.replace(/^\.\/+/, '');
const section = sections.find((item) => {
const header = item[0] ?? '';
return (
header.includes(` a/${normalizedPath} `) ||
header.endsWith(` a/${normalizedPath}`) ||
header.includes(` b/${normalizedPath}`) ||
header.endsWith(` b/${normalizedPath}`)
);
});
return section?.join('\n') ?? '';
};