summaryrefslogtreecommitdiff
path: root/Hutch/App
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-11 23:36:35 -0500
committerChristian Cleberg <[email protected]>2026-04-11 23:36:35 -0500
commit00cc231e9b419d27b412036d93457c2cbabe0b16 (patch)
tree6b042b802fcddcd1e03f1ae0f666965620225485 /Hutch/App
parent0fde7529ceaebf1cd9baa01826d95d587023d001 (diff)
downloadhutch-00cc231e9b419d27b412036d93457c2cbabe0b16.tar.gz
hutch-00cc231e9b419d27b412036d93457c2cbabe0b16.tar.bz2
hutch-00cc231e9b419d27b412036d93457c2cbabe0b16.zip
Add SourceHut system status screen and home disruption banner
Diffstat (limited to 'Hutch/App')
-rw-r--r--Hutch/App/AppState.swift14
-rw-r--r--Hutch/App/RootView.swift10
2 files changed, 23 insertions, 1 deletions
diff --git a/Hutch/App/AppState.swift b/Hutch/App/AppState.swift
index c519adc..95d9fa9 100644
--- a/Hutch/App/AppState.swift
+++ b/Hutch/App/AppState.swift
@@ -19,6 +19,7 @@ final class AppState {
case repository(RepositorySummary)
case tracker(TrackerSummary)
case mailingList(InboxMailingListReference)
+ case systemStatus
}
enum AuthPhase {
@@ -57,6 +58,7 @@ final class AppState {
let client: SRHTClient
let configuration: AppConfiguration
+ let systemStatusRepository: SystemStatusRepository
// MARK: - Deep link pending navigation
@@ -71,6 +73,7 @@ final class AppState {
self.configuration = AppConfiguration()
let token = KeychainHelper.loadToken()
self.client = SRHTClient(token: token)
+ self.systemStatusRepository = SystemStatusRepository()
}
// MARK: - Launch validation
@@ -273,6 +276,11 @@ final class AppState {
selectedTab = .more
}
+ func openSystemStatus() {
+ pendingTabNavigation = .systemStatus
+ selectedTab = .more
+ }
+
func presentRepositoryDeepLinkError() {
deepLinkError = "The repository could not be found or is inaccessible."
}
@@ -374,7 +382,11 @@ final class AppState {
return
}
- let viewModel = HomeViewModel(currentUser: currentUser, client: client)
+ let viewModel = HomeViewModel(
+ currentUser: currentUser,
+ client: client,
+ systemStatusRepository: systemStatusRepository
+ )
await viewModel.loadDashboard()
}
diff --git a/Hutch/App/RootView.swift b/Hutch/App/RootView.swift
index f3e7159..c210d9d 100644
--- a/Hutch/App/RootView.swift
+++ b/Hutch/App/RootView.swift
@@ -207,6 +207,13 @@ struct RootView: View {
morePath.append(MoreRoute.lists)
morePath.append(MoreRoute.mailingList(mailingList))
}
+ case .systemStatus:
+ morePath = NavigationPath()
+ appState.selectedTab = .more
+ Task {
+ await settleNavigationTransition()
+ morePath.append(MoreRoute.systemStatus)
+ }
}
}
@@ -267,6 +274,7 @@ enum MoreRoute: Hashable {
case lists
case pastes
case profile
+ case systemStatus
case settings
case mailingList(InboxMailingListReference)
case thread(InboxThreadSummary)
@@ -287,6 +295,8 @@ private struct MoreNavigationRoot: View {
PasteListView()
case .profile:
ProfileView()
+ case .systemStatus:
+ SystemStatusView()
case .settings:
SettingsView()
case .mailingList(let mailingList):