fix(live): expose full refresh busy and phase progress

Ensure full refresh marks the live projection as building before source refresh awaits, and expose phase-specific counters so language detection progress is determinate.

Covers #40 and #41.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
blomios
2026-10-08 16:20:36 +02:00
parent 09bdaa3ec1
commit ddd7a3f295
7 changed files with 139 additions and 25 deletions

View File

@ -12,15 +12,15 @@
function progressValues(status, phase) {
if (phase === 'laya_identity') {
return {
processed: status.layaProcessed ?? status.phaseProcessed ?? status.batchProcessed ?? status.processedBatches,
total: status.layaTotal ?? status.phaseTotal ?? status.batchTotal ?? status.totalBatches,
processed: status.phaseProcessed ?? status.layaProcessed ?? status.batchProcessed ?? status.processedBatches,
total: status.phaseTotal ?? status.layaTotal ?? status.batchTotal ?? status.totalBatches,
prefix: 'AI batch'
};
}
if (phase === 'laya_language') {
return {
processed: status.languageProcessed,
total: status.languageTotal,
processed: status.phaseProcessed ?? status.layaProcessed ?? status.languageProcessed,
total: status.phaseTotal ?? status.layaTotal ?? status.languageTotal,
prefix: 'Language batch'
};
}
@ -66,7 +66,7 @@
const progressText = ['writing', 'writing_epg_matches'].includes(phase) && busy
? 'Finalizing…'
: progressPercent === null
? (busy ? 'In progress…' : '')
? (busy ? 'In progress — this step may take several minutes.' : '')
: progress.prefix
? `${progress.prefix} ${processed} of ${total} · ${progressPercent}%`
: `${processed} of ${total}${progress.suffix || ''} · ${progressPercent}%`;