Library Re-tag findings: show the physical filename under each track

User request: the re-tag diff card shows old→new metadata per track but not
the file it applies to, so a wrong match is hard to spot before applying.

The finding already carries each track's file_path (details.tracks[].file_path
from the scan) — the renderer just wasn't showing it. Now each changed track
displays its filename beneath the title, so you can eyeball that the metadata
about to be written actually belongs to that file. Skipped when the label is
already the filename (track had no title). Pure frontend display change.
This commit is contained in:
BoulderBadgeDad 2026-06-06 09:11:20 -07:00
parent d44de75906
commit cfb8cc8bd8

View file

@ -2931,13 +2931,19 @@ function _renderFindingDetail(f) {
}
// Per-track old → new diff (cap the rendered list so huge albums stay sane).
changed.slice(0, 40).forEach(t => {
const label = t.title || (t.file_path || '').split(/[\\/]/).pop();
const fname = (t.file_path || '').split(/[\\/]/).pop();
const label = t.title || fname || 'Unknown';
const rows = Object.entries(t.changes).map(([field, c]) => [
field.replace(/_/g, ' '),
`${(c.old === '' || c.old == null) ? '∅' : c.old}${c.new}`,
'highlight',
]);
html += `<div style="margin:8px 0 2px;font-weight:600">${_escFinding(label)}</div>`;
// Show the physical filename so a wrong match is easy to spot before
// applying (skip when the label already IS the filename, i.e. no title).
if (fname && fname !== label) {
html += `<div class="repair-finding-meta" style="margin:0 0 4px;opacity:.7;word-break:break-all">📄 ${_escFinding(fname)}</div>`;
}
html += _gridRows(rows);
});
if (changed.length > 40) {