diff --git a/app/src/main/kotlin/com/shonar/desktop/Screens.kt b/app/src/main/kotlin/com/shonar/desktop/Screens.kt index 2caee7d..34f644c 100644 --- a/app/src/main/kotlin/com/shonar/desktop/Screens.kt +++ b/app/src/main/kotlin/com/shonar/desktop/Screens.kt @@ -596,6 +596,20 @@ fun DetailScreen(state: DesktopState) { ?: emptyList() val recHits = searchTranscriptLines(transcriptLines, recQuery) + // Voice shown as SELECTED on the chips: the running job's tone first + // (chips are disabled mid-run — the selection must say which voice is + // cooking), then the current summary's tone (reopening a file shows + // the voice it was actually summarized in — sumTone resets to null on + // every navigation and used to leave Neutral falsely selected), and + // only then a fresh click with no summary yet. + val sJobNow = detail.jobs.firstOrNull { it.jobType == "summarize" } + val sSummary = detail.summary + val chipTone: String? = when { + sJobNow != null && sJobNow.status in setOf("queued", "running") -> sJobNow.tone + sSummary != null -> sSummary.tone + else -> sumTone + } + // Header stays pinned (outside the scroller): deep in a long // transcript, scrolling all the way up just to leave the page was // the complaint. Everything below scrolls as one flow. @@ -909,7 +923,7 @@ fun DetailScreen(state: DesktopState) { Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { SUMMARIZE_PERSONAS.forEach { (label, tone) -> FilterChip( - selected = sumTone == tone, + selected = chipTone == tone, enabled = voicesEnabled, onClick = { sumTone = tone @@ -975,7 +989,7 @@ fun DetailScreen(state: DesktopState) { Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) { SUMMARIZE_PERSONAS.forEach { (label, tone) -> FilterChip( - selected = sumTone == tone, + selected = chipTone == tone, enabled = voicesEnabled, onClick = { sumTone = tone