diff options
| author | Christian Cleberg <[email protected]> | 2026-07-16 01:29:06 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-07-16 01:29:06 -0500 |
| commit | 8e585a709d8979d493fef3ed4015db93687f48e8 (patch) | |
| tree | faebe598a4c6f7a5f3db92d465ed693aab594252 /Hutch/App | |
| parent | f100206cc6d6784563d8eb905c9feb15c58bcc1e (diff) | |
| parent | 21be03e6ca54c1a15607faab905b119eda9a548f (diff) | |
| download | hutch-8e585a709d8979d493fef3ed4015db93687f48e8.tar.gz hutch-8e585a709d8979d493fef3ed4015db93687f48e8.tar.bz2 hutch-8e585a709d8979d493fef3ed4015db93687f48e8.zip | |
Merge pull request #6 from zerolabsco/phase-3-api-features
Phase 3: API features
Diffstat (limited to 'Hutch/App')
| -rw-r--r-- | Hutch/App/RootView.swift | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/Hutch/App/RootView.swift b/Hutch/App/RootView.swift index 1ae4651..10720ad 100644 --- a/Hutch/App/RootView.swift +++ b/Hutch/App/RootView.swift @@ -291,39 +291,45 @@ struct RootView: View { } } + /// Replaces the target tab's path in one assignment. + /// + /// Resetting the path and appending to it afterwards races when the target tab + /// is already the one on screen: the reset starts an animated pop of the view + /// the user is standing on, and the appends land mid-animation, leaving a blank + /// screen. That is why opening a mailing list from a pinned project on Home + /// worked while the same tap under More → Projects did not — one changes tabs + /// and the other does not. + /// + /// Building the whole path first and assigning once gives SwiftUI a single + /// diff, with nothing to race. private func handleTabNavigation(_ target: AppState.TabNavigationTarget) { switch target { case .repository(let repository): - repoPath = NavigationPath() + var path = NavigationPath() + path.append(repository) + repoPath = path appState.selectedTab = .repositories - Task { - await settleNavigationTransition() - repoPath.append(repository) - } case .tracker(let tracker): - ticketsPath = NavigationPath() + var path = NavigationPath() + path.append(tracker) + ticketsPath = path appState.selectedTab = .tickets - Task { - await settleNavigationTransition() - ticketsPath.append(tracker) - } case .mailingList(let mailingList): - morePath = NavigationPath() + // .lists first so back lands on Mailing Lists rather than dead-ending. + var path = NavigationPath() + path.append(MoreRoute.lists) + path.append(MoreRoute.mailingList(mailingList)) + morePath = path appState.selectedTab = .more - Task { - await settleNavigationTransition() - morePath.append(MoreRoute.lists) - morePath.append(MoreRoute.mailingList(mailingList)) - } + case .systemStatus: - morePath = NavigationPath() + var path = NavigationPath() + path.append(MoreRoute.systemStatus) + morePath = path appState.selectedTab = .more - Task { - await settleNavigationTransition() - morePath.append(MoreRoute.systemStatus) - } + case .builds: buildsPath = NavigationPath() appState.selectedTab = .builds |
