Feed: embedded event references (nostr:nevent) render as raw badge until the note is visited #37

Closed
opened 2026-07-10 09:51:29 +00:00 by laoc · 1 comment
Owner

Bug

Notes in the feed that quote/reference another event via nostr:nevent… sometimes render the reference as a raw badge chip (e.g. nevent1qqs82…) instead of the embedded event card. After clicking into the note view and navigating back, the embed renders correctly.

Hypothesis

The embed component resolves the referenced event only from the EventStore and never triggers a network load. Visiting the note view loads the referenced event into the EventStore, which is why it renders after back-navigation. Fix: when the referenced event is not in the store, kick off an applesauce event loader (using the relay hints from the nevent, falling back to app relays), and render the embed reactively once it arrives. Keep the badge as a fallback while loading / when unresolvable.

Acceptance criteria

  • A nostr:nevent/nostr:note reference in feed note content loads the referenced event on first render (no visit-and-back needed).
  • Relay hints embedded in the nevent are used for the lookup.
  • Graceful fallback (badge/skeleton) while loading and when the event can't be found.
  • Unit/component test for the resolve-or-load behavior.
## Bug Notes in the feed that quote/reference another event via `nostr:nevent…` sometimes render the reference as a raw badge chip (e.g. `nevent1qqs82…`) instead of the embedded event card. After clicking into the note view and navigating back, the embed renders correctly. ## Hypothesis The embed component resolves the referenced event **only from the EventStore** and never triggers a network load. Visiting the note view loads the referenced event into the EventStore, which is why it renders after back-navigation. Fix: when the referenced event is not in the store, kick off an applesauce event loader (using the relay hints from the nevent, falling back to app relays), and render the embed reactively once it arrives. Keep the badge as a fallback while loading / when unresolvable. ## Acceptance criteria - A `nostr:nevent`/`nostr:note` reference in feed note content loads the referenced event on first render (no visit-and-back needed). - Relay hints embedded in the nevent are used for the lookup. - Graceful fallback (badge/skeleton) while loading and when the event can't be found. - Unit/component test for the resolve-or-load behavior.
Author
Owner

Fixed on branch feat/feed-issues-34-37 (commit c9fe41ad). NotePreview no longer does a one-shot fetch: it subscribes to eventStore.event(pointer) (relay hints from the nevent unioned with lookup relays), the store's fallback loader auto-fetches on miss, and a late-arriving event upgrades the badge to the embedded card without remount. Verified in the browser: quoted notes render as embedded cards on first load; the remaining badge case is the intentional depth-2 nesting cutoff.

Fixed on branch [`feat/feed-issues-34-37`](https://git.edufeed.org/edufeed/edufeed-app/src/branch/feat/feed-issues-34-37) (commit c9fe41ad). NotePreview no longer does a one-shot fetch: it subscribes to `eventStore.event(pointer)` (relay hints from the nevent unioned with lookup relays), the store's fallback loader auto-fetches on miss, and a late-arriving event upgrades the badge to the embedded card without remount. Verified in the browser: quoted notes render as embedded cards on first load; the remaining badge case is the intentional depth-2 nesting cutoff.
laoc closed this issue 2026-07-14 13:26:02 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
edufeed/edufeed-app#37
No description provided.