From 0b84ecaf7ba0fb2cd3f3867da8dc732450b55b50 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Mon, 13 Apr 2026 13:35:03 -0500 Subject: perf: cache filtered collections and add equatable row views MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert filteredJobs, filteredPastes, and filteredTickets from computed properties to stored properties updated via didSet on their inputs. Each update function guards with an equality check before assigning, so @Observable skips the notification when the filtered result hasn't changed — preventing list re-renders on auto-refresh when no visible data has actually changed. Add Equatable conformance to BuildRowView, PasteRowView, TicketRowView, and SelectableTicketRow, and apply .equatable() at each ForEach call site. When a list does re-render, SwiftUI now skips body evaluation for rows whose model value is identical to the previous pass. Implements: https://todo.sr.ht/~ccleberg/hutch/57 --- Hutch/Views/Builds/BuildListView.swift | 1 + 1 file changed, 1 insertion(+) (limited to 'Hutch/Views/Builds/BuildListView.swift') diff --git a/Hutch/Views/Builds/BuildListView.swift b/Hutch/Views/Builds/BuildListView.swift index 6f3f934..d525918 100644 --- a/Hutch/Views/Builds/BuildListView.swift +++ b/Hutch/Views/Builds/BuildListView.swift @@ -137,6 +137,7 @@ struct BuildListView: View { ForEach(viewModel.filteredJobs) { job in NavigationLink(value: job) { BuildRowView(job: job) + .equatable() } .contextMenu { Button { -- cgit v1.2.3