Apply WoT filter to reactions, zaps, and all feed tabs

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.
This commit is contained in:
Jure
2026-04-23 19:20:29 +02:00
parent c93a07c48e
commit 6a23f0223c
6 changed files with 109 additions and 56 deletions
+1 -1
View File
@@ -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
+2 -1
View File
@@ -162,7 +162,8 @@ function WoTSection() {
Web of Trust filter
</h2>
<p className="text-text-dim text-[11px] mb-3">
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).
</p>
<label className={`flex items-center gap-3 ${noFollows ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}`}>
<button