Skip to content

Commit 5144b25

Browse files
mcintyre94claude
andcommitted
Fix chat showing thinking shimmer instead of reconnecting state on reopen
When reopening a chat closed mid-session, the app was showing the "Thinking…" shimmer instead of the reconnecting state. Two bugs: 1. reconnectToServiceLogs set status = .reconnecting then immediately overwrote it with status = .streaming before starting log replay, so the reconnecting state was never actually visible. 2. The ThinkingShimmerView condition only checked isStreaming, which returns true for .reconnecting, causing the shimmer to show with a misleading "Thinking…" label. Fix: keep status = .reconnecting throughout log replay and suppress the shimmer during reconnect, letting the status bar pill handle it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 543d38e commit 5144b25

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Wisp/ViewModels/ChatViewModel.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ enum ChatStatus: Sendable {
1717
if case .connecting = self { return true }
1818
return false
1919
}
20+
21+
var isReconnecting: Bool {
22+
if case .reconnecting = self { return true }
23+
return false
24+
}
2025
}
2126

2227
struct AttachedFile: Identifiable {
@@ -994,7 +999,6 @@ final class ChatViewModel {
994999
serviceName: serviceName
9951000
)
9961001

997-
status = .streaming
9981002
let streamResult = await processServiceStream(
9991003
stream: stream,
10001004
modelContext: modelContext

Wisp/Views/SpriteDetail/Chat/ChatView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct ChatView: View {
3636
ForEach(viewModel.messages) { message in
3737
messageView(message)
3838
}
39-
if viewModel.isStreaming && viewModel.pendingWispAskCard == nil {
39+
if viewModel.isStreaming && !viewModel.status.isReconnecting && viewModel.pendingWispAskCard == nil {
4040
ThinkingShimmerView(label: viewModel.status.isConnecting ? "Connecting…" : (viewModel.activeToolLabel ?? "Thinking…"))
4141
.transition(.opacity.combined(with: .move(edge: .bottom)))
4242
.id("shimmer")

0 commit comments

Comments
 (0)