Picker: relabel "bad ROIs" → "only ROIs" in user-facing strings

Both the annotation-bar tooltip and the post-submit flash message
now show the positive sense ("only ROIs 2,4,6") instead of the
negative ("bad ROIs 1,3,5"). The CSV column stays bad_rois — the
flip is purely cosmetic.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Giorgio Gilestro 2026-05-01 14:33:11 +01:00
parent d314c02d05
commit 5d50c8baaf

View file

@ -288,6 +288,15 @@
progress.textContent = `${done}/${queue.length} done`; progress.textContent = `${done}/${queue.length} done`;
} }
// Reason: the CSV stores `bad_rois` (those that didn't open). The
// user-facing label flips this to the positive sense — "only ROIs X"
// are the usable ones. Empty bad_rois means all ROIs are usable.
function onlyRoisFromBad(badStr) {
if (!badStr) return '';
const bad = new Set(String(badStr).split(',').map(s => parseInt(s.trim())));
return [1,2,3,4,5,6].filter(r => !bad.has(r)).join(',');
}
function renderAnnotationBar(item) { function renderAnnotationBar(item) {
const bar = document.getElementById('annotation-bar'); const bar = document.getElementById('annotation-bar');
bar.innerHTML = ''; bar.innerHTML = '';
@ -326,7 +335,8 @@
tooltip.className = 'mark-tooltip'; tooltip.className = 'mark-tooltip';
const m = Math.floor(ex.opening_s / 60); const m = Math.floor(ex.opening_s / 60);
const s = (ex.opening_s % 60).toFixed(1); const s = (ex.opening_s % 60).toFixed(1);
const tag = ex.bad_rois ? ` · bad ROIs ${ex.bad_rois}` : ''; const only = onlyRoisFromBad(ex.bad_rois);
const tag = only ? ` · only ROIs ${only}` : '';
const who = ex.analyst ? ` · ${ex.analyst}` : ''; const who = ex.analyst ? ` · ${ex.analyst}` : '';
tooltip.textContent = `${m}:${s.padStart(4,'0')}${who}${tag}`; tooltip.textContent = `${m}:${s.padStart(4,'0')}${who}${tag}`;
// Position tooltip; if mark is near right edge, anchor right. // Position tooltip; if mark is near right edge, anchor right.
@ -422,11 +432,11 @@
item.done = true; item.done = true;
updateProgress(); updateProgress();
const t = result.row.opening_s; const t = result.row.opening_s;
const bad = result.row.bad_rois; const only = onlyRoisFromBad(result.row.bad_rois);
showFlash( showFlash(
`saved ${item.machine_name} ${item.session_date} ${item.session_time}: ` + `saved ${item.machine_name} ${item.session_date} ${item.session_time}: ` +
(Number.isNaN(t) || t === null ? 'unusable' : (Number.isNaN(t) || t === null ? 'unusable' :
`${t.toFixed(1)}s${bad ? ' (bad ROIs: ' + bad + ')' : ''}`) `${t.toFixed(1)}s${only ? ' (only ROIs ' + only + ')' : ''}`)
); );
} else if (result.status === 'skipped') { } else if (result.status === 'skipped') {
showFlash(`skipped ${item.machine_name} ${item.session_date} ${item.session_time}`); showFlash(`skipped ${item.machine_name} ${item.session_date} ${item.session_time}`);