mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-13 11:00:50 +00:00
* feat(ios): add live activity connection status and cleanup Add lock-screen/Dynamic Island connection health states and prune duplicate/stale activities before reuse. This intentionally excludes AI/title generation and heavier UX rewrites from #27488. Co-authored-by: leepokai <1663017+leepokai@users.noreply.github.com> * fix(ios): treat ended live activities as inactive * chore(changelog): add PR reference and author thanks --------- Co-authored-by: leepokai <1663017+leepokai@users.noreply.github.com>
46 lines
1.2 KiB
Swift
46 lines
1.2 KiB
Swift
import ActivityKit
|
|
import Foundation
|
|
|
|
/// Shared schema used by iOS app + Live Activity widget extension.
|
|
struct OpenClawActivityAttributes: ActivityAttributes {
|
|
var agentName: String
|
|
var sessionKey: String
|
|
|
|
struct ContentState: Codable, Hashable {
|
|
var statusText: String
|
|
var isIdle: Bool
|
|
var isDisconnected: Bool
|
|
var isConnecting: Bool
|
|
var startedAt: Date
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
extension OpenClawActivityAttributes {
|
|
static let preview = OpenClawActivityAttributes(agentName: "main", sessionKey: "main")
|
|
}
|
|
|
|
extension OpenClawActivityAttributes.ContentState {
|
|
static let connecting = OpenClawActivityAttributes.ContentState(
|
|
statusText: "Connecting...",
|
|
isIdle: false,
|
|
isDisconnected: false,
|
|
isConnecting: true,
|
|
startedAt: .now)
|
|
|
|
static let idle = OpenClawActivityAttributes.ContentState(
|
|
statusText: "Idle",
|
|
isIdle: true,
|
|
isDisconnected: false,
|
|
isConnecting: false,
|
|
startedAt: .now)
|
|
|
|
static let disconnected = OpenClawActivityAttributes.ContentState(
|
|
statusText: "Disconnected",
|
|
isIdle: false,
|
|
isDisconnected: true,
|
|
isConnecting: false,
|
|
startedAt: .now)
|
|
}
|
|
#endif
|