fix: clip label and screen-reader announcement use one identical string
The clip bar's visible label and its aria-live announcement were two
different formats ("17:09:56 to 17:09:57 (30 / 426)" vs "Clip 368 of
426: 21:25:44 to 21:25:50"). Build one string and use it for both, and
include the section's dB prominence (as the highlight chips do):
17:09:56 to 17:09:57 · +30 dB (30 / 426)
The dB moves out of the hover tooltip into the spoken/visible label.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+8
-5
@@ -363,18 +363,21 @@ function playClip(i) {
|
||||
+ '&start=' + cs.toFixed(1) + '&end=' + ce.toFixed(1);
|
||||
a.play().catch(() => {});
|
||||
// Label = wall-clock time of occurrence (absStart from the filename clock);
|
||||
// falls back to in-file offsets for non-standard filenames.
|
||||
// falls back to in-file offsets for non-standard filenames. The visible
|
||||
// label and the screen-reader announcement use one identical string:
|
||||
// "17:09:56 to 17:09:57 · +30 dB (30 / 426)".
|
||||
const when = c.absStart != null
|
||||
? `${fmtClock(c.absStart)} to ${fmtClock(c.absStart + (c.end - c.start))}`
|
||||
: `${fmtDur(c.start)} to ${fmtDur(c.end)}`;
|
||||
const score = c.score != null ? ` · +${Math.round(c.score)} dB` : '';
|
||||
const text = `${when}${score} (${i + 1} / ${clipQueue.length})`;
|
||||
const label = document.getElementById('clip-label');
|
||||
label.textContent = `${when} (${i + 1} / ${clipQueue.length})`;
|
||||
label.title = `${c.filename} @ ${fmtDur(c.start)}–${fmtDur(c.end)}`
|
||||
+ (c.score != null ? ` · +${Math.round(c.score)} dB` : '');
|
||||
label.textContent = text;
|
||||
label.title = `${c.filename} @ ${fmtDur(c.start)}–${fmtDur(c.end)}`;
|
||||
document.getElementById('clip-bar').hidden = false;
|
||||
document.body.classList.add('clip-open');
|
||||
setCutFields(c.fileIdx, c.start, c.end);
|
||||
announce(`Clip ${i + 1} of ${clipQueue.length}: ${when}`);
|
||||
announce(text);
|
||||
}
|
||||
|
||||
function hideClipBar() {
|
||||
|
||||
Reference in New Issue
Block a user