Virtualize the patch-review diff renderer

Route the comment-capable diff through the same single virtualizer as
the commit diff instead of rendering every file and line at once.
This commit is contained in:
Rūdolfs Ošiņš
2026-07-03 11:28:36 +02:00
parent 41535bf32c
commit 737703422e
8 changed files with 742 additions and 773 deletions
+6 -2
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import type { CodeComments } from "@app/components/Diff.svelte";
import type { Revision } from "@bindings/cob/patch/Revision";
import type { CodeComments } from "@app/lib/diffComments";
import { cachedGetDiff, cachedListCommits } from "@app/lib/invoke";
import { pluralize } from "@app/lib/utils";
@@ -209,6 +209,10 @@
{#await cachedGetDiff(rid, { base, head, unified: 3, highlight: true })}
<span class="txt-body-m-regular">Loading…</span>
{:then diff}
<Changeset expanded={filesExpanded} {head} {diff} {codeComments} />
<!-- The patch layout already pads its content, so the diff cards don't add
their own side inset and align with the rest of the patch. -->
<div style:--diff-inset="0">
<Changeset expanded={filesExpanded} {head} {diff} {codeComments} />
</div>
{/await}
</div>