Skip to content

Latest commit

 

History

History
55 lines (44 loc) · 2.88 KB

File metadata and controls

55 lines (44 loc) · 2.88 KB

Flowforge Filter Integration Refactoring Task

Project Scope

Flowforge is a Laravel package that creates Kanban boards from Eloquent models in Filament admin panels. We've successfully integrated Filament's table filtering system into Flowforge boards, but the implementation has become overly complex.

Current Status

Working Features:

  • Board accepts ->filters([Filter::make(), SelectFilter::make(), etc.])
  • Filter dropdown opens with native Filament UI
  • All filter types work (search, select, date ranges, relationships)
  • Filters actually filter the board data (confirmed via SQL logs)
  • UI matches Filament's exact styling and behavior

Problems:

  • Code is overly complex with 600+ lines across multiple files
  • Multiple traits with overlapping responsibilities
  • Complex state management and wrapper classes
  • Hard to maintain and understand

Business Objective

Maintain 100% of current filtering functionality while dramatically reducing code complexity. The user experience should remain identical, but the implementation should be much simpler for long-term maintainability.

Success Criteria

  • Same user experience (no functional changes)
  • Same Filament native UI/UX
  • Significant code reduction (target: 70%+ less code)
  • Cleaner, more maintainable architecture
  • All existing filter types continue working

Key Files Currently Involved

  • src/Board/Concerns/HasBoardFilters.php (254 lines)
  • src/Concerns/InteractWithBoardFilters.php (384 lines)
  • resources/views/components/filters.blade.php (89 lines)
  • Various integration points in existing files

Current Working Demo

The TasksBoard at /Users/manuk/Herd/filamentphp-demo/app/Filament/Clusters/Management/Pages/TasksBoard.php demonstrates the current implementation working with:

  • Search filter (text input with live search)
  • Priority filter (SelectFilter with enum options)
  • Assignee filter (SelectFilter with relationship)
  • Date range filter (custom Filter with DatePicker components)

Implementation Freedom

You have full creative freedom to redesign the architecture. The only constraints are:

  1. Maintain exact same user functionality
  2. Keep Filament's native UI components and styling
  3. Preserve the ->filters([...]) API for end users

Feel free to completely rewrite, consolidate, or restructure as needed to achieve a clean, maintainable solution.

Technical Context

The current implementation works by creating a bridge between Flowforge's Board component and Filament's table filter system. The challenge is that Filament filters expect to work with Table components, but we're using them with Kanban boards. The working solution successfully provides this bridge but with significant complexity overhead.

Expected Outcome

A clean, maintainable filtering system that provides the same powerful Filament filtering capabilities but with dramatically reduced code complexity and improved maintainability.