{/* Summary bar */}
{diffSummary.total} file{diffSummary.total !== 1 ? "s" : ""} changed
{diffSummary.added > 0 ? (
+{diffSummary.added} added
) : null}
{diffSummary.modified > 0 ? (
~{diffSummary.modified} modified
) : null}
{diffSummary.deleted > 0 ? (
-{diffSummary.deleted} deleted
) : null}
{diffCompareMode === "first-parent" && parentsCount > 1 ? (
Compared against first parent
) : null}
{/* Truncation warning */}
{diffTruncated ? (
Showing a partial diff list due to runtime limits
{diffTruncateReason ? ` (${diffTruncateReason})` : ""}.
) : null}
{/* File list */}
{diffEntries.length ? (
{diffEntries.map((entry) => {
const href = diffHref(entry, owner, repo, refEnc, diffBaseRefEnc);
const isExpanded = Boolean(expandedByPath[entry.path]);
const isLoading = Boolean(loadingByPath[entry.path]);
const error = errorByPath[entry.path];
const patch = patchByPath[entry.path];
const meta = CHANGE_META[entry.changeType];
return (
{/* File row */}
{/* Expanded patch area */}
{isExpanded ? (
{isLoading ? (
Loading patch…
) : null}
{!isLoading && error ? (
Failed to load patch: {error}
) : null}
{!isLoading && !error && patch?.patch ? (
) : null}
{!isLoading && !error && patch && !patch.patch ? (
{patchSummary(patch)}
) : null}
) : null}
);
})}
) : (
No changed files were detected for this commit.
)}
);
}
export function initCommitDiffExpander() {
hydrateIsland