From ca3ce3adcbf2d920b363b89828152c6047f7274b Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Sat, 27 Jun 2026 22:47:19 +0200 Subject: [PATCH] fix: live-update Speed and WPM cells during benchmark run (v1.12.11) Previously the bench/wpm cells only updated after loadVoiceLibrary() at the end of the full batch. Now each row is patched in-place immediately after its voice finishes, for both batch and single-voice benchmarks. Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 7 +++++++ static/index.html | 4 ++-- static/js/voice-library.js | 29 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad1dddc..b76c72a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi --- +## [1.12.11] — 2026-06-27 + +### Fixed +- **Speed and WPM cells now update live** during a benchmark run — each row's cells are patched in-place immediately after its voice finishes, without waiting for the full batch to complete and the list to re-render. Same fix applied to the single-voice "Benchmark this voice" button. + +--- + ## [1.12.10] — 2026-06-27 ### Added diff --git a/static/index.html b/static/index.html index bad045a..8ff9591 100644 --- a/static/index.html +++ b/static/index.html @@ -26,7 +26,7 @@ - + @@ -336,7 +336,7 @@ - + diff --git a/static/js/voice-library.js b/static/js/voice-library.js index 745aa57..84c3b49 100644 --- a/static/js/voice-library.js +++ b/static/js/voice-library.js @@ -833,6 +833,20 @@ async function runVoiceBenchmarkBatch() { stats.ok++; if (b.realtime_ok === false) stats.slow++; stats.last = `${voice.id}: ${Number(b.elapsed_sec || 0).toFixed(1)}s${b.speed != null ? ` · ${Number(b.speed).toFixed(2)}x` : ''}${b.realtime_ok === false ? ' · slow' : ''}`; + // Live-update the row cells so results appear immediately + if (row) { + const benchCell = row.querySelector('.vl-tbl-bench'); + const wpmCell = row.querySelector('.vl-tbl-wpm'); + if (benchCell) { + const bt = fmtBenchmark(voice), bc = benchmarkClass(voice), btitle = benchmarkTitle(voice); + benchCell.innerHTML = bt !== '-' ? ` ${escHtml(bt)}` : '-'; + } + if (wpmCell) { + const wpm = voiceWpm(voice); + wpmCell.textContent = fmtWpm(voice); + wpmCell.title = wpm != null ? `${wpm} wpm — 130–180 wpm is natural for long listening` : ''; + } + } } else { stats.errors++; stats.last = `${voice.id}: failed${b && b.error ? ' · ' + b.error : ''}`; @@ -2927,6 +2941,21 @@ function makeVoiceRow(v) { benchCell.className = 'vr-bench ' + benchmarkClass(v); benchCell.title = benchmarkTitle(v); benchCell.querySelector('.vr-bench-value').textContent = fmtBenchmark(v); + // Also update the table row cells + const tblRow = document.querySelector(`.vl-row[data-id="${CSS.escape(v.id)}"]`); + if (tblRow) { + const tblBench = tblRow.querySelector('.vl-tbl-bench'); + const tblWpm = tblRow.querySelector('.vl-tbl-wpm'); + if (tblBench) { + const bt = fmtBenchmark(v), bc = benchmarkClass(v), btitle = benchmarkTitle(v); + tblBench.innerHTML = bt !== '-' ? ` ${escHtml(bt)}` : '-'; + } + if (tblWpm) { + const wpm = voiceWpm(v); + tblWpm.textContent = fmtWpm(v); + tblWpm.title = wpm != null ? `${wpm} wpm — 130–180 wpm is natural for long listening` : ''; + } + } setBenchmarkProgress(1, 1, `Finished ${v.id}`); toast('Benchmarked ' + v.id, 'success'); setVoiceRestartState(false, 'Benchmark saved for ' + v.id);