Files
nucleic-remote-ios/NucleicRemote/Shared/SessionActivityAttributes.swift
T

23 lines
985 B
Swift
Raw Normal View History

import ActivityKit
import Foundation
/// The one aggregate Live Activity (UX_IOS §5.3, aggregate per §11.4 — a single Activity
/// respects iOS's budget better than one per session): "N running, M waiting" plus the most
/// urgent session's title. Shared between the app (which starts/updates it) and the widget
/// extension (which renders it).
struct NucleicSessionAttributes: ActivityAttributes {
struct ContentState: Codable, Hashable {
/// Sessions actively working a turn.
var runningCount: Int
/// Sessions blocked on the user (approval or next prompt) — the loud number.
var needsYouCount: Int
/// The most urgent session's title: the top waiting one, else the busiest running.
var topTitle: String?
/// Whether `topTitle` is waiting on the user (amber) vs just running (blue).
var topNeedsYou: Bool
}
/// The paired Mac's name (static for the Activity's lifetime).
var hostName: String
}