From 6a23f0223c48516aa5d83eddab759d37d4256a1e Mon Sep 17 00:00:00 2001 From: Jure <44338+hoornet@users.noreply.github.com> Date: Thu, 23 Apr 2026 19:20:29 +0200 Subject: [PATCH] Apply WoT filter to reactions, zaps, and all feed tabs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WoT was previously global-feed only. Now it filters notes on every feed tab (global, following, trending) and also gates reaction pills and zap totals — so a reaction from someone outside your social graph no longer shows up in the counts. - engagement.ts: wotSet param threaded through groupReactions, fetchReactions, fetchZapCount, fetchBatchEngagement. Zaps are filtered by the pubkey inside the zap request (the actual zapper), not the outer event.pubkey (the LNURL wallet). Extracted getZapperPubkey and getZapAmountSats. - useReactions / useZapCount: cache key embeds WoT state so filtered and unfiltered counts don't collide. Hooks subscribe to the WoT store so toggling re-renders. - feed store: reads WoT state and passes wotSet to fetchBatchEngagement, seeds cache with the correct key. - Feed.tsx: drop the tab === "global" guard. - SettingsView.tsx: update copy to reflect the wider scope. --- src/components/feed/Feed.tsx | 2 +- src/components/shared/SettingsView.tsx | 3 +- src/hooks/useReactions.ts | 46 +++++++++------- src/hooks/useZapCount.ts | 33 ++++++++---- src/lib/nostr/engagement.ts | 74 ++++++++++++++++++-------- src/stores/feed.ts | 7 ++- 6 files changed, 109 insertions(+), 56 deletions(-) diff --git a/src/components/feed/Feed.tsx b/src/components/feed/Feed.tsx index 35a4cea..6e61b66 100644 --- a/src/components/feed/Feed.tsx +++ b/src/components/feed/Feed.tsx @@ -105,7 +105,7 @@ export function Feed() { const filteredNotes = activeNotes.filter((event) => { if (mutedPubkeys.includes(event.pubkey)) return false; if (contentMatchesMutedKeyword(event.content)) return false; - if (tab === "global" && wotEnabled && wotSet.size > 0 && !wotSet.has(event.pubkey)) return false; + if (wotEnabled && wotSet.size > 0 && !wotSet.has(event.pubkey)) return false; const c = event.content.trim(); if (!c || c.startsWith("{") || c.startsWith("[")) return false; // Filter out notes that look like base64 blobs or relay protocol messages diff --git a/src/components/shared/SettingsView.tsx b/src/components/shared/SettingsView.tsx index 696f3d3..d6c4547 100644 --- a/src/components/shared/SettingsView.tsx +++ b/src/components/shared/SettingsView.tsx @@ -162,7 +162,8 @@ function WoTSection() { Web of Trust filter

- Only show global feed notes from people you follow or people they follow. + Hide notes, reactions, and zaps from outside your social graph + (people you follow + people they follow).