From 5db0a14a38f49593dd3d3722222f20b69573c8fa Mon Sep 17 00:00:00 2001 From: Jure <44338+hoornet@users.noreply.github.com> Date: Mon, 15 Jun 2026 21:30:05 +0200 Subject: [PATCH] fix: respect mute-list in search results (#7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Search only filtered the people *suggestions* list — actual note, article, and people results ignored the mute-list entirely, so muted spam accounts still showed up. Now notes/articles are filtered by muted pubkey and muted keyword, and people by muted pubkey, reusing the same logic the feed uses. Tab counts, zero-result states, and all result lists use the filtered sets and react to mute changes. Closes #7 --- src/components/search/SearchView.tsx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/search/SearchView.tsx b/src/components/search/SearchView.tsx index a74e985..ed7e1a9 100644 --- a/src/components/search/SearchView.tsx +++ b/src/components/search/SearchView.tsx @@ -151,7 +151,7 @@ export function SearchView() { }, []); const { loggedIn, follows } = useUserStore(); - const { mutedPubkeys } = useMuteStore(); + const { mutedPubkeys, contentMatchesMutedKeyword } = useMuteStore(); const { dismissedPubkeys, dismiss } = useDismissedSuggestionsStore(); const visibleSuggestions = suggestions.filter( @@ -265,7 +265,15 @@ export function SearchView() { if (e.key === "Enter") handleSearch(); }; - const totalResults = noteResults.length + userResults.length + articleResults.length; + // Respect the mute list in search results (issue #7): hide notes/articles + // from muted pubkeys or matching a muted keyword, and people who are muted. + const isMutedEvent = (e: NDKEvent) => + mutedPubkeys.includes(e.pubkey) || contentMatchesMutedKeyword(e.content); + const filteredNoteResults = noteResults.filter((e) => !isMutedEvent(e)); + const filteredArticleResults = articleResults.filter((e) => !isMutedEvent(e)); + const filteredUserResults = userResults.filter((u) => !mutedPubkeys.includes(u.pubkey)); + + const totalResults = filteredNoteResults.length + filteredUserResults.length + filteredArticleResults.length; return (