From 06b24715cd244475ded5482e926721a57278a3cf Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Mon, 13 Apr 2026 13:26:08 -0500 Subject: 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 --- Hutch/Views/Builds/BuildListView.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Hutch/Views/Builds/BuildListView.swift') 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() -- cgit v1.2.3