summaryrefslogtreecommitdiff
path: root/Hutch/Views/Builds/BuildListView.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-13 13:26:08 -0500
committerChristian Cleberg <[email protected]>2026-04-13 13:26:08 -0500
commit06b24715cd244475ded5482e926721a57278a3cf (patch)
tree62eb3017a6bf42eb1bd061f09fcf231421ecc107 /Hutch/Views/Builds/BuildListView.swift
parentf5f5757d0e1b78470429ae7cb9f742c95662849b (diff)
downloadhutch-06b24715cd244475ded5482e926721a57278a3cf.tar.gz
hutch-06b24715cd244475ded5482e926721a57278a3cf.tar.bz2
hutch-06b24715cd244475ded5482e926721a57278a3cf.zip
perf: reduce redundant fetches and improve list render efficiency
- Remove no-op per-row task from RepositoryListView; loadMoreIfNeeded is a stub for repos so each row was allocating a Task that did nothing - Fix BuildListView auto-refresh stopping permanently after navigating away; startAutoRefresh now runs unconditionally on task so it restarts on every reappear, not just first load - Add lastRefreshed tracking to HomeViewModel with a needsRefresh(after:) helper; HomeView and WorkView scene-activation handlers now skip loadDashboard() if the data is less than 60 seconds old - Add 120-second TTL to repository build status refresh; statuses are no longer re-fetched on every tab appear, only when stale or when the user explicitly pulls to refresh (forceRefresh: true) Implements: https://todo.sr.ht/~ccleberg/hutch/56
Diffstat (limited to 'Hutch/Views/Builds/BuildListView.swift')
-rw-r--r--Hutch/Views/Builds/BuildListView.swift4
1 files changed, 3 insertions, 1 deletions
diff --git a/Hutch/Views/Builds/BuildListView.swift b/Hutch/Views/Builds/BuildListView.swift
index aa98066..6f3f934 100644
--- a/Hutch/Views/Builds/BuildListView.swift
+++ b/Hutch/Views/Builds/BuildListView.swift
@@ -108,8 +108,10 @@ struct BuildListView: View {
vm.repoFilter = savedRepoFilter
viewModel = vm
await vm.loadJobs()
- vm.startAutoRefresh(interval: autoRefreshInterval)
}
+ // Restart auto-refresh every time the view (re)appears, since
+ // onDisappear stops it when navigating away.
+ viewModel?.startAutoRefresh(interval: autoRefreshInterval)
}
.onDisappear {
viewModel?.stopAutoRefresh()