diff --git a/app/src/main/kotlin/com/shonar/desktop/DesktopState.kt b/app/src/main/kotlin/com/shonar/desktop/DesktopState.kt index f9c75c7..2f73143 100644 --- a/app/src/main/kotlin/com/shonar/desktop/DesktopState.kt +++ b/app/src/main/kotlin/com/shonar/desktop/DesktopState.kt @@ -1542,13 +1542,16 @@ class DesktopState(private val appDir: File = defaultAppDir()) { d.busy = "Transcribing…" d.uploadProgress = null _detail.value = d.copy() - // Poll jobs until the transcribe step reaches a terminal state. + // Poll jobs until the WHOLE pipeline is terminal. Breaking on + // transcribe alone froze the screen: the last d.jobs snapshot + // still showed summarize running at 0%, and nothing refreshed + // it (or the finished summary) until the file was reopened. while (true) { delay(2000) val jobs = runCatching { parseJobs(provider.fetchJobs(ref.key)) }.getOrNull() .orEmpty() d.jobs = jobs - jobLabel(jobs)?.let { d.busy = it } + jobLabel(jobs)?.let { d.busy = it } ?: run { d.busy = null } // Mirror live progress onto the library row (same as the // pump + reprocess paths) so leaving the detail screen // doesn't make the job look dead. @@ -1556,7 +1559,8 @@ class DesktopState(private val appDir: File = defaultAppDir()) { rescanStatuses() _detail.value = d.copy() val t = jobs.firstOrNull { it.jobType == "transcribe" }?.status - if (t == null || t in TERMINAL) break + val s = jobs.firstOrNull { it.jobType == "summarize" }?.status + if ((t == null || t in TERMINAL) && (s == null || s in TERMINAL)) break } setLive(d.file.name, null) rescanStatuses()