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
33
44/// One row of `notifications list`. `read_at` is omitempty: absent means
55/// 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 {
77 let id: Int64
88 let repo: String
99 let kind: String
@@ -53,7 +53,7 @@ nonisolated enum NotificationDestination: Hashable, Sendable {
5353@MainActor
5454final class NotificationsViewModel {
5555
56 let list: PagedListModel<Notification>
56 let list: PagedListModel<InboxNotification>
5757 /// Off shows unread only, the default listing; on adds `--all`.
5858 var showAll = false {
5959 didSet {
@@ -77,7 +77,7 @@ final class NotificationsViewModel {
7777 )
7878 }
7979
80 var state: LoadState<[Notification]> { list.state }
80 var state: LoadState<[InboxNotification]> { list.state }
8181
8282 func load() async {
8383 await list.reload()
gitbayTests/NotificationTests.swift +2 −2
@@ -22,10 +22,10 @@ private func argvOf(_ seen: StubProtocol.Seen) throws -> [String] {
2222 return try #require(body["argv"] as? [String])
2323}
2424
25private func decode(_ json: String) throws -> gitbay.Notification {
25private func decode(_ json: String) throws -> InboxNotification {
2626 let decoder = JSONDecoder()
2727 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))
2929}
3030
3131private let unreadBuild = """