diff --git a/asuka.json b/asuka.json index 36b0c2a..efc0028 100644 --- a/asuka.json +++ b/asuka.json @@ -1,7 +1,7 @@ { "name": "OpenChamber", "id": "com.openchamber.native", - "version": "0.1.7", - "build": 8, + "version": "0.1.8", + "build": 9, "orientations": ["portrait", "landscape"] } diff --git a/internal/appui/chat.go b/internal/appui/chat.go index cbcf0a6..0e43b03 100644 --- a/internal/appui/chat.go +++ b/internal/appui/chat.go @@ -176,6 +176,20 @@ func (ch *chat) turnDuration(id string) string { break } } + if start <= 0 { + // The prompt fell outside the loaded page (a long turn). Measure + // from the first record of this run instead, so historical turns + // still show a duration. + j := idx + for j > 0 { + prev := msgs[j-1].Type + if prev == "user" || prev == "synthetic" { + break + } + j-- + } + start = msgs[j].Time.Created + } if start <= 0 || msgs[idx].Time.Completed <= start { return "" }