From 5b39c1de4f30c81af73c4848522da57682de05ba Mon Sep 17 00:00:00 2001 From: avi Date: Mon, 14 Sep 2026 10:19:42 -0500 Subject: [PATCH] =?UTF-8?q?Desktop:=20honest=20Transcribe/Summarize=20labe?= =?UTF-8?q?ls=20=E2=80=94=20'Re-'=20only=20when=20the=20output=20exists;?= =?UTF-8?q?=20Summarize=20always=20visible,=20gated=20on=20transcript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/kotlin/com/shonar/desktop/Screens.kt | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/desktop/app/src/main/kotlin/com/shonar/desktop/Screens.kt b/desktop/app/src/main/kotlin/com/shonar/desktop/Screens.kt index 3f42eb5..bca7d54 100644 --- a/desktop/app/src/main/kotlin/com/shonar/desktop/Screens.kt +++ b/desktop/app/src/main/kotlin/com/shonar/desktop/Screens.kt @@ -379,13 +379,29 @@ fun DetailScreen(state: DesktopState) { } Spacer(Modifier.height(4.dp)) if (detail.transcript != null || detail.reportText != null) { + // Honest labels: "Re-…" only when that output actually exists. + val report = detail.reportText + val hasTranscript = detail.transcript != null || + (report != null && !report.contains("_No transcript available._")) + val hasSummary = detail.summary != null || + (report?.contains("## Summary") == true) + val remoteKnown = state.remoteIdFor(detail.file) != null Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { - TextButton({ state.transcribe() }) { Text("Re-transcribe") } - // Summarize needs a known server recording; files that predate - // remote-id mapping (or never uploaded) don't show it. - if (state.remoteIdFor(detail.file) != null) { - TextButton({ state.summarize() }) { Text("Re-summarize") } + TextButton({ state.transcribe() }) { + Text(if (hasTranscript) "Re-transcribe" else "Transcribe") } + TextButton({ state.summarize() }, + enabled = remoteKnown && hasTranscript) { + Text(if (hasSummary) "Re-summarize" else "Summarize") + } + } + if (!remoteKnown || !hasTranscript) { + Text(if (!hasTranscript) + "Summarize unlocks once this recording has a transcript." + else + "Summarize unlocks once this file is uploaded (press Transcribe).", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant) } } }