summaryrefslogtreecommitdiff
path: root/Hutch/Models/Todo.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-08-07 17:33:46 -0500
committerChristian Cleberg <[email protected]>2026-08-07 17:33:46 -0500
commit283fbf00fdffd64c924b6cb22c84e803b718f078 (patch)
treef6603518ba62134faa699d864003b90464930ab9 /Hutch/Models/Todo.swift
parentb2a1265cadccc34cbdab71b9ed638b908cac9f62 (diff)
downloadhutch-283fbf00fdffd64c924b6cb22c84e803b718f078.tar.gz
hutch-283fbf00fdffd64c924b6cb22c84e803b718f078.tar.bz2
hutch-283fbf00fdffd64c924b6cb22c84e803b718f078.zip
Adopt Swift 6 language mode
Flip SWIFT_VERSION to 6.0 (keeping SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor) and resolve every resulting diagnostic. Mechanical, no behaviour change: - Models: pure value types in Models/ and utility extensions (Date, DateFormatter, SRHTWebURL) marked nonisolated so the nonisolated networking layer can use them. - App Intents: stored 'static var' (title/description/openAppWhenRun/ typeDisplayRepresentation/defaultQuery/caseDisplayRepresentations) -> 'static let'; drop the invalid @retroactive on the in-module LookupType: AppEnum. - Sendable dicts: 'nil as String? as Any' -> 'nil as String? as any Sendable'. - UserDefaults: retroactive @unchecked Sendable (documented thread-safe). - WidgetKit completion handlers rebound nonisolated(unsafe) to cross into Task {}; TipStoreViewModel task handle is @ObservationIgnored nonisolated(unsafe) for its nonisolated deinit. - Tests run on @MainActor; a few constant fixtures marked nonisolated for use in @Sendable stub closures. Builds and the full suite are clean in Swift 6 mode. Roadmap updated.
Diffstat (limited to 'Hutch/Models/Todo.swift')
-rw-r--r--Hutch/Models/Todo.swift30
1 files changed, 15 insertions, 15 deletions
diff --git a/Hutch/Models/Todo.swift b/Hutch/Models/Todo.swift
index 129d4bf..d2ae889 100644
--- a/Hutch/Models/Todo.swift
+++ b/Hutch/Models/Todo.swift
@@ -3,7 +3,7 @@ import Foundation
// MARK: - Enums
/// Status of a ticket.
-enum TicketStatus: String, Codable, Sendable, CaseIterable {
+nonisolated enum TicketStatus: String, Codable, Sendable, CaseIterable {
case reported = "REPORTED"
case confirmed = "CONFIRMED"
case inProgress = "IN_PROGRESS"
@@ -30,7 +30,7 @@ enum TicketStatus: String, Codable, Sendable, CaseIterable {
}
/// Resolution of a ticket.
-enum TicketResolution: String, Codable, Sendable {
+nonisolated enum TicketResolution: String, Codable, Sendable {
case unresolved = "UNRESOLVED"
case fixed = "FIXED"
case implemented = "IMPLEMENTED"
@@ -64,7 +64,7 @@ enum TicketResolution: String, Codable, Sendable {
}
/// Authenticity of a ticket or comment.
-enum Authenticity: String, Codable, Sendable {
+nonisolated enum Authenticity: String, Codable, Sendable {
case authentic = "AUTHENTIC"
case tampered = "TAMPERED"
case unauthenticated = "UNAUTHENTICATED"
@@ -74,7 +74,7 @@ enum Authenticity: String, Codable, Sendable {
/// A label that can be applied to tickets.
/// Named `TicketLabel` to avoid collision with `SwiftUI.Label`.
-struct TicketLabel: Codable, Sendable, Identifiable, Hashable {
+nonisolated struct TicketLabel: Codable, Sendable, Identifiable, Hashable {
let id: Int
let name: String
let backgroundColor: String
@@ -83,7 +83,7 @@ struct TicketLabel: Codable, Sendable, Identifiable, Hashable {
// MARK: - Tracker ACL
-struct TrackerACLPermissions: Codable, Sendable, Hashable {
+nonisolated struct TrackerACLPermissions: Codable, Sendable, Hashable {
let browse: Bool
let submit: Bool
let comment: Bool
@@ -91,7 +91,7 @@ struct TrackerACLPermissions: Codable, Sendable, Hashable {
let triage: Bool
}
-struct TrackerACL: Codable, Sendable, Identifiable, Hashable {
+nonisolated struct TrackerACL: Codable, Sendable, Identifiable, Hashable {
let id: Int
let created: Date
let entity: Entity
@@ -112,7 +112,7 @@ struct TrackerACL: Codable, Sendable, Identifiable, Hashable {
}
}
-struct DefaultTrackerACL: Codable, Sendable, Hashable {
+nonisolated struct DefaultTrackerACL: Codable, Sendable, Hashable {
let browse: Bool
let submit: Bool
let comment: Bool
@@ -133,7 +133,7 @@ struct DefaultTrackerACL: Codable, Sendable, Hashable {
// MARK: - Tracker
/// A bug tracker from todo.sr.ht.
-struct Tracker: Codable, Sendable, Identifiable, Hashable {
+nonisolated struct Tracker: Codable, Sendable, Identifiable, Hashable {
let id: Int
let created: Date
let updated: Date
@@ -154,7 +154,7 @@ struct Tracker: Codable, Sendable, Identifiable, Hashable {
// MARK: - Tracker Summary (for list view)
/// Lightweight tracker model matching the fields returned by the trackers list query.
-struct TrackerSummary: Codable, Sendable, Identifiable, Hashable {
+nonisolated struct TrackerSummary: Codable, Sendable, Identifiable, Hashable {
let id: Int
/// GraphQL resource identifier used by `tracker(id:)` queries.
let rid: String
@@ -168,7 +168,7 @@ struct TrackerSummary: Codable, Sendable, Identifiable, Hashable {
// MARK: - Ticket Summary (for list view)
/// Lightweight ticket model for the list query.
-struct TicketSummary: Codable, Sendable, Identifiable, Hashable {
+nonisolated struct TicketSummary: Codable, Sendable, Identifiable, Hashable {
let id: Int
let title: String
let status: TicketStatus
@@ -190,7 +190,7 @@ struct TicketSummary: Codable, Sendable, Identifiable, Hashable {
// MARK: - Ticket Detail
/// Full ticket model for the detail view.
-struct TicketDetail: Codable, Sendable {
+nonisolated struct TicketDetail: Codable, Sendable {
let id: Int
let created: Date
let updated: Date
@@ -207,7 +207,7 @@ struct TicketDetail: Codable, Sendable {
// MARK: - Event
/// A timeline event on a ticket. Each event contains one or more changes.
-struct TicketEvent: Codable, Sendable, Identifiable {
+nonisolated struct TicketEvent: Codable, Sendable, Identifiable {
let id: Int
let created: Date
var changes: [EventChange]
@@ -215,7 +215,7 @@ struct TicketEvent: Codable, Sendable, Identifiable {
/// A single change within an event, decoded from the polymorphic EventDetail
/// interface using inline fragments.
-struct EventChange: Codable, Sendable, Identifiable {
+nonisolated struct EventChange: Codable, Sendable, Identifiable {
let id: UUID
let eventType: String
@@ -272,12 +272,12 @@ struct EventChange: Codable, Sendable, Identifiable {
/// Decoded from the `mentioned` field which may be a Ticket (with `id`) or
/// an Entity (with `canonicalName`) depending on the event type.
-struct MentionTarget: Codable, Sendable {
+nonisolated struct MentionTarget: Codable, Sendable {
let id: Int?
let canonicalName: String?
}
/// Label info as returned within a LabelUpdate event change.
-struct EventLabel: Codable, Sendable {
+nonisolated struct EventLabel: Codable, Sendable {
let name: String
}