Keep the clicked voice chip selected while its summarize job runs
Chips are disabled during a run, so selection followed the previous summary's voice while the new job churned — Neutral grayed out next to a highlighted sarcastic even though sarcastic was what was running. Selection now prefers the running job's tone, then the live draft, then the saved summary.
This commit is contained in:
parent
11bb13cb3d
commit
d1a85bb6d0
1 changed files with 16 additions and 2 deletions
|
|
@ -596,6 +596,20 @@ fun DetailScreen(state: DesktopState) {
|
||||||
?: emptyList()
|
?: emptyList()
|
||||||
val recHits = searchTranscriptLines(transcriptLines, recQuery)
|
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
|
// Header stays pinned (outside the scroller): deep in a long
|
||||||
// transcript, scrolling all the way up just to leave the page was
|
// transcript, scrolling all the way up just to leave the page was
|
||||||
// the complaint. Everything below scrolls as one flow.
|
// the complaint. Everything below scrolls as one flow.
|
||||||
|
|
@ -909,7 +923,7 @@ fun DetailScreen(state: DesktopState) {
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||||
SUMMARIZE_PERSONAS.forEach { (label, tone) ->
|
SUMMARIZE_PERSONAS.forEach { (label, tone) ->
|
||||||
FilterChip(
|
FilterChip(
|
||||||
selected = sumTone == tone,
|
selected = chipTone == tone,
|
||||||
enabled = voicesEnabled,
|
enabled = voicesEnabled,
|
||||||
onClick = {
|
onClick = {
|
||||||
sumTone = tone
|
sumTone = tone
|
||||||
|
|
@ -975,7 +989,7 @@ fun DetailScreen(state: DesktopState) {
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||||
SUMMARIZE_PERSONAS.forEach { (label, tone) ->
|
SUMMARIZE_PERSONAS.forEach { (label, tone) ->
|
||||||
FilterChip(
|
FilterChip(
|
||||||
selected = sumTone == tone,
|
selected = chipTone == tone,
|
||||||
enabled = voicesEnabled,
|
enabled = voicesEnabled,
|
||||||
onClick = {
|
onClick = {
|
||||||
sumTone = tone
|
sumTone = tone
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue