Skip to content

Code cleanup: Remove browse-list.tsx and related redundant components #467

@coderabbitai

Description

@coderabbitai

Overview

The codebase currently contains redundant components for thread listing. The browse-list.tsx and its related components duplicate functionality that is already provided by thread-list.tsx, which has been developed to support all pages, including public pages.

Files to Remove

  1. Main Component:

    • apps/masterbots.ai/components/routes/browse/browse-list.tsx
  2. Browse Directory:

    • All components in apps/masterbots.ai/components/routes/browse/ directory
  3. Context Provider:

    • apps/masterbots.ai/lib/hooks/use-browse.tsx (BrowseProvider and context)

Files to Update

  1. Layouts:

    • apps/masterbots.ai/app/c/layout.tsx - Update to remove BrowseProvider wrapper
  2. Pages/Components Using BrowseList:

    • Any page files importing BrowseList components
    • Any components using the useBrowse hook

Reason for Removal

The thread-list.tsx component has been developed to support all pages and use cases, making the browse-list component redundant. Key similarities include:

  1. Both fetch and filter threads in a similar way
  2. Both implement infinite scrolling with loadMore
  3. Both handle thread activation and popup management
  4. Both share similar state management patterns

Removing these redundant components will:

  • Reduce code duplication
  • Simplify the codebase structure
  • Make maintenance easier
  • Prevent confusion about which component should be used

Additional Files to Review

These files may have similar redundancies and should be reviewed:

  • Check if other *-list.tsx components have overlapping functionality
  • Review other context providers that might serve similar purposes
  • Examine utility functions that might be duplicated

Implementation Steps

  1. Replace all BrowseList usages with ThreadList
  2. Migrate any unique functionality from browse components to thread components if needed
  3. Update any context dependencies
  4. Remove the unused files
  5. Ensure the application works correctly after changes

This issue is part of our ongoing effort to clean up the codebase and reduce redundancy.

Related PR

This issue was identified during review of PR #465.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions