From 1f8b7a23529462c3c332753d33810b5c9f692bbc Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sun, 22 Mar 2026 20:42:45 -0500 Subject: feat: add search to builds, trackers, tickets, pastes, mailing lists, and inbox --- Hutch/Views/Inbox/InboxView.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Hutch/Views/Inbox/InboxView.swift') diff --git a/Hutch/Views/Inbox/InboxView.swift b/Hutch/Views/Inbox/InboxView.swift index 74f78d5..5724964 100644 --- a/Hutch/Views/Inbox/InboxView.swift +++ b/Hutch/Views/Inbox/InboxView.swift @@ -30,7 +30,7 @@ struct InboxView: View { @Bindable var vm = viewModel List { - ForEach(viewModel.threads) { thread in + ForEach(viewModel.filteredThreads) { thread in Button { selectThread(thread) } label: { @@ -45,6 +45,11 @@ struct InboxView: View { } } } + .searchable( + text: $vm.searchText, + placement: .navigationBarDrawer(displayMode: .always), + prompt: "Search inbox" + ) .listStyle(.plain) .overlay { if viewModel.isLoading, viewModel.threads.isEmpty { @@ -55,6 +60,8 @@ struct InboxView: View { message: error, retryAction: { await viewModel.loadThreads() } ) + } else if !viewModel.threads.isEmpty, viewModel.filteredThreads.isEmpty { + ContentUnavailableView.search(text: viewModel.searchText) } else if viewModel.threads.isEmpty, viewModel.error == nil { ContentUnavailableView( "Inbox Zero", -- cgit v1.2.3