Skip to content

Feature: Show a feed of posts from your groups with icon compatibility fix (Fixes #362)#395

Closed
NotThatKindOfDrLiz wants to merge 1 commit into
mainfrom
feature/group-posts-feed
Closed

Feature: Show a feed of posts from your groups with icon compatibility fix (Fixes #362)#395
NotThatKindOfDrLiz wants to merge 1 commit into
mainfrom
feature/group-posts-feed

Conversation

@NotThatKindOfDrLiz
Copy link
Copy Markdown
Member

Description

This PR implements a feature to show a feed of posts from all groups a user has joined, addressing issue #362. The implementation includes a special approach to handle icon compatibility issues with lucide-react.

Features Implemented

  1. Created a new /feed route that shows posts from all groups the user is a member of
  2. Implemented group posts feed with tabs for "Approved" and "All" posts
  3. Created a group post item component that displays posts with their group context
  4. Added navigation in the header for easy access to the feed
  5. Added a custom Icon component to handle icon compatibility issues

Technical Implementation

Feed Feature

  • Posts are fetched group by group to avoid overwhelming relays with large queries
  • Posts are properly filtered to exclude:
    • Removed posts
    • Posts from banned users
    • Posts that are replies rather than top-level posts
  • The implementation respects the group approval system:
    • Has tabs for "Approved" vs "All" posts
    • Includes auto-approval logic for posts by approved members
  • Posts are displayed in chronological order (newest first)
  • Each post shows which group it belongs to with a direct link to view it in context

Icon Compatibility Fix

  • Created a custom Icon component that wraps lucide-react icons
  • Added fallback SVG implementations for icons that might not be available in the library
  • Replaced direct icon imports with the custom component to prevent errors
  • Implemented graceful fallbacks if icons are not found

Why This Approach

The custom Icon component provides a robust solution to the compatibility issues with lucide-react icons:

  1. Works regardless of which specific icons are available in any version of the library
  2. Doesn't rely on importing specific icons directly
  3. Provides suitable fallbacks even if icons are missing
  4. Makes icon usage more maintainable across the app

Testing Instructions

  1. Log in to the application
  2. Join multiple groups
  3. Navigate to the "Feed" page using the header link
  4. Toggle between "Approved" and "All" tabs
  5. Click on group badges to visit the source group
  6. Click "View in group" to see a post in full context

Closes #362

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.

Feature: Show a feed of posts from your groups

1 participant