You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phase 8 of #514 lists "binary file diffs" as a robustness gap. The original concrete failure mode (UTF-8-munge of binary content in the diff viewer) was incidentally closed by #708 when it deleted readHeadContent / readWorkingContent and switched to passing git diff output verbatim to Pierre. Today binary files don't crash anything — git diff emits Binary files a/foo and b/foo differ with no @@ hunks, the server returns { hunks: [], … }, and the client renders an empty diff pane.
That's correct behavior, but it's uninformative: an empty pane is indistinguishable from "I clicked a file with no real changes." The user has to dig into the terminal to verify the file is binary and that's why they see nothing.
What ships
A small, independent change. No coupling to #807 or to virtualization.
Server
packages/integrations/git/src/review.ts — in getDiff, run git diff --numstat <ref> -- <path> alongside the existing git diff call. Numstat reports -\t-\t<path> for binary files (cheap — no extra round trip if we batch with the existing git diff).
packages/integrations/git/src/schemas.ts — extend GitDiffOutputSchema with binary: boolean (default false). When --numstat reports -\t-\t, set binary: true on the response.
packages/client/src/ui/PierreDiffView.tsx — when props.binary === true, short-circuit before calling Pierre and render a placeholder panel instead. Suggested copy: "Binary file — not displayable" with a sub-line showing the file's size delta from numstat if available, or just the path. Match the existing empty-state styling in the Code tab.
E2e
packages/tests/features/code-tab.feature — add scenarios: open a repo with a binary file change (a .png swap or a .wasm rebuild), verify the placeholder renders. Negative case: a no-op file selection still renders an empty pane (not the placeholder), so the two states stay distinguishable.
Inline image preview for binary image diffs — interesting future work, but the placeholder ships first; image preview is a separate scope decision (security model, size cap, etc.).
Rich numstat-only summaries for non-binary files — +12 −7 style. The schema change unblocks this, but it's a different UX feature.
Acceptance
A binary file in the diff list renders the placeholder instead of an empty pane.
A no-op file selection still renders an empty pane (we don't regress the "nothing to show" case into a binary placeholder).
Why
Phase 8 of #514 lists "binary file diffs" as a robustness gap. The original concrete failure mode (UTF-8-munge of binary content in the diff viewer) was incidentally closed by #708 when it deleted
readHeadContent/readWorkingContentand switched to passinggit diffoutput verbatim to Pierre. Today binary files don't crash anything —git diffemitsBinary files a/foo and b/foo differwith no@@hunks, the server returns{ hunks: [], … }, and the client renders an empty diff pane.That's correct behavior, but it's uninformative: an empty pane is indistinguishable from "I clicked a file with no real changes." The user has to dig into the terminal to verify the file is binary and that's why they see nothing.
What ships
A small, independent change. No coupling to #807 or to virtualization.
Server
packages/integrations/git/src/review.ts— ingetDiff, rungit diff --numstat <ref> -- <path>alongside the existinggit diffcall. Numstat reports-\t-\t<path>for binary files (cheap — no extra round trip if we batch with the existinggit diff).packages/integrations/git/src/schemas.ts— extendGitDiffOutputSchemawithbinary: boolean(defaultfalse). When--numstatreports-\t-\t, setbinary: trueon the response.git.onDiffChangefrom feat: Code view auto-refreshes from filesystem changes #786) inherit the new field automatically since they re-emit the same schema.Client
packages/client/src/ui/PierreDiffView.tsx— whenprops.binary === true, short-circuit before calling Pierre and render a placeholder panel instead. Suggested copy: "Binary file — not displayable" with a sub-line showing the file's size delta from numstat if available, or just the path. Match the existing empty-state styling in the Code tab.E2e
packages/tests/features/code-tab.feature— add scenarios: open a repo with a binary file change (a.pngswap or a.wasmrebuild), verify the placeholder renders. Negative case: a no-op file selection still renders an empty pane (not the placeholder), so the two states stay distinguishable.Out of scope
+12 −7style. The schema change unblocks this, but it's a different UX feature.Acceptance
Related
binaryfield automatically once the schema is updated.