diff --git a/pkg/service/handlers/web/index.html b/pkg/service/handlers/web/index.html
index b0fa194..801cc60 100644
--- a/pkg/service/handlers/web/index.html
+++ b/pkg/service/handlers/web/index.html
@@ -1389,6 +1389,11 @@
>
+
+ ⚠️ Large Payload: Rich diff highlighting is disabled to prevent a browser freeze. Showing raw comparison instead.
+
+
+
diffSizeThreshold || upstreamBody.length > diffSizeThreshold;
+ const warningEl = document.getElementById("diff-size-warning");
- localEl.innerHTML = "";
- upstreamEl.innerHTML = "";
+ if (isLarge && !forceRichDiff) {
+ warningEl.style.display = "block";
+ const forceBtn = document.getElementById("force-rich-diff-btn");
+ forceBtn.onclick = () => viewParityMismatch(m, true);
- diff.forEach((part) => {
- const span = document.createElement('span');
- if (part.added) {
- span.className = 'diff-added';
- span.innerText = part.value;
- upstreamEl.appendChild(span);
- } else if (part.removed) {
- span.className = 'diff-removed';
- span.innerText = part.value;
- localEl.appendChild(span);
- } else {
- localEl.appendChild(document.createTextNode(part.value));
- upstreamEl.appendChild(document.createTextNode(part.value));
- }
- });
- } else {
document.getElementById("diff-local-body").innerText = localBody;
document.getElementById("diff-upstream-body").innerText = upstreamBody;
+ } else {
+ warningEl.style.display = "none";
+ if (typeof Diff !== 'undefined') {
+ const diff = Diff.diffChars(localBody, upstreamBody);
+ const localEl = document.getElementById("diff-local-body");
+ const upstreamEl = document.getElementById("diff-upstream-body");
+
+ localEl.innerHTML = "";
+ upstreamEl.innerHTML = "";
+
+ diff.forEach((part) => {
+ const span = document.createElement('span');
+ if (part.added) {
+ span.className = 'diff-added';
+ span.innerText = part.value;
+ upstreamEl.appendChild(span);
+ } else if (part.removed) {
+ span.className = 'diff-removed';
+ span.innerText = part.value;
+ localEl.appendChild(span);
+ } else {
+ localEl.appendChild(document.createTextNode(part.value));
+ upstreamEl.appendChild(document.createTextNode(part.value));
+ }
+ });
+ } else {
+ document.getElementById("diff-local-body").innerText = localBody;
+ document.getElementById("diff-upstream-body").innerText = upstreamBody;
+ }
}
document.getElementById("parity-diff-view").style.display = "block";