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) } } }