Summarize always shows a percentage: the pre-token wait state read 'Summarizing… waiting for model' with no number; now 'Summarizing… 0% waiting for model' everywhere it appears (jobProgress, both detail labels, reprocess initial busy). Tests updated.
This commit is contained in:
parent
50d5a0c982
commit
8586bc2476
3 changed files with 10 additions and 8 deletions
|
|
@ -1514,7 +1514,8 @@ class DesktopState(private val appDir: File = defaultAppDir()) {
|
|||
pollJob = scope.launch {
|
||||
synchronized(runningGate) { runningSet += d0.file.name }
|
||||
try {
|
||||
d0.busy = if (job == "transcribe") "Re-transcribing…" else "Summarizing…"
|
||||
d0.busy = if (job == "transcribe") "Re-transcribing…"
|
||||
else "Summarizing… 0%"
|
||||
d0.uploadProgress = null
|
||||
d0.error = null
|
||||
_detail.value = d0.copy()
|
||||
|
|
@ -1669,9 +1670,10 @@ class DesktopState(private val appDir: File = defaultAppDir()) {
|
|||
if (s.progress != null)
|
||||
LiveProgress("summarizing… ${s.progress}%", s.progress / 100f)
|
||||
// No tokens yet: the LLM is cold or the server is busy
|
||||
// queueing. Saying so (and for how long) beats a bar
|
||||
// that looks frozen.
|
||||
else LiveProgress("summarizing… waiting for model" +
|
||||
// queueing. Still show a number (0%) — a summarize must
|
||||
// always display a percentage (user request) — plus the
|
||||
// reason and wait time so 0% doesn't look frozen.
|
||||
else LiveProgress("summarizing… 0% waiting for model" +
|
||||
waitSuffix(s.startedAt, nowMs), null)
|
||||
else -> null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -779,7 +779,7 @@ fun DetailScreen(state: DesktopState) {
|
|||
val label = when {
|
||||
it.status == "running" && it.progress != null ->
|
||||
"Summarizing… ${it.progress}%"
|
||||
it.status == "running" -> "Summarizing… waiting for model" +
|
||||
it.status == "running" -> "Summarizing… 0% waiting for model" +
|
||||
DesktopState.waitSuffix(it.startedAt, System.currentTimeMillis())
|
||||
else -> "Summary queued" +
|
||||
DesktopState.waitSuffix(it.createdAt, System.currentTimeMillis())
|
||||
|
|
@ -976,7 +976,7 @@ fun DetailScreen(state: DesktopState) {
|
|||
DesktopState.waitSuffix(sJob?.createdAt,
|
||||
System.currentTimeMillis())
|
||||
sProg != null && sProg > 0 -> "Summarizing… $sProg%"
|
||||
else -> "Summarizing… waiting for model" +
|
||||
else -> "Summarizing… 0% waiting for model" +
|
||||
DesktopState.waitSuffix(sJob?.startedAt,
|
||||
System.currentTimeMillis())
|
||||
})
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class JobProgressTest {
|
|||
val p = DesktopState.jobProgress(
|
||||
listOf(job("transcribe", "succeeded"), job("summarize", "running")),
|
||||
)
|
||||
assertEquals("summarizing… waiting for model", p?.label)
|
||||
assertEquals("summarizing… 0% waiting for model", p?.label)
|
||||
assertNull(p?.fraction)
|
||||
}
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ class JobProgressTest {
|
|||
.withNano(0).toString()
|
||||
val p = DesktopState.jobProgress(
|
||||
listOf(job("summarize", "running", startedIso = iso)), nowMs = t0)
|
||||
assertEquals("summarizing… waiting for model · 1:23", p?.label)
|
||||
assertEquals("summarizing… 0% waiting for model · 1:23", p?.label)
|
||||
}
|
||||
|
||||
@Test fun `waitSuffix formats and ignores unknowns`() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue