Ponder

Feed Feature

News-feed behavior, content ingestion, categories, personalization, and likes.

Purpose

The feed is the main For You reading surface. It loads a broad discover pool from content, personalizes ordering client-side, and lets the user tune, save, like, open, and verify articles.

Tables

Primary table: content

Relevant columns:

Supporting tables:

Categories

The discover category list is defined in content_repository_support.dart and ContentCategory:

ContentCategory.unknown exists in the Flutter model as a fallback but is not declared in the Appwrite enum.

Feed Query

FeedRepository.fetchDiscoverBatch queries content with:

Rows map into ContentItem, then deduplicate by sourceUrl when present, otherwise by normalized title.

Personalization

feedPersonalizationSnapshotProvider builds a snapshot from:

ForYouNotifier uses this snapshot to:

Tuning

FeedTuningController handles:

Local preferences are stored in shared_preferences. For signed-in users, backend sync writes:

The feed refreshes the off-screen tail after tuning, keeping the current story in place.

Likes

Feed cards use LikeService:

The UI supports double-tap heart animation and signed-out like gating.

news_refresh Function

news_refresh fetches NewsAPI and Guardian content, normalizes it, quality-filters it, deduplicates by URL, skips existing content with matching sourceUrl, and inserts rows into content.

Inserted rows include:

UI

ForYouScreen is a one-item-at-a-time vertical feed. It uses a controlled PageView, keyboard and wheel navigation, touch swipe detection, pull-to-refresh on the first item, search shortcut, save button, like button, and tuning bottom sheets.