Skip to content

feat: add For You feed (extended/follows + trending + hashtags)#469

Merged
barrydeen merged 1 commit intomainfrom
feat/for-you-feed
Apr 17, 2026
Merged

feat: add For You feed (extended/follows + trending + hashtags)#469
barrydeen merged 1 commit intomainfrom
feat/for-you-feed

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • New FOR_YOU feed type, set as the default for new installs (returning users keep their saved feed type)
  • Blends three sources into one sorted stream: extended/follow feed, top-reactions + top-replies trending notes, and notes for all followed hashtags
  • Trending notes (fast relays) fire inline; hashtag notes (slow search relay) batch 10 at a time over a 24h window and stream in after the fact

Implementation notes

  • All supplementary events funnel through EventRepository.addEvent(), reusing the existing dedup (seenEventIds) and binary-insert-by-created_at logic — no separate stream or merge layer
  • Supplementary fetches self-close on EOSE + short drain, so switching tabs doesn't leak subscriptions
  • Silent fallback when the social graph isn't computed yet — For You quietly uses follows-only instead of blocking on a loader
  • loadMore only paginates the main author subscription; trending/hashtag batches are initial-load only
  • restoreSavedFeedType updated so previously-saved FOLLOWS users still land on FOLLOWS on next boot

Test plan

  • New install: lands on For You by default
  • Returning user with saved FOLLOWS/EXTENDED/etc: still restores correctly
  • Fresh account without social graph: For You silently shows follow feed (no loader)
  • Trending notes appear alongside follow content within ~1-3s
  • With 15+ followed hashtags: tagged notes stream in, properly sorted and deduped
  • With no followed hashtags: only trending supplements the follow feed, no search-relay REQs
  • Toggle FOR_YOU → FOLLOWS → FOR_YOU: supplementary fetches re-fire, no orphaned subscriptions
  • Scroll to bottom: loadMore fetches older follow/extended only
  • Trending relay unreachable: feed still loads follow/extended content

…shtags

New default feed type that combines three streams into one sorted list:
- Main author subscription (extended network if cached, follow feed otherwise)
- Top-reactions and top-replies trending notes (today timeframe)
- Notes for all followed hashtags, batched 10 at a time against the search
  relay over a 24h window

Supplementary fetches are one-shot per feed-generation and self-close on
EOSE + drain; events flow through EventRepository.addEvent() for dedup and
in-order insertion alongside the main feed. Pagination paginates only the
author subscription; trending and hashtag batches are initial-load only.
@barrydeen barrydeen merged commit cf672a8 into main Apr 17, 2026
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.

1 participant