Skip to content

Add relay list management UI and settings integration#254

Merged
purrgrammer merged 6 commits intomainfrom
claude/explore-relay-list-kinds-ZCxFH
Feb 20, 2026
Merged

Add relay list management UI and settings integration#254
purrgrammer merged 6 commits intomainfrom
claude/explore-relay-list-kinds-ZCxFH

Conversation

@purrgrammer
Copy link
Owner

Summary

This PR adds a comprehensive relay list management interface to the Settings viewer, allowing users to configure their Nostr relay lists (kinds 10002, 10006, 10007, 10050) directly in the UI. It also includes infrastructure to fetch these relay lists when the account changes.

Key Changes

  • New RelayListsSettings component (src/components/settings/RelayListsSettings.tsx):

    • Manages four relay list types: Relay List (10002), Blocked Relays (10006), Search Relays (10007), and DM Relays (10050)
    • Supports adding/removing relays with URL validation and normalization
    • For kind 10002, allows toggling read/write markers per relay
    • Displays relay counts and descriptions in an accordion interface
    • Publishes changes back to Nostr as signed events
  • Settings UI integration (src/components/SettingsViewer.tsx):

    • Added "Relays" tab to settings with Radio icon
    • Integrated RelayListsSettings component into the settings tabs
  • Account sync enhancement (src/hooks/useAccountSync.ts):

    • Added effect to fetch relay list kinds (10006, 10007, 10050) when account changes
    • Ensures relay lists are loaded into EventStore for the settings UI to display
  • Planning document (PLAN-blocked-search-relays.md):

    • Detailed plan for implementing blocked relay filtering and search relay functionality
    • Architecture analysis of relay connection points
    • Implementation roadmap for future work

Implementation Details

  • Relay entry parsing: Handles both NIP-65 format (kind 10002 with "r" tags and read/write markers) and NIP-51 format (kinds 10006/10007/10050 with "relay" tags)
  • URL handling: Sanitizes user input, auto-adds wss:// scheme if missing, validates and normalizes URLs
  • Draft state management: Maintains local draft state separate from published events, only publishes when changes are detected
  • Error handling: Validates relay URLs, prevents duplicates, provides user feedback via toast notifications
  • Accessibility: Uses keyboard shortcuts (Enter to add relay), hover states for delete buttons, proper form validation

The implementation follows existing patterns in the codebase (similar to relayListCache and other services) and integrates cleanly with the applesauce EventStore for reactive updates.

https://claude.ai/code/session_01JHirYU56sKDKYhRx6aCQ54

- Fetch additional relay list kinds (10006, 10007, 10050) on login
- Add "Relays" tab to Settings with accordion UI for each relay list kind
- Support NIP-65 relay list (kind 10002) with read/write markers
- Support blocked relays (10006), search relays (10007), DM relays (10050)
- Add/remove relays with URL sanitization and normalization
- Explicit save button publishes only modified lists as replaceable events

https://claude.ai/code/session_01JHirYU56sKDKYhRx6aCQ54
Detailed implementation plan for:
- Kind 10006: filter blocked relays from all connection paths
- Kind 10007: use search relays for NIP-50 queries

https://claude.ai/code/session_01JHirYU56sKDKYhRx6aCQ54
@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grimoire Ready Ready Preview, Comment Feb 20, 2026 11:51am

Request Review

…issues

Extract parseRelayEntries, buildRelayListTags, sanitizeRelayInput, and
comparison/mode helpers into src/lib/relay-list-utils.ts with 52 tests
covering roundtrips, normalization, edge cases, and mode conversions.

UX fixes:
- Replace RelayLink (navigates away on click) with static RelaySettingsRow
- Remove redundant inbox/outbox icons (mode dropdown is sufficient)
- Always-visible delete button instead of hover-only opacity
- Per-accordion dirty indicator (CircleDot icon) for modified lists
- Discard button to reset all changes
- Read-only account explanation text
- Human-friendly descriptions (no NIP references or kind numbers)
- Separator between relay list and add input
- Larger relay icons and text for readability

https://claude.ai/code/session_01JHirYU56sKDKYhRx6aCQ54
Replace plain text kind names with KindBadge (full variant showing icon,
name, and kind number) and add NIPBadge next to each list description.
This gives power users the protocol context they expect.

Also document KindBadge and NIPBadge as shared components in CLAUDE.md.

https://claude.ai/code/session_01JHirYU56sKDKYhRx6aCQ54
Add kind 10012 (Favorite Relays / Relay Feeds) to the settings UI and
account sync fetching. Uses "relay" tags like other NIP-51 lists.

https://claude.ai/code/session_01JHirYU56sKDKYhRx6aCQ54
- Kind 10006 (Blocked Relays): Radio → ShieldBan
- Kind 10007 (Search Relays): Radio → Search

These icons propagate to KindBadge, settings accordions, and event
renderers via getKindInfo(). Generic relay kinds (10002, 30002, etc.)
keep the Radio icon.

https://claude.ai/code/session_01JHirYU56sKDKYhRx6aCQ54
@purrgrammer purrgrammer merged commit d630a72 into main Feb 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants