Skip to content

Conversation

mckenziearts
Copy link

This PR updates the PageBuilder component to be compatible with Filament v4.

Change

Action Mounting

  • Replaced mountFormComponentAction() with mountAction() which is the correct method in Filament v4
  • Added proper action context using { schemaComponent: '{$key}' } instead of passing the statePath as the first argument
  • Added $key = $getKey() in the main page-builder template to provide the component key
  • Passed :key="$key" prop to all block picker components (dropdown and modal variants)

Component Updates

  • Replaced x-filament::grid component with plain div using Tailwind classes (grid gap-1) in dropdown-block-picker
  • Changed if ($afterItem) to if (filled($afterItem)) for consistency with Filament conventions

Breaking Changes

None - this maintains backward compatibility while adding v4 support.

Additional Context

In Filament v4, the action mounting system changed from mountFormComponentAction(statePath, actionName, arguments) to mountAction(actionName, arguments, context) where context is an object containing schemaComponent key. This PR updates all block picker components to use the new API.

Copy link

what-the-diff bot commented Oct 8, 2025

PR Summary

  • Updated Namespace Import for Action
    Changed the location from where the Action class is being imported in a necessary file which should lead to better organization of the code.

  • Added consistent unique key handling
    By introducing a $key variable, we make sure unique keys are passed consistently. This should enhance stability and predictability in related functions.

  • Improved Component Attributes
    Multiple component attributes were updated to acknowledge the new :key="$key" attribute. Greater accuracy and control are expected with this update.

  • Modified Parameter Arrays
    By adding 'key' to the parameter arrays, it becomes easier to reference this important parameter further in the code.

  • Refined Value Checking
    Updated the method for checking if values exist, aiming for a more robust and error-free result.

  • Refactored Action Mounting
    Switched to a more efficient method to mount actions, which also includes the new key. This should boost the performance of related processes in the system.

  • HTML Structure Adjustment
    Changed the HTML structure in one of the files for increased flexibility, which should lead to better adaptability for various screen sizes and devices.

  • Class Name Adjustments
    Minor changes to the class names for buttons and icons were made which should improve consistency in the visual design.

@Z3d0X Z3d0X requested a review from Voltra October 9, 2025 04:21
</x-slot>

<x-filament::dropdown.list>
<x-filament::grid
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the component is still available, I think it's best we keep it until it's deprecated

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about x-filament-schemas::grid?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component no longer exists on filament v4 you must use a div instead.

Copy link
Collaborator

@Voltra Voltra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

can always change back the grid component if needed

@Voltra Voltra self-assigned this Oct 9, 2025
@Voltra
Copy link
Collaborator

Voltra commented Oct 10, 2025

@Z3d0X ready for a release

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.

2 participants