Polish grouped scene details

This commit is contained in:
Sleeps
2026-10-07 17:04:31 +01:00
parent dc04125246
commit ad8a08de6b
+6 -4
View File
@@ -603,7 +603,8 @@
const el = document.createElement('article');
el.className = 'result';
const details = matches.map(scene => {
const otherMatches = matches.slice(1);
const details = otherMatches.map(scene => {
const score = scene.ranking_score == null
? (scene.siglip_score == null ? '—' : Number(scene.siglip_score).toFixed(3))
: Number(scene.ranking_score).toFixed(3);
@@ -613,7 +614,7 @@
}).join('');
const moreText = totalMatches > shownMatches
? ' · showing top ' + shownMatches
? ' · ' + totalMatches + ' total hits, showing top ' + shownMatches
: '';
el.innerHTML =
@@ -628,8 +629,9 @@
? (best.siglip_score == null ? '—' : Number(best.siglip_score).toFixed(3))
: Number(best.ranking_score).toFixed(3)) +
'</div>' +
(matches.length > 1
? '<details class="scene-details"><summary>View matching scenes' +
(otherMatches.length
? '<details class="scene-details"><summary>View ' + otherMatches.length +
' other matching scene' + (otherMatches.length === 1 ? '' : 's') +
moreText + '</summary>' + details + '</details>'
: '') +
'</div>';