From 1075d3f822748be2de031865dc470ce22ecdac55 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 22 Jun 2026 20:00:36 -0400 Subject: [PATCH] channel: optimistic render includes ingested NIP-71 videos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getCachedChannelVideoEvents early-returned kind-30078-only rawEvents and skipped allEvents, so a creator's ingested NIP-71 videos didn't show in the optimistic (pre-fetch) render. Now it merges raw 30078 (first, so they win the downstream id-dedupe) with processed allEvents (which holds ingested foreign videos) → the wall paints instantly on revisit / when the feed already loaded that author. Cross-ecosystem dedupe collapses any overlap. Also records TODO 17d (unified grid loading follow-ups): streaming channel/search fetch, per-channel persisted cache, My Videos NIP-71 inclusion, and consolidating bespoke loaders behind one shared streaming grid source. 1262/1263 unit (known UploadModal flake). Co-Authored-By: Claude Opus 4.8 --- js/channelProfile.js | 10 +++++----- todo/TODO_2026-06-20_pre-launch.md | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/js/channelProfile.js b/js/channelProfile.js index c670a116..b1ec7893 100644 --- a/js/channelProfile.js +++ b/js/channelProfile.js @@ -4428,10 +4428,10 @@ function getCachedChannelVideoEvents(pubkey) { } }); - if (rawMatches.length) { - return rawMatches; - } - + // Include processed videos from allEvents too (raw 30078 first so they win the + // id-dedupe downstream): this surfaces ingested NIP-71 videos for the author so + // their wall renders optimistically on revisit / when the feed already loaded + // them. Cross-ecosystem dedupe collapses any overlap. const processedMatches = collectMatches( nostrClient?.allEvents, (callback) => { @@ -4448,7 +4448,7 @@ function getCachedChannelVideoEvents(pubkey) { } ); - return processedMatches; + return [...rawMatches, ...processedMatches]; } function normalizeRenderableChannelVideo(entry) { diff --git a/todo/TODO_2026-06-20_pre-launch.md b/todo/TODO_2026-06-20_pre-launch.md index 5dbff124..8279ef57 100644 --- a/todo/TODO_2026-06-20_pre-launch.md +++ b/todo/TODO_2026-06-20_pre-launch.md @@ -344,6 +344,26 @@ CDN url + WebTorrent (bitvid extras come free), one-shot import + re-run button. delete "hosted file left behind" warning is suppressed, liveness stays unverifiable. Full (re-hosted) imports set the flag false. +### 17d. Unified video-grid loading (streaming + optimistic) — follow-ups +Goal: every grid loads with the same fast UX. Status: cross-ecosystem dedup +(17c Phase 1) is live at the shared chokepoint; main feed already streams + +has a persisted cache; channel/search now render optimistically from +`allEvents` (incl. ingested NIP-71). Remaining: +- [ ] **Streaming channel/search fetch.** `loadUserVideos` does a one-shot + `pMapSettled(relays, pool.list)` and renders only after ALL relays settle, + so a slow relay holds up the grid (~2-3s). Switch to the subscription + manager's streaming + render incrementally (first-relay-wins), like the main + feed's buffered subscription. Extract the fetch into `channelProfileVideos.js` + (channelProfile.js is at its size cap). +- [ ] **Per-channel persisted cache** for instant revisits (mirror the main feed's + `bitvid:filtered-videos` optimistic cache, keyed per author). +- [ ] **My Videos: include NIP-71** in its `allEvents` read so a creator's own + cross-posted videos appear in management too (reuse the cross-ecosystem + dedupe so the bitvid version wins). +- [ ] **Consolidate** the bespoke loaders (channel/search/My Videos) behind one + shared streaming grid source so future grids inherit streaming + optimistic + + dedupe for free. + ### 17b. Channel Profile wall shows only bitvid videos, not NIP-71 (LAUNCH-BLOCKER) - [x] **Fixed** (`js/channelProfileVideos.js`): the channel grid now fetches the author's NIP-71 videos (kinds 21/22/34235/34236) alongside kind-30078 via