fix(chat): render reasoning card inside bubble and preserve persistence (#691)

* fix(chat): render reasoning card inside bubble and preserve persistence

Move ReasoningCard inside AssistantBubble and preserve reasoningText across REST re-fetches, MessageStart, and buffer flushes.

* style(chat): resolve ktlint unused imports and blank line formatting
This commit is contained in:
M57
2026-07-23 12:04:18 +03:00
committed by GitHub
parent a5baf41545
commit bc6c8a2e68
6 changed files with 89 additions and 38 deletions
@@ -17,6 +17,8 @@ data class SessionMessage(
val content: JsonElement? = null,
val timestamp: JsonElement? = null,
val type: String? = null,
val reasoning: JsonElement? = null,
val reasoning_text: JsonElement? = null,
) {
val timestampText: String?
get() = (timestamp as? JsonPrimitive)?.content
@@ -28,4 +30,12 @@ data class SessionMessage(
null -> ""
else -> content.toString()
}
val reasoningText: String
get() =
when (val r = reasoning ?: reasoning_text) {
is JsonPrimitive -> r.content
null -> ""
else -> r.toString()
}
}