diff --git a/client/src/components/HtmlFrame.tsx b/client/src/components/HtmlFrame.tsx index 52db2a26..87108212 100644 --- a/client/src/components/HtmlFrame.tsx +++ b/client/src/components/HtmlFrame.tsx @@ -15,8 +15,10 @@ import { FileText, Loader2 } from "lucide-react"; import { artifactDocument, frameSandbox } from "../lib/artifactView"; import { blobText, inlineHtml, type FetchFile } from "../lib/htmlInline"; -/** A page read by `fetchFile` is shown up to this size. */ -const HTML_MAX = 10 * 1024 * 1024; +/** A page read by `fetchFile` is shown up to this size. A self-contained + * page (a slide deck with its video and images inlined as base64) is easily + * past 10 MB; the iframe renders far larger documents than this. */ +const HTML_MAX = 64 * 1024 * 1024; export function HtmlFrame({ path, diff --git a/client/src/components/lanes/LaneDiffView.tsx b/client/src/components/lanes/LaneDiffView.tsx index ca1b9123..f7fba385 100644 --- a/client/src/components/lanes/LaneDiffView.tsx +++ b/client/src/components/lanes/LaneDiffView.tsx @@ -179,6 +179,18 @@ export function langFor(filePath: string) { } /** Tokenized line text. `emph` marks the span that actually changed. */ +/** The tail of a row the server cut down (`LaneDiffLine.elided`). */ +function Elided({ n }: { n?: number }) { + const { t, i18n } = useTranslation("lanes"); + if (!n) return null; + const size = new Intl.NumberFormat(i18n.language, { notation: "compact" }).format(n); + return ( + + {t("changes.lineElided", { size })} + + ); +} + function Code({ text, lang, emph }: { text: string; lang: string; emph?: [number, number] }) { if (emph) { const [from, to] = emph; @@ -544,6 +556,7 @@ function UnifiedLine({ {line.type === "add" ? "+" : line.type === "del" ? "-" : " "} + {bar && } @@ -621,6 +634,7 @@ function SplitLine({ /> {line ? : null} + {line ? : null} {bar && } diff --git a/client/src/components/lanes/__tests__/LaneDiffView.test.tsx b/client/src/components/lanes/__tests__/LaneDiffView.test.tsx index 3d57e841..defb2a3e 100644 --- a/client/src/components/lanes/__tests__/LaneDiffView.test.tsx +++ b/client/src/components/lanes/__tests__/LaneDiffView.test.tsx @@ -609,3 +609,26 @@ describe("LaneDiffView — line comments", () => { expect(screen.queryByTestId("diff-comment-line-1")).toBeNull(); }); }); + +describe("LaneDiffView — a row the server cut down", () => { + const CUT: LaneChangeFile = { + ...FILE, + hunks: [ + { + ...FILE.hunks[0]!, + lines: [ + { type: "del", oldLine: 1, newLine: null, text: '