From c01e4623b7bee9a93645e377b19033d86e27285a Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Sat, 7 Mar 2026 03:03:51 +0800 Subject: [PATCH] feat: show thinking placeholder during remote send --- .../data/RemoteOpenClawRepository.kt | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/data/RemoteOpenClawRepository.kt b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/data/RemoteOpenClawRepository.kt index 7ab359e..5baf4fb 100644 --- a/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/data/RemoteOpenClawRepository.kt +++ b/composeApp/src/commonMain/kotlin/cn/xiaobai/openclawapp/data/RemoteOpenClawRepository.kt @@ -85,12 +85,21 @@ class RemoteOpenClawRepository( override fun sendMessage(sessionId: String, text: String) { val currentMessages = messageStore[sessionId].orEmpty() messageStore = messageStore + ( - sessionId to (currentMessages + ChatMessage( - id = "local-$sessionId-${currentMessages.size + 1}", - role = MessageRole.User, - text = text, - createdAt = "现在", - status = "queued", + sessionId to (currentMessages + listOf( + ChatMessage( + id = "local-user-$sessionId-${currentMessages.size + 1}", + role = MessageRole.User, + text = text, + createdAt = "现在", + status = "queued", + ), + ChatMessage( + id = "local-thinking-$sessionId-${currentMessages.size + 2}", + role = MessageRole.System, + text = "OpenClaw 正在思考中…", + createdAt = "现在", + status = "thinking", + ), )) ) }