Commit Graph

490 Commits

Author SHA1 Message Date
Alejandro Gómez
f29480fc0a ui: avoid username overflow, condense event view 2026-04-01 10:39:06 +02:00
Alejandro Gómez
799538e5f6 chore: remove old docs 2026-04-01 09:14:15 +02:00
Alejandro Gómez
4e694945b3 feat: profile & badge sets 2026-03-31 23:02:24 +02:00
Alejandro Gómez
fcc9b50d25 fix: pick oldest emoji tag 2026-03-31 22:21:35 +02:00
Alejandro Gómez
d24b33ef7d fix: align relay links in text 2026-03-31 19:00:41 +02:00
Alejandro Gómez
32f7d1b531 ux: use popover for reactions 2026-03-31 18:47:03 +02:00
Alejandro Gómez
89ef0e2c5e feat: event dialog 2026-03-31 18:41:28 +02:00
Alejandro Gómez
ea8d2123ba fix: improve reaction tooltip with user names and proper emoji
Replace plain HTML title tooltip (truncated hex pubkeys, shortcodes) with
a Radix tooltip showing actual emoji and resolved user display names.
2026-03-31 16:51:20 +02:00
Alejandro Gómez
297c7cdbe0 feat: fav repos and git author lists 2026-03-31 13:18:14 +02:00
Alejandro Gómez
0a4318ae8c ai: plan for blocked relays 2026-03-31 12:49:50 +02:00
Alejandro Gómez
e124ffc89e fix: set up nsite to be published by grimoire key 2026-03-31 11:48:45 +02:00
Alejandro Gómez
143fa7b4b6 feat: refactor emoji search with singleton service, Dexie caching, and keyword-enriched search
Replace hand-rolled ~350-entry emoji list with unicode-emoji-json (~1,900 emojis) and emojilib
keywords for richer search matching. Move EmojiSearchService to a singleton with Dexie-backed
caching for instant availability on startup. Add recency+frequency emoji usage tracking shared
across the emoji picker and editor autocomplete.
2026-03-31 10:19:04 +02:00
Alejandro Gómez
0af86b667e fix: make sure condensed view works in pop out windows 2026-03-31 09:03:19 +02:00
Alejandro Gómez
4ca9c2ffbd feat: app handler definition 2026-03-31 08:59:27 +02:00
Alejandro Gómez
c60a7b2249 feat: add nsite config 2026-03-30 17:03:39 +02:00
Alejandro Gómez
d99288698e chore: update TODO.md 2026-03-30 16:28:37 +02:00
Alejandro Gómez
48ce35cbea feat: nip-5a nsites 2026-03-27 14:27:28 +01:00
Alejandro Gómez
4a501634c5 chore: sync NIPs 2026-03-26 09:58:07 +01:00
Alejandro Gómez
5d22403235 ai: sync-nips command 2026-03-26 09:22:32 +01:00
Alejandro Gómez
b14dce2d55 fix: center spellbook dropdown 2026-03-25 11:23:35 +01:00
Alejandro Gómez
9ded99420f feat: favorite spells 2026-03-24 17:37:20 +01:00
Alejandro Gómez
5ff9bbd5c2 fix: use aggregator relays as NIP-65 fallback and show accurate per-relay counts
- Use AGGREGATOR_RELAYS as fallback for follows without kind:10002,
  not the user's personal relays. Personal inbox/write relays were
  being assigned as outbox for hundreds of unknown follows, inflating
  counts and sending unnecessary queries to niche relays.
- Per-relay REQ badges now show assigned count (from reasoning) as
  the primary number, with unassigned users shown dimmed as +N.
  Tooltips show the full breakdown.
- Switch to useStableRelayFilterMap for structural comparison.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 11:49:46 +01:00
Alejandro Gómez
b25c2db89d feat: add useStableRelayFilterMap with structural filter comparison
Stabilizes relay filter map references using isFilterEqual per relay
instead of JSON.stringify. Avoids serialization overhead for large
filter maps with many relays and pubkeys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 11:49:39 +01:00
Alejandro Gómez
0851cb03e9 perf: reduce Map allocations and subscription churn in REQ timeline hook
- Skip duplicate events in setEventsMap (return prev if event.id exists)
- Only create new relayStates Map on actual state transitions (waiting→receiving),
  not on every event — counter increments applied in-place
- Don't add unknown relays to the state map (skip defensive init)
- Cap streaming eventsMap at 2000 with 25% batch eviction of oldest events
- Decouple relay filter map from subscription lifecycle: store in ref,
  only tear down subscriptions when the relay SET changes (not filter content)
- Use useStableRelayFilterMap for structural comparison instead of JSON.stringify

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 11:49:33 +01:00
Alejandro Gómez
62785fa336 feat: add inbox (#p) chunking to relay filter splitting and clean up logging
Extend relay filter chunking to route #p tags to inbox/read relays,
matching the existing outbox/write routing for authors. Remove debug
console.log statements across the codebase while preserving error-level
logging. Delete unused logger utility. Expand test coverage for all
chunking scenarios.
2026-03-23 09:59:24 +01:00
Alejandro Gómez
9af896127e wip: relay filter chunking for REQ subscriptions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:59:24 +01:00
Alejandro Gómez
92ea6e347b fix: convert potential numbers (cached NIP-11 supported_nips) to strings 2026-03-20 10:52:34 +01:00
Alejandro Gómez
40c02cdac7 fix: track all auth events, avoid race condition 2026-03-20 10:44:14 +01:00
Alejandro Gómez
ff4f5f322b fix: tweak relay link text and icon size 2026-03-19 16:12:38 +01:00
Alejandro Gómez
d709d5d5d8 feat: rich relay links in chat 2026-03-19 12:31:02 +01:00
Alejandro Gómez
d3d038929e ui: show relay name if available instead of host 2026-03-19 12:17:42 +01:00
Alejandro Gómez
3261b2a36a feat: render keypackage relay lists as relay lists 2026-03-19 12:14:50 +01:00
Alejandro Gómez
5161c3a799 feat: add kind 10051 (KeyPackage Relays) to relay list settings
Uncomment kind 10051 in kinds registry with NIP-EE attribution and add
it to the relay list editor so users can manage MLS KeyPackage relays.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 12:11:54 +01:00
Alejandro Gómez
329265645b docs: full command refernce 2026-03-18 11:23:44 +01:00
Alejandro Gómez
cd889d70cb feat: add outbox relay resolution to spellbook loading
Spellbook URLs only queried hardcoded aggregator relays, missing events
published to other relays. Now fetches the author's kind:10002 relay list
and includes their outbox relays when loading kind:30777 spellbook events.

Extract useUserRelays hook from inline pattern and refactor
useRepositoryRelays to use it.
2026-03-18 11:07:46 +01:00
Alejandro Gómez
400e60107f fix: don't transition away from eose state 2026-03-17 10:25:25 +01:00
Alejandro Gómez
c283313bb8 fix: clean reply state synchronously and cleanly 2026-03-17 09:22:02 +01:00
Alejandro Gómez
364dc48247 fix: disable rich syntax in chat and poast composers 2026-03-16 16:42:52 +01:00
Alejandro Gómez
437313b7ff ux: focus input after reply selection 2026-03-16 16:31:54 +01:00
Alejandro Gómez
ce7b2478cd fix: show only chat kinds as replies 2026-03-16 16:29:37 +01:00
Alejandro Gómez
02ec642be6 fix: avoid stale closure in keyboard submit handler 2026-03-16 16:14:47 +01:00
Alejandro Gómez
0aecdd6894 ui: change kind 11 icon 2026-03-16 13:48:09 +01:00
Steffen Rörtgen
5619122b80 feat: add Educational Resource (kind 30142) with AMB metadata support (#260)
* feat: add Educational Resource (kind 30142) with AMB metadata support

- Add feed and detail renderers for AMB Educational Resource events
- Add amb-helpers library with cached helper functions and tests
- Handle broken thumbnail images with BookOpen placeholder fallback
- Surface primary resource URL prominently in both renderers (bookmark-style)
- Register kind 30142 with GraduationCap icon in kind registry
- Link NIP-AMB badge to community NIP event (kind 30817)

* fix: address PR #260 review comments for Educational Resource renderers

- Rename Kind30142*Renderer to EducationalResource*Renderer (human-friendly names)
- Localize language names with Intl.DisplayNames via shared locale-utils
- Use ExternalLink component for license and reference URLs
- Localize ISO dates with formatISODate, fixing UTC timezone shift bug
- Remove # prefix from keyword labels in both feed and detail renderers
- Remove image/thumbnail from feed renderer
- Extract getBrowserLanguage to shared locale-utils, reuse in amb-helpers

* fix: mock getBrowserLanguage in tests for Node < 21 compat

Tests were directly mutating navigator.language which doesn't exist
as a global in Node < 21, causing ReferenceError in CI.
2026-03-16 09:34:29 +01:00
Alejandro Gómez
8e11139c5d fix: skip max check on 0 maxSendable 2026-03-10 11:08:42 +01:00
Alejandro Gómez
80bd6c4e72 fix: normalize supported NIPs to strings 2026-03-06 15:09:02 +01:00
Alejandro Gómez
a7c70fa0a6 fix: simplify nip-29 group message and metadata fetching and avoid inconsistencies 2026-03-06 13:25:58 +01:00
Alejandro
80a421b9fe Centralize relay publishing via PublishService (#211)
* feat: centralize publish flow with RxJS-based PublishService

Create a unified PublishService that:
- Provides consistent relay selection (outbox + state + hints + fallbacks)
- Emits RxJS observables for per-relay status updates
- Handles EventStore integration automatically
- Supports both fire-and-forget and observable-based publishing

Refactor all publish locations to use the centralized service:
- hub.ts: Use PublishService for ActionRunner publish
- delete-event.ts: Use PublishService (fixes missing eventStore.add)
- publish-spell.ts: Use PublishService with relay hint support
- PostViewer.tsx: Use publishWithUpdates() for per-relay UI tracking

This lays the groundwork for the event log feature by providing
observable hooks into all publish operations.

* feat: add LOG command for relay event introspection

Add an ephemeral event log system that tracks relay operations:

- EventLogService (src/services/event-log.ts):
  - Subscribes to PublishService for PUBLISH events with per-relay status
  - Monitors relay pool for CONNECT/DISCONNECT events
  - Tracks AUTH challenges and results
  - Captures NOTICE messages from relays
  - Uses RxJS BehaviorSubject for reactive updates
  - Circular buffer with configurable max entries (default 500)

- useEventLog hook (src/hooks/useEventLog.ts):
  - React hook for filtering and accessing log entries
  - Filter by type, relay, or limit
  - Retry failed relays directly from the hook

- EventLogViewer component (src/components/EventLogViewer.tsx):
  - Tab-based filtering (All/Publish/Connect/Auth/Notice)
  - Expandable PUBLISH entries showing per-relay status
  - Click to retry failed relays
  - Auto-scroll to new entries (pause on scroll)
  - Clear log button

- LOG command accessible via Cmd+K palette

* fix: prevent duplicate log entries and check relay OK response

- EventLogService: Check for existing entry before creating new one
  when handling publish events (prevents duplicates from start/complete)
- PublishService: Check response.ok from pool.publish() to detect
  relay rejections instead of assuming success on resolve
- Update test mock to return proper publish response format

* feat: keep relay selection in call site, compact logs

* chore: cleanup

* fix: make Timestamp component locale-aware via formatTimestamp

Timestamp was hardcoded to "es" locale. Now uses formatTimestamp()
from useLocale.ts for consistent locale-aware time formatting.
Added Timestamp to CLAUDE.md shared components documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: improve event-log reliability, add ERROR type and per-relay timing

Service improvements:
- Fix notice$ duplicate logging with per-relay dedup tracking
- Remove dead Array.isArray code path (notice$ emits strings)
- Increase relay poll interval from 1s to 5s
- Clean publishIdToEntryId map on terminal state, not just overflow
- Immutable entry updates (spread instead of in-place mutation)
- Extract NewEntry<T>/AddEntryInput helper types for clean addEntry signature
- Clear lastNoticePerRelay on log clear

New capabilities:
- ERROR log type: subscribes to relay.error$ for connection failure reasons
- RelayStatusEntry with updatedAt timestamp for per-relay response timing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: improve EventLogViewer with virtualization, timing, and error display

- Virtualize log list with react-virtuoso for 500-entry buffer performance
- Add ErrorEntry renderer for new ERROR log type (AlertTriangle icon)
- Show per-relay response time (e.g. "142ms", "2.3s") in publish details
- Make all entry types expandable (connect/disconnect now have details)
- Show absolute timestamp in all expanded detail views
- Group ERROR events under Connect tab filter

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: prevent duplicate PUBLISH log entries from completion event

PublishService emits publish$ twice: once at start, once on completion.
The eager publishIdToEntryId cleanup in handleStatusUpdate fired before
the completion emission, causing handlePublishEvent to create a second
entry. Removed eager cleanup — overflow eviction is sufficient.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-04 17:35:44 +01:00
Alejandro Gómez
ee09cac2e0 fix: emoji and profile suggestion UX/UI fixes 2026-03-03 22:29:17 +01:00
Alejandro Gómez
15fe8b6c59 fix: parse address 2026-03-03 22:22:35 +01:00
Alejandro Gómez
772e1b1404 refactor: extract useRepositoryRelays hook from NIP-34 renderers
Removes ~45 lines of identical relay resolution boilerplate duplicated
across 6 renderers (Issue, Patch, PR - feed and detail views).

The hook encapsulates the 3-tier fallback: repo relays → owner outbox →
aggregators, and also returns the repository event needed for
getValidStatusAuthors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 21:58:11 +01:00