From 2a1a479bf539967e7c73ff92c15ae14dbdea4503 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Jan 2026 12:57:58 +0000 Subject: [PATCH] feat: Add inbox relay dropdown for NIP-17 DMs - Update RelaysDropdown to show each participant's private inbox relays - Uses Inbox icon for NIP-17 (distinguishing from Wifi for other protocols) - Shows relay count per participant with connection status - Handles loading state and empty relay configurations - Show NIP-17 badge in chat header for DM conversations --- src/components/ChatViewer.tsx | 3 +- src/components/chat/RelaysDropdown.tsx | 171 +++++++++++++++++++++++-- 2 files changed, 160 insertions(+), 14 deletions(-) diff --git a/src/components/ChatViewer.tsx b/src/components/ChatViewer.tsx index 7f7d0e1..187ef50 100644 --- a/src/components/ChatViewer.tsx +++ b/src/components/ChatViewer.tsx @@ -804,7 +804,8 @@ export function ChatViewer({ {(conversation.type === "group" || - conversation.type === "live-chat") && ( + conversation.type === "live-chat" || + conversation.type === "dm") && ( + + +
+ Private Inbox Relays (NIP-17) +
+
+ {nip17RelayData.map(({ pubkey, relays, loading, relayData }) => ( +
+
+ + + {loading + ? "..." + : `${relays.length} relay${relays.length !== 1 ? "s" : ""}`} + +
+ {loading ? ( +
+ Loading... +
+ ) : relays.length === 0 ? ( +
+ No inbox relays configured +
+ ) : ( + relayData.map(({ url, state }) => { + const connIcon = getConnectionIcon(state); + const authIcon = getAuthIcon(state); + return ( +
+
+ {connIcon.icon} + {authIcon.icon} +
+ +
+ ); + }) + )} +
+ ))} +
+
+ + ); + } + + // Standard relay display for other protocols return (
- Relays ({relays.length}) + Relays ({standardRelays.length})
- {relayData.map(({ url, state }) => { + {standardRelayData.map(({ url, state }) => { const connIcon = getConnectionIcon(state); const authIcon = getAuthIcon(state);