Add thread view with replies

- Click note content to open thread view
- ThreadView shows root note, reply composer, and replies
- fetchReplies added to nostr lib (kind 1 #e filter)
- UI store gains openThread, goBack, previousView for navigation history
- Profile back button now returns to previous view correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jure
2026-03-08 18:55:57 +01:00
parent 30b5bb8d42
commit 366731f9d7
7 changed files with 183 additions and 8 deletions

View File

@@ -19,7 +19,7 @@ export function NoteCard({ event }: NoteCardProps) {
const time = event.created_at ? timeAgo(event.created_at) : "";
const { loggedIn } = useUserStore();
const { openProfile } = useUIStore();
const { openProfile, openThread, currentView } = useUIStore();
const likedKey = "wrystr_liked";
const getLiked = () => {
try { return new Set<string>(JSON.parse(localStorage.getItem(likedKey) || "[]")); }
@@ -109,7 +109,12 @@ export function NoteCard({ event }: NoteCardProps) {
<span className="text-text-dim text-[11px] shrink-0">{time}</span>
</div>
<NoteContent content={event.content} />
<div
className="cursor-pointer"
onClick={() => openThread(event, currentView as "feed" | "profile")}
>
<NoteContent content={event.content} />
</div>
{/* Actions */}
{loggedIn && (