compare: extend mismatch highlighting to embedder and generator slugs

This commit is contained in:
Michael Pilosov 2026-04-22 14:38:36 -06:00
parent 41ce5ee88a
commit 89401e3aee
4 changed files with 14 additions and 5 deletions

View File

@ -388,7 +388,7 @@ function renderHeader(panelEl, data) {
}); });
} }
// Toggle .diff on each param span where the two panels disagree. // Toggle .diff on header spans where the two panels disagree.
function markParamDiffs(metaA, metaB) { function markParamDiffs(metaA, metaB) {
if (!metaA || !metaB) return; if (!metaA || !metaB) return;
for (const { key } of PARAM_FIELDS) { for (const { key } of PARAM_FIELDS) {
@ -398,6 +398,13 @@ function markParamDiffs(metaA, metaB) {
if (span) span.classList.toggle('diff', differs); if (span) span.classList.toggle('diff', differs);
} }
} }
for (const role of ['embedder', 'generator']) {
const differs = metaA[role] !== metaB[role];
for (const panelEl of [panelElA, panelElB]) {
const span = panelEl.querySelector(`[data-role="${role}"]`);
if (span) span.classList.toggle('diff', differs);
}
}
} }
// -------- main ------------------------------------------------------------ // -------- main ------------------------------------------------------------

View File

@ -1527,7 +1527,9 @@ button.submit:disabled { background: var(--faint); border-color: var(--faint); c
font-size: 0.74rem; font-size: 0.74rem;
flex-basis: 100%; flex-basis: 100%;
} }
.compare-panel-head .panel-params .param.diff { .compare-panel-head .panel-params .param.diff,
.compare-panel-head .panel-embedder.diff,
.compare-panel-head .panel-generator.diff {
color: var(--alarm); color: var(--alarm);
font-weight: 600; font-weight: 600;
} }

View File

@ -4,7 +4,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" /> <meta name="viewport" content="width=device-width,initial-scale=1" />
<title>embedding notebook &middot; compare</title> <title>embedding notebook &middot; compare</title>
<link rel="stylesheet" href="/static/style.css?v=24" /> <link rel="stylesheet" href="/static/style.css?v=25" />
<script type="importmap"> <script type="importmap">
{ {
"imports": { "imports": {
@ -111,6 +111,6 @@
</section> </section>
<script src="/static/theme.js?v=11"></script> <script src="/static/theme.js?v=11"></script>
<script type="module" src="/static/compare.js?v=4"></script> <script type="module" src="/static/compare.js?v=5"></script>
</body> </body>
</html> </html>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" /> <meta name="viewport" content="width=device-width,initial-scale=1" />
<title>embedding notebook</title> <title>embedding notebook</title>
<link rel="stylesheet" href="/static/style.css?v=24" /> <link rel="stylesheet" href="/static/style.css?v=25" />
<script src="https://unpkg.com/htmx.org@2.0.4"></script> <script src="https://unpkg.com/htmx.org@2.0.4"></script>
<script type="importmap"> <script type="importmap">
{ {