Add NIP-05 badges, hashtag pages, keyword muting, suggestion dismissal, notification poller

- Article cover: aspect-video replaces max-h-72 for consistent 16:9
- NIP-05 verification badge on note cards with 1-hour TTL cache
- Dedicated hashtag feed pages (clicking #tag opens live feed, not search)
- Keyword muting: word-boundary matching, applied across all feed views
- Follow suggestion dismissal: persistent "don't suggest again" per person
- Background notification poller (60s): mentions, zaps, new followers
- All notification types independently toggleable in settings
- Centralized notification firing (removed inline store notifications)
This commit is contained in:
Jure
2026-03-20 12:09:11 +01:00
parent 989ed01dfc
commit 57630227e1
20 changed files with 499 additions and 35 deletions

View File

@@ -13,7 +13,7 @@ import { NDKEvent } from "@nostr-dev-kit/ndk";
export function Feed() {
const { notes, loading, connected, error, connect, loadCachedFeed, loadFeed, trendingNotes, trendingLoading, loadTrendingFeed, focusedNoteIndex } = useFeedStore();
const { loggedIn, follows } = useUserStore();
const { mutedPubkeys } = useMuteStore();
const { mutedPubkeys, contentMatchesMutedKeyword } = useMuteStore();
const { feedTab: tab, setFeedTab: setTab, feedLanguageFilter, setFeedLanguageFilter } = useUIStore();
const [followNotes, setFollowNotes] = useState<NDKEvent[]>([]);
const [followLoading, setFollowLoading] = useState(false);
@@ -51,6 +51,7 @@ export function Feed() {
const filteredNotes = activeNotes.filter((event) => {
if (mutedPubkeys.includes(event.pubkey)) return false;
if (contentMatchesMutedKeyword(event.content)) 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

View File

@@ -0,0 +1,50 @@
import { useState, useEffect } from "react";
import { NDKEvent } from "@nostr-dev-kit/ndk";
import { useUIStore } from "../../stores/ui";
import { fetchHashtagFeed } from "../../lib/nostr";
import { NoteCard } from "./NoteCard";
export function HashtagFeed() {
const { pendingHashtag, goBack } = useUIStore();
const tag = pendingHashtag ?? "";
const [notes, setNotes] = useState<NDKEvent[]>([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
if (!tag) return;
setLoading(true);
setNotes([]);
fetchHashtagFeed(tag)
.then(setNotes)
.finally(() => setLoading(false));
}, [tag]);
return (
<div className="h-full flex flex-col">
<header className="border-b border-border px-4 py-2.5 flex items-center gap-3 shrink-0">
<button onClick={goBack} className="text-text-dim hover:text-text text-[11px] transition-colors">
back
</button>
<h2 className="text-text text-[14px] font-medium">#{tag}</h2>
{!loading && (
<span className="text-text-dim text-[11px]">{notes.length} note{notes.length !== 1 ? "s" : ""}</span>
)}
</header>
<div className="flex-1 overflow-y-auto">
{loading && (
<div className="px-4 py-8 text-text-dim text-[12px] text-center">Loading notes for #{tag}</div>
)}
{!loading && notes.length === 0 && (
<div className="px-4 py-8 text-text-dim text-[12px] text-center">No notes found for #{tag}</div>
)}
{notes.map((event) => (
<NoteCard key={event.id} event={event} />
))}
</div>
</div>
);
}

View File

@@ -1,6 +1,7 @@
import { useState, useRef, useEffect } from "react";
import { NDKEvent } from "@nostr-dev-kit/ndk";
import { useProfile } from "../../hooks/useProfile";
import { useNip05Verified } from "../../hooks/useNip05Verified";
import { useReactionCount } from "../../hooks/useReactionCount";
import { useReplyCount } from "../../hooks/useReplyCount";
import { useZapCount } from "../../hooks/useZapCount";
@@ -39,6 +40,7 @@ export function NoteCard({ event, focused }: NoteCardProps) {
const name = profile?.displayName || profile?.name || shortenPubkey(event.pubkey);
const avatar = profile?.picture;
const nip05 = profile?.nip05;
const verified = useNip05Verified(event.pubkey, nip05);
const time = event.created_at ? timeAgo(event.created_at) : "";
const { loggedIn, pubkey: ownPubkey, follows, follow, unfollow } = useUserStore();
@@ -175,7 +177,9 @@ export function NoteCard({ event, focused }: NoteCardProps) {
onClick={() => openProfile(event.pubkey)}
>{name}</span>
{nip05 && (
<span className="text-text-dim text-[10px] truncate max-w-40">{nip05}</span>
<span className={`text-[10px] truncate max-w-40 ${verified === "valid" ? "text-success" : "text-text-dim"}`}>
{verified === "valid" ? "✓ " : ""}{nip05}
</span>
)}
<span className="text-text-dim text-[11px] shrink-0">{time}</span>
{/* Context menu — hidden until card hover, not shown for own notes */}

View File

@@ -194,7 +194,7 @@ interface NoteContentProps {
}
export function NoteContent({ content, inline, mediaOnly }: NoteContentProps) {
const { openSearch } = useUIStore();
const { openHashtag } = useUIStore();
const segments = parseContent(content);
const images: string[] = segments.filter((s) => s.type === "image").map((s) => s.value);
const videos: string[] = segments.filter((s) => s.type === "video").map((s) => s.value);
@@ -246,7 +246,7 @@ export function NoteContent({ content, inline, mediaOnly }: NoteContentProps) {
<span
key={i}
className="text-accent/80 cursor-pointer hover:text-accent"
onClick={(e) => { e.stopPropagation(); openSearch(`#${seg.value}`); }}
onClick={(e) => { e.stopPropagation(); openHashtag(seg.value); }}
>
{seg.display}
</span>
@@ -441,7 +441,7 @@ export function NoteContent({ content, inline, mediaOnly }: NoteContentProps) {
<span
key={i}
className="text-accent/80 cursor-pointer hover:text-accent"
onClick={(e) => { e.stopPropagation(); openSearch(`#${seg.value}`); }}
onClick={(e) => { e.stopPropagation(); openHashtag(seg.value); }}
>
{seg.display}
</span>