Detail: unmapable Summarize/transcript-save say why instead of silently doing nothing

This commit is contained in:
avi 2026-09-16 11:57:36 -05:00
commit 1dde1019e9

View file

@ -1328,7 +1328,16 @@ class DesktopState(private val appDir: File = defaultAppDir()) {
* [tone] (e.g. "sarcastic") restyles the voice; null = neutral. */ * [tone] (e.g. "sarcastic") restyles the voice; null = neutral. */
fun summarize(tone: String? = null) { fun summarize(tone: String? = null) {
val d = _detail.value ?: return val d = _detail.value ?: return
val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId ?: return val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId
if (remoteId == null) {
// No server recording and no mapping: a silent return here
// looked like a broken button (seen with a detail screen
// opened for a since-renamed/deleted file). Say what's wrong.
d.error = "This file has no server recording to summarize — " +
"press Transcribe to upload it first."
_detail.value = d.copy()
return
}
d.remoteId = remoteId d.remoteId = remoteId
reprocessInPlace(d, job = "summarize", tone = tone) reprocessInPlace(d, job = "summarize", tone = tone)
} }
@ -1342,7 +1351,13 @@ class DesktopState(private val appDir: File = defaultAppDir()) {
*/ */
fun saveTranscriptEdit(text: String) { fun saveTranscriptEdit(text: String) {
val d = _detail.value ?: return val d = _detail.value ?: return
val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId ?: return val remoteId = d.remoteId ?: loadMapping(d.file)?.recordingId
if (remoteId == null) {
d.error = "This file has no server recording to save against — " +
"press Transcribe to upload it first."
_detail.value = d.copy()
return
}
d.remoteId = remoteId d.remoteId = remoteId
if (text.isBlank() || text == d.transcript?.text) return if (text.isBlank() || text == d.transcript?.text) return
scope.launch { scope.launch {