mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-18 03:27:08 +00:00
- Group the large widget into running/active sections, show up to nine sessions, and use the last human prompt as the subtitle. - Show compact status icons plus web-style relative times, right-aligned. - Mirror the per-install push key into the protected App Group container so the Live Activity extension and NSE can decrypt while the data-protection Keychain is unavailable on the Lock Screen. - Redesign the Lock Screen card and Dynamic Island compact/expanded/minimal states; Live Activities are now opt-in and recovered activities are ended when disabled. - Rename the app and widget display name to Happy Coding; bump the local build to 10. via [HAPI](https://hapi.run) Co-Authored-By: HAPI <noreply@hapi.run> Co-Authored-By: Claude Code <noreply@anthropic.com>
31 lines
1010 B
Swift
31 lines
1010 B
Swift
import Foundation
|
|
import HapiClient
|
|
import Testing
|
|
|
|
@MainActor
|
|
@Suite("Live Activity prefs")
|
|
struct LiveActivityPrefsTests {
|
|
private func makeDefaults() throws -> (UserDefaults, String) {
|
|
let suiteName = "LiveActivityPrefsTests-\(UUID().uuidString)"
|
|
let defaults = try #require(UserDefaults(suiteName: suiteName))
|
|
return (defaults, suiteName)
|
|
}
|
|
|
|
@Test func defaultsToDisabledAndRoundTrips() throws {
|
|
let (defaults, suiteName) = try makeDefaults()
|
|
defer { defaults.removePersistentDomain(forName: suiteName) }
|
|
|
|
#expect(!LiveActivityPrefs(defaults: defaults).enabled)
|
|
|
|
LiveActivityPrefs(defaults: defaults).setEnabled(true)
|
|
#expect(LiveActivityPrefs(defaults: defaults).enabled)
|
|
|
|
LiveActivityPrefs(defaults: defaults).setEnabled(false)
|
|
#expect(!LiveActivityPrefs(defaults: defaults).enabled)
|
|
}
|
|
|
|
@Test func storageKeyIsStable() {
|
|
#expect(LiveActivityPrefs.enabledKey == "settings.liveActivities")
|
|
}
|
|
}
|