diff --git a/scarf/Scarf iOS/Chat/ChatView.swift b/scarf/Scarf iOS/Chat/ChatView.swift index 7c6a5bd..9a81bc0 100644 --- a/scarf/Scarf iOS/Chat/ChatView.swift +++ b/scarf/Scarf iOS/Chat/ChatView.swift @@ -63,6 +63,8 @@ struct ChatView: View { .overlay { if case .failed(let msg) = controller.state { errorOverlay(msg) + } else if controller.state == .connecting { + connectingOverlay } } .sheet(item: Binding( @@ -163,6 +165,24 @@ struct ChatView: View { .background(.regularMaterial) } + /// Shown while we're opening the SSH exec channel + spawning + /// `hermes acp` + creating the ACP session. Typically ~0.5–1.5 s + /// on a warm network — silent before this overlay existed, which + /// made the app feel frozen (pass-1 M7 #3). + @ViewBuilder + private var connectingOverlay: some View { + VStack(spacing: 12) { + ProgressView() + .controlSize(.large) + Text("Connecting to \(config.displayName)…") + .font(.callout) + .foregroundStyle(.secondary) + } + .padding(24) + .background(.regularMaterial) + .clipShape(RoundedRectangle(cornerRadius: 14)) + } + @ViewBuilder private func errorOverlay(_ message: String) -> some View { VStack(spacing: 12) {