Desktop: honest Transcribe/Summarize labels — 'Re-' only when the output exists; Summarize always visible, gated on transcript
This commit is contained in:
parent
0fa558b1a7
commit
5b39c1de4f
1 changed files with 21 additions and 5 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue