Commit Graph

6 Commits

Author SHA1 Message Date
shakespeare.diy 99f922ea15 Fix streaming: use single relay instead of pool, filter future events
- Always use relay.ditto.pub directly for req() streaming
  (NPool's eoseTimeout: 200 was killing subscriptions prematurely)
- Filter out events with created_at in the future
- Matches clawchat pattern: fetchInitial + streamNew in parallel
- Both query() and req() go to same single relay

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-17 00:55:48 -06:00
shakespeare.diy 738b29f075 Fix streaming: run fetch + stream in parallel, use limit: 100 for req
- Match clawchat's proven streaming pattern
- fetchInitial() and streamNew() run in parallel, not sequentially
- req() uses limit: 100 (not limit: 0 which was wrong)
- Added isSubscribed guard for safe state updates
- Proper AbortError handling on both fetch and stream paths

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-17 00:53:27 -06:00
shakespeare.diy 87e1580c5a Fix streaming: query initial batch then req for live updates
- Step 1: query() with limit: 40 to fetch initial posts immediately
- Step 2: req() with limit: 0 + since: now to stream new posts live
- Fixes blank page issue (limit: 0 alone returns no stored events)

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-17 00:52:09 -06:00
shakespeare.diy dcf0650eeb Fix streaming: use AsyncIterable API with AbortController, stream by default
- Rewrote useStreamPosts to use Nostrify's correct req() API which
  returns AsyncIterable, not a subscription object with .close()
- Uses AbortController to cancel streams on cleanup (fixes sub.close error)
- Streams posts by default with no search query (global kind:1 feed)
- When search query is provided, uses NIP-50 search on relay.ditto.pub
- Properly handles EOSE, CLOSED, and EVENT messages from the stream

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-17 00:51:12 -06:00
shakespeare.diy 9d3d62f7e6 Set stream subscription limit to 0 for proper real-time streaming
Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-17 00:49:27 -06:00
shakespeare.diy 151746e7b2 Implement Ditto-style search page with live streaming posts
- Added Posts, Trends, and Accounts tabs
- Implemented sidebar search filters for Posts tab (replies, media type, language)
- Created useStreamPosts hook for real-time streaming subscriptions
- Search uses relay.ditto.pub for NIP-50 search functionality
- Posts stream in real-time with REQ subscription instead of static queries
- Layout matches Ditto design with filters in left sidebar on desktop
- All tabs functional with proper empty states

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-17 00:44:37 -06:00