Files
Kordant/iOS/KordantWidgets/WidgetConfigurationIntent.swift
Michael Freno e33ddf3002 feat: complete Tasks 21-28 — backend integration, security hardening, UI tests & CI
- Add Apple Sign-In backend (JWKS verification, account linking, session management)
- Implement push notification deep linking with NotificationDeepLinkRouter
- Add jailbreak detection, runtime integrity monitoring, secure enclave service
- Implement OAuth social login, token refresh, and secure logout flows
- Add image caching (memory/disk), optimizer, upload queue, async semaphore
- Implement notification analytics, type preferences, and category setup
- Expand UI test suite with UITestBase, accessibility, auth flow, performance tests
- Add CI pipeline for iOS UI tests (3 device sizes) and performance benchmarks
- Restructure Xcode project to manual groups with KordantWidgets target
- Add SwiftLint, Swift Collections/Algorithms/GoogleSignIn dependencies
- Update project.yml for XcodeGen with new targets and configurations
2026-06-02 15:01:38 -04:00

52 lines
1.6 KiB
Swift

import AppIntents
import WidgetKit
/// Severity filter for widget alert display.
enum AlertSeverityFilter: String, AppEnum {
case all
case critical
case high
static var typeDisplayRepresentation: TypeDisplayRepresentation = "Alert Severity"
static var caseDisplayRepresentations: [AlertSeverityFilter: DisplayRepresentation] = [
.all: DisplayRepresentation(
title: "All Alerts",
subtitle: "Show alerts of all severity levels"
),
.critical: DisplayRepresentation(
title: "Critical Only",
subtitle: "Only show critical alerts"
),
.high: DisplayRepresentation(
title: "High & Critical",
subtitle: "Only show high and critical alerts"
),
]
/// Returns whether an alert with the given severity string passes this filter.
func matches(severity: String) -> Bool {
switch self {
case .all:
return true
case .critical:
return severity == "critical"
case .high:
return severity == "critical" || severity == "high"
}
}
}
/// Configuration intent for Kordant widgets.
/// Allows users to filter alerts by severity from the widget gallery.
struct KordantWidgetConfigurationIntent: WidgetConfigurationIntent {
static var title: LocalizedStringResource = "Widget Configuration"
static var description: LocalizedStringResource = "Choose which alerts to display on your widget."
@Parameter(
title: "Severity Filter",
default: .all
)
var severityFilter: AlertSeverityFilter
}