From 180b5947490e2b7423472bfb167bcef4950a4ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Tue, 1 Dec 2026 11:33:37 +0100 Subject: [PATCH] explorer: Show files httpd did not diff as too large httpd marks files it does not diff because of their size with `"tooLarge": true` on their binary diff content. Show them as "Diff too large" instead of "Binary file", which they usually are not. When httpd leaves out files, say how many are not shown, and take the number of changed files in the summary from the stats, which count every file. --- explorer/http-client/lib/repo/commit.ts | 3 ++- explorer/src/views/repos/Changeset.svelte | 25 ++++++++++++++++++- .../src/views/repos/Changeset/FileDiff.svelte | 4 +++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/explorer/http-client/lib/repo/commit.ts b/explorer/http-client/lib/repo/commit.ts index 8234b6570..51eb761cb 100644 --- a/explorer/http-client/lib/repo/commit.ts +++ b/explorer/http-client/lib/repo/commit.ts @@ -133,7 +133,7 @@ const diffContentSchema = discriminatedUnion("type", [ literal("bothMissing"), ]), }), - object({ type: literal("binary") }), + object({ type: literal("binary"), tooLarge: boolean().optional() }), object({ type: literal("empty") }), ]); const diffChangesetSchema = object({ @@ -225,6 +225,7 @@ const diffSchema = object({ insertions: number(), deletions: number(), }), + truncated: boolean().optional(), }); type Commit = z.infer; diff --git a/explorer/src/views/repos/Changeset.svelte b/explorer/src/views/repos/Changeset.svelte index 04134214e..7a1b6a319 100644 --- a/explorer/src/views/repos/Changeset.svelte +++ b/explorer/src/views/repos/Changeset.svelte @@ -6,6 +6,7 @@ import IconButton from "@app/components/IconButton.svelte"; import Icon from "@app/components/Icon.svelte"; import Observer, { intersection } from "@app/components/Observer.svelte"; + import Placeholder from "@app/components/Placeholder.svelte"; export let diff: Diff | undefined = undefined; export let files: Record | undefined = undefined; @@ -15,6 +16,10 @@ let expanded = true; + $: filesLeftOut = diff?.truncated + ? diff.stats.filesChanged - diff.files.length + : 0; + function pluralize(singular: string, count: number): string { return count === 1 ? singular : `${singular}s`; } @@ -63,6 +68,9 @@ border-radius: var(--border-radius-md); overflow: clip; } + .files-left-out { + padding: 0.5rem 0 1rem 0; + } .summary { font: var(--txt-body-m-regular); } @@ -76,7 +84,14 @@ {#if diff}
- {diffDescription(diff.files)} + + {#if filesLeftOut > 0} + {diff.stats.filesChanged} + {pluralize("file", diff.stats.filesChanged)} changed + {:else} + {diffDescription(diff.files)} + {/if} + with 0}> {diff.stats.insertions} @@ -135,5 +150,13 @@
{/each} + {#if filesLeftOut > 0} +
+ +
+ {/if}
{/if} diff --git a/explorer/src/views/repos/Changeset/FileDiff.svelte b/explorer/src/views/repos/Changeset/FileDiff.svelte index 967d3e145..9a90549ba 100644 --- a/explorer/src/views/repos/Changeset/FileDiff.svelte +++ b/explorer/src/views/repos/Changeset/FileDiff.svelte @@ -549,6 +549,10 @@ title="The file may be too large for the seed node to serve, or it failed to load."> + {:else if fileDiff.type === "binary" && fileDiff.tooLarge} +
+ +
{:else}