Commit 1f38e9b6ff

1f38e9b6ff09c60ffe7752e72c059ede31b78919

parent: 5e4785bac9

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-06 22:56 UTC

Rename Notification to InboxNotification

Notification shadows Foundation.Notification within the module; the
test helper already needed gitbay.Notification to disambiguate.

Layout: unified · split

gitbay/Account/NotificationsViewModel.swift +3 −3
@@ -3,7 +3,7 @@ import Observation
3 3
4/// One row of `notifications list`. `read_at` is omitempty: absent means 4/// One row of `notifications list`. `read_at` is omitempty: absent means
5/// unread, which is the common case for the default (unread-only) listing. 5/// unread, which is the common case for the default (unread-only) listing.
6nonisolated struct Notification: Decodable, Sendable, Hashable, Identifiable { 6nonisolated struct InboxNotification: Decodable, Sendable, Hashable, Identifiable {
7 let id: Int64 7 let id: Int64
8 let repo: String 8 let repo: String
9 let kind: String 9 let kind: String
@@ -53,7 +53,7 @@ nonisolated enum NotificationDestination: Hashable, Sendable {
53@MainActor 53@MainActor
54final class NotificationsViewModel { 54final class NotificationsViewModel {
55 55
56 let list: PagedListModel<Notification> 56 let list: PagedListModel<InboxNotification>
57 /// Off shows unread only, the default listing; on adds `--all`. 57 /// Off shows unread only, the default listing; on adds `--all`.
58 var showAll = false { 58 var showAll = false {
59 didSet { 59 didSet {
@@ -77,7 +77,7 @@ final class NotificationsViewModel {
77 ) 77 )
78 } 78 }
79 79
80 var state: LoadState<[Notification]> { list.state } 80 var state: LoadState<[InboxNotification]> { list.state }
81 81
82 func load() async { 82 func load() async {
83 await list.reload() 83 await list.reload()
gitbayTests/NotificationTests.swift +2 −2
@@ -22,10 +22,10 @@ private func argvOf(_ seen: StubProtocol.Seen) throws -> [String] {
22 return try #require(body["argv"] as? [String]) 22 return try #require(body["argv"] as? [String])
23} 23}
24 24
25private func decode(_ json: String) throws -> gitbay.Notification { 25private func decode(_ json: String) throws -> InboxNotification {
26 let decoder = JSONDecoder() 26 let decoder = JSONDecoder()
27 decoder.dateDecodingStrategy = .iso8601 27 decoder.dateDecodingStrategy = .iso8601
28 return try decoder.decode(gitbay.Notification.self, from: Data(json.utf8)) 28 return try decoder.decode(InboxNotification.self, from: Data(json.utf8))
29} 29}
30 30
31private let unreadBuild = """ 31private let unreadBuild = """