Skip to content

Commit bcc3d79

Browse files
images that have been removed/added in candidate or that are identical are now collapsed in <detail> containers
1 parent d2e2377 commit bcc3d79

1 file changed

Lines changed: 37 additions & 26 deletions

File tree

templates/report.html

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,24 @@
1010
gap: 1rem;
1111
margin: 1rem 0;
1212
}
13-
1413
.diff-images img {
1514
max-width: 30vw;
1615
height: auto;
1716
}
17+
details {
18+
margin-bottom: 1em;
19+
}
20+
summary {
21+
cursor: pointer;
22+
font-size: 1.17em;
23+
font-weight: bold;
24+
}
1825
</style>
1926
</head>
2027
<body>
2128
<main>
2229
<h1>Visual Diff Report</h1>
23-
2430
<p><strong>Status:</strong> <span aria-hidden="true">{{statusEmoji}}</span> {{statusText}}</p>
25-
2631
<h2>Summary</h2>
2732
<ul>
2833
<li><strong>Total Images:</strong> {{totalImages}}</li>
@@ -32,7 +37,7 @@ <h2>Summary</h2>
3237
<li><strong>Identical:</strong> {{identicalCount}}</li>
3338
</ul>
3439

35-
{{#if withDifferences.length}}
40+
{{#if withDifferences.length}}
3641
<h2>Images with Differences ({{withDifferences.length}})</h2>
3742
{{#each withDifferences}}
3843
<div>
@@ -49,36 +54,42 @@ <h3>{{name}}</h3>
4954
</div>
5055
</div>
5156
{{/each}}
52-
{{/if}}
57+
{{/if}}
5358

54-
{{#if hasRemovedOrAdded}}
59+
{{#if hasRemovedOrAdded}}
5560
<h2>Missing or New Files</h2>
56-
{{#if baselineOnly.length}}
57-
<h3>Removed from Candidate ({{baselineOnly.length}})</h3>
58-
<ul>
59-
{{#each baselineOnly}}
60-
<li>{{name}}</li>
61-
{{/each}}
62-
</ul>
61+
{{#if baselineOnly.length}}
62+
<details>
63+
<summary>Removed from Candidate ({{baselineOnly.length}})</summary>
64+
<ul>
65+
{{#each baselineOnly}}
66+
<li>{{name}}</li>
67+
{{/each}}
68+
</ul>
69+
</details>
70+
{{/if}}
71+
{{#if candidateOnly.length}}
72+
<details>
73+
<summary>Added in Candidate ({{candidateOnly.length}})</summary>
74+
<ul>
75+
{{#each candidateOnly}}
76+
<li>{{name}}</li>
77+
{{/each}}
78+
</ul>
79+
</details>
80+
{{/if}}
6381
{{/if}}
64-
{{#if candidateOnly.length}}
65-
<h3>Added in Candidate ({{candidateOnly.length}})</h3>
82+
83+
{{#if withoutDifferences.length}}
84+
<details>
85+
<summary>Identical Images ({{withoutDifferences.length}})</summary>
6686
<ul>
67-
{{#each candidateOnly}}
87+
{{#each withoutDifferences}}
6888
<li>{{name}}</li>
6989
{{/each}}
7090
</ul>
91+
</details>
7192
{{/if}}
72-
{{/if}}
73-
74-
{{#if withoutDifferences.length}}
75-
<h2>Identical Images ({{withoutDifferences.length}})</h2>
76-
<ul>
77-
{{#each withoutDifferences}}
78-
<li>{{name}}</li>
79-
{{/each}}
80-
</ul>
81-
{{/if}}
8293

8394
<hr>
8495
<p><em>Generated by visual-differ</em></p>

0 commit comments

Comments
 (0)