web: run Summary Changes section with rendered/raw diff viewer (R4)

Add a collapsed-by-default Changes section to the run Summary tab and a
full-screen diff viewer, ported from the Android RunChanges/ChangeDiffViewer
wording. Pure aggregation and unified-patch parsing live in src/changes.js;
app.js wires the section/viewer and sets every server string with textContent.
Unit tests cover the header variants, kind merge, stat sums and hunk parsing;
ui-smoke captures the collapsed/expanded section, rendered and raw viewer,
paging, Escape/backdrop close, binary, truncated and a running run's header.
This commit is contained in:
2026-10-19 04:06:44 +01:00
parent 2e9ff1704f
commit 9d1745da1d
6 changed files with 1812 additions and 5 deletions
+98
View File
@@ -810,3 +810,101 @@ code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-
border: 1px solid var(--border);
background: var(--surface);
}
/* ---------------------------------------------------------------------------
Run summary Changes (parity R4): the observed-file list and the full-screen
rendered/raw diff viewer. Hand-written, the app's dark palette.
--------------------------------------------------------------------------- */
.changes { display: grid; gap: 8px; }
.changes-summary { color: var(--accent); font-weight: 600; font-size: 13px; }
.changes-note { font-size: 12px; }
.changes-empty { font-size: 13px; }
.changes-list { display: grid; gap: 4px; }
.change-row {
display: flex;
gap: 10px;
align-items: flex-start;
padding: 6px 8px;
border-radius: 8px;
cursor: pointer;
}
.change-row:hover { background: var(--surface-2); }
.change-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.change-kind { font-weight: 600; font-size: 12px; min-width: 62px; }
.change-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.change-path { overflow-wrap: anywhere; }
.change-meta { font-size: 12px; }
.change-stat { display: flex; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.stat-add { color: var(--ok); }
.stat-del { color: var(--bad); }
/* Full-screen diff viewer overlay (the artifact-viewer idiom). */
.change-viewer {
position: fixed;
inset: 0;
z-index: 30;
display: flex;
flex-direction: column;
gap: 12px;
padding: 20px;
background: rgba(0, 0, 0, 0.86);
}
.change-viewer-head { display: flex; gap: 12px; align-items: flex-start; }
.change-viewer-titles { flex: 1; min-width: 0; display: grid; gap: 2px; }
.change-viewer-title-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.change-viewer-stat { font-size: 13px; }
.change-viewer-path { overflow-wrap: anywhere; }
.change-viewer-position { font-size: 12px; }
.change-viewer-controls { display: flex; gap: 8px; align-items: center; }
.change-viewer-spacer { flex: 1; }
.change-form { font-size: 12px; }
.change-form.active { border-color: var(--accent); color: var(--accent); }
.change-form:disabled { opacity: 0.45; }
.change-page:disabled { opacity: 0.4; cursor: not-allowed; }
.change-viewer-body { flex: 1; min-height: 0; overflow: auto; display: grid; gap: 16px; align-content: start; }
.change-honest {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
padding: 32px;
text-align: center;
}
.change-raw {
margin: 0;
padding: 12px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--surface-2);
font-size: 12px;
white-space: pre;
overflow: auto;
}
.change-diff { display: grid; gap: 12px; align-content: start; }
.change-diff-stat { display: flex; gap: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.change-diff-note { font-size: 12px; }
.change-hunk { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.change-hunk-head {
padding: 4px 8px;
background: var(--surface-2);
color: var(--accent);
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 12px;
}
.change-hunk-lines { overflow-x: auto; background: var(--surface); padding: 6px 0; }
.change-line {
display: flex;
gap: 10px;
padding: 0 8px;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 12px;
white-space: pre;
}
.change-gutter { color: var(--muted); user-select: none; }
.diff-add { color: var(--ok); }
.diff-remove { color: var(--bad); }
.diff-context { color: var(--muted); }