From 7167d64d9c4c97c32c79ec15c4e5ab88c99e31cb Mon Sep 17 00:00:00 2001 From: Alejandro Date: Thu, 12 Feb 2026 22:16:18 +0100 Subject: [PATCH] fix(status): show Open by default instead of infinite loading spinner (#244) StatusIndicator was stuck showing a loading spinner indefinitely when no status events existed, because the useTimeline observable never completes for live Nostr subscriptions. Default to showing "Open" immediately and update reactively when status events arrive. https://claude.ai/code/session_01UAjKegpi8uWyLdjgRpNeEJ Co-authored-by: Claude --- src/components/nostr/StatusIndicator.tsx | 24 ++----------------- .../nostr/kinds/IssueDetailRenderer.tsx | 3 +-- .../nostr/kinds/PatchDetailRenderer.tsx | 3 +-- .../nostr/kinds/PullRequestDetailRenderer.tsx | 3 +-- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/src/components/nostr/StatusIndicator.tsx b/src/components/nostr/StatusIndicator.tsx index 089fc19..60dbe73 100644 --- a/src/components/nostr/StatusIndicator.tsx +++ b/src/components/nostr/StatusIndicator.tsx @@ -1,10 +1,4 @@ -import { - CircleDot, - CheckCircle2, - XCircle, - FileEdit, - Loader2, -} from "lucide-react"; +import { CircleDot, CheckCircle2, XCircle, FileEdit } from "lucide-react"; import { getStatusType } from "@/lib/nip34-helpers"; /** @@ -66,8 +60,6 @@ function getStatusBadgeClasses(kind: number): string { export interface StatusIndicatorProps { /** The status event kind (1630-1633) or undefined for default "open" */ statusKind?: number; - /** Whether status is loading */ - loading?: boolean; /** Event type for appropriate labeling (affects "resolved" vs "merged") */ eventType?: "issue" | "patch" | "pr"; /** Display variant */ @@ -82,23 +74,11 @@ export interface StatusIndicatorProps { */ export function StatusIndicator({ statusKind, - loading = false, eventType = "issue", variant = "inline", className = "", }: StatusIndicatorProps) { - if (loading) { - return ( - - - Loading... - - ); - } - - // Default to "open" if no status + // Default to "open" if no status (shown immediately, updates reactively when status events arrive) const effectiveKind = statusKind ?? 1630; // For patches/PRs, kind 1631 means "merged" not "resolved" diff --git a/src/components/nostr/kinds/IssueDetailRenderer.tsx b/src/components/nostr/kinds/IssueDetailRenderer.tsx index 9225f74..6aed758 100644 --- a/src/components/nostr/kinds/IssueDetailRenderer.tsx +++ b/src/components/nostr/kinds/IssueDetailRenderer.tsx @@ -88,7 +88,7 @@ export function IssueDetailRenderer({ event }: { event: NostrEvent }) { [event.id], ); - const { events: statusEvents, loading: statusLoading } = useTimeline( + const { events: statusEvents } = useTimeline( `issue-status-${event.id}`, statusFilter, statusRelays, @@ -120,7 +120,6 @@ export function IssueDetailRenderer({ event }: { event: NostrEvent }) { {/* Status Badge (below title) */} diff --git a/src/components/nostr/kinds/PatchDetailRenderer.tsx b/src/components/nostr/kinds/PatchDetailRenderer.tsx index 3d37ca9..de5f914 100644 --- a/src/components/nostr/kinds/PatchDetailRenderer.tsx +++ b/src/components/nostr/kinds/PatchDetailRenderer.tsx @@ -91,7 +91,7 @@ export function PatchDetailRenderer({ event }: { event: NostrEvent }) { [event.id], ); - const { events: statusEvents, loading: statusLoading } = useTimeline( + const { events: statusEvents } = useTimeline( `patch-status-${event.id}`, statusFilter, statusRelays, @@ -124,7 +124,6 @@ export function PatchDetailRenderer({ event }: { event: NostrEvent }) {
diff --git a/src/components/nostr/kinds/PullRequestDetailRenderer.tsx b/src/components/nostr/kinds/PullRequestDetailRenderer.tsx index 9221b1c..c523ea4 100644 --- a/src/components/nostr/kinds/PullRequestDetailRenderer.tsx +++ b/src/components/nostr/kinds/PullRequestDetailRenderer.tsx @@ -90,7 +90,7 @@ export function PullRequestDetailRenderer({ event }: { event: NostrEvent }) { [event.id], ); - const { events: statusEvents, loading: statusLoading } = useTimeline( + const { events: statusEvents } = useTimeline( `pr-status-${event.id}`, statusFilter, statusRelays, @@ -124,7 +124,6 @@ export function PullRequestDetailRenderer({ event }: { event: NostrEvent }) { {/* Status Badge (below title) */}