Multiple Named Feeds per User

Feature Request

Allow users to have multiple named feeds, each with its own combination of feed generators and follow lists. This enables users to create focused feeds for different contexts (e.g., "Work Topics", "AI Research", "Politics").

Current Behavior

Each user has a single implicit feed composed of:

  • Enabled feed generators (via user_feed_generators table)
  • Active follow lists (via user_active_follow_lists table)
  • A single view position tracked per viewer/owner pair

Proposed Behavior

Users can create multiple named feeds, each independently configured:

  • Each feed has its own set of enabled generators with their parameters
  • Each feed has its own set of active follow lists
  • Each feed tracks its own view position (last seen event)
  • One feed is marked as "default" (cannot be deleted, shown by default)

Requirements

Database Schema

  1. New user_feeds table:

    • id (PK), creator_id (FK to users), name, description, is_default (boolean)
    • Unique constraint on (creator_id, name)
    • Trigger to auto-create default feed named "My Feed" on user creation
  2. Modify user_feed_generators:

    • Add feed_id column (FK to user_feeds)
    • Change unique constraint to (feed_id, generator_id, parameters)
    • Migration: create default feed for existing users, link existing records
  3. Modify user_active_follow_lists:

    • Change from (user_id, follow_list_id) to (feed_id, follow_list_id)
    • Migration: link existing active lists to default feed
  4. Modify feed_view_positions:

    • Change from (viewer_user_id, feed_owner_user_id) to (viewer_user_id, feed_id)
    • Each feed has independent view tracking
    • Migration: link existing positions to default feed

API Functions

  1. Feed CRUD:

    • createFeed(p_creator_id, p_name, p_description) - returns feed_id
    • getFeeds(p_user_id) - list all feeds for user with is_default flag
    • getFeed(p_feed_id) - get single feed details
    • updateFeed(p_feed_id, p_name, p_description) - rename/update
    • deleteFeed(p_feed_id) - delete (prevent default feed deletion)
  2. Modify existing functions to accept feed_id:

    • addGeneratorToFeed(p_feed_id, p_generator_id, p_parameters)
    • removeGeneratorFromFeed(p_assignment_id, p_feed_id)
    • activateFollowListForFeed(p_feed_id, p_list_id)
    • deactivateFollowListForFeed(p_feed_id, p_list_id)
    • get_user_feed_events(p_feed_id, ...) - events for specific feed
    • record_feed_view(p_viewer_id, p_feed_id, ...) - track per feed
    • get_feed_new_count(p_viewer_id, p_feed_id) - new count per feed
  3. Backward compatibility:

    • Keep existing function signatures working with default feed
    • Add overloaded versions or default parameters

UI Components

  1. Feed Selector:

    • Dropdown or tabs to switch between feeds
    • Show feed name and new event count badge
    • Quick access to default feed
  2. Feed Management Page:

    • List all user's feeds
    • Create new feed (name, description)
    • Edit feed details
    • Delete feed (with confirmation, prevent default deletion)
    • Duplicate feed (copy generators and follow lists)
  3. Per-Feed Configuration:

    • Reuse existing PvFeedManagement component
    • Scope generator assignments to selected feed
    • Scope follow list activation to selected feed
  4. Modify existing components:

    • PvUserFeedViewer - add feed selector
    • PvFeedEventList - accept feed_id prop
    • PvFeedNewCount - accept feed_id prop
    • PvFeedManagement - scope to selected feed

Migration Strategy

  1. Create user_feeds table
  2. Insert default feed for all existing users
  3. Add feed_id column to modified tables (nullable initially)
  4. Backfill feed_id with default feed for existing records
  5. Make feed_id NOT NULL
  6. Update constraints and indexes
  7. Update API functions
  8. Deploy UI changes

User Stories

  1. As a user, I want to create a "Work" feed with only work-related tags and sources, so I can focus during business hours.

  2. As a user, I want to create an "AI Research" feed that follows specific AI-related propositions and uses the "Propositions by Tag" generator for AI tags.

  3. As a user, I want to switch between feeds quickly to change context without reconfiguring generators each time.

  4. As a user, I want each feed to track what I've seen independently, so switching feeds shows me new events in that feed.

  5. As a user, I want to duplicate an existing feed as a starting point for a new one with similar configuration.

Database

  • ratings-sql/V073__feed_generators.sql - current feed generator schema
  • ratings-sql/V075__feed_view_positions.sql - view position tracking
  • ratings-sql/V077__follow_lists.sql - follow lists and active lists
  • ratings-sql/R__060_feed_generators_api.sql - feed generator API
  • ratings-sql/R__062_feed_events_view.sql - feed event functions
  • ratings-sql/R__063_feed_view_api.sql - feed view tracking API
  • ratings-sql/R__065_follow_lists_api.sql - follow list API

UI

  • ratings-ui-demo/src/pvcomponents/pv-user-feed-viewer.tsx
  • ratings-ui-demo/src/pvcomponents/pv-feed-event-list.tsx
  • ratings-ui-demo/src/pvcomponents/pv-feed-management.tsx
  • ratings-ui-demo/src/pvcomponents/pv-feed-new-count.tsx
  • ratings-ui-demo/src/components/feed-view-context.tsx
  • ratings-ui-demo/src/services/api-v1.ts

Open Questions

  1. Should users be able to share/publish feeds for others to subscribe to?
  2. Should there be a limit on the number of feeds per user?
  3. Should feeds support visibility settings (private/public)?
  4. Should we support feed "presets" or templates that users can start from?