Skip to content

fix: refresh field list after duplicating a custom field#98

Merged
ManukMinasyan merged 1 commit into3.xfrom
fix/refresh-after-duplicate
Mar 6, 2026
Merged

fix: refresh field list after duplicating a custom field#98
ManukMinasyan merged 1 commit into3.xfrom
fix/refresh-after-duplicate

Conversation

@ManukMinasyan
Copy link
Collaborator

Summary

  • Listen for field-created event in ManagesFields trait and ManageFieldsTable so the UI updates without a page reload after duplicating
  • Rename fieldDeleted() to refreshSection() since it now handles both events
  • Use array syntax for #[On] attributes instead of stacking
  • Fix rector: import CustomFieldOptionSettingsData instead of using FQCN

Test plan

  • All 28 related tests pass (duplicate, delete, activate, reorder)
  • Rector, PHPStan, Pint all clean

Listen for 'field-created' event in ManagesFields trait and
ManageFieldsTable so the UI updates without a page reload.
Also rename fieldDeleted() to refreshSection() and use array
syntax for #[On] attributes.
Copilot AI review requested due to automatic review settings March 6, 2026 15:44
@ManukMinasyan ManukMinasyan merged commit 68be195 into 3.x Mar 6, 2026
2 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves the Filament/Livewire custom fields management UI so the field list refreshes automatically after duplicating a custom field, avoiding the need for a full page reload.

Changes:

  • Listen for the field-created Livewire event to refresh the relevant field lists after duplication.
  • Rename the section refresh handler from fieldDeleted() to refreshSection() to reflect its broader responsibility.
  • Replace fully-qualified CustomFieldOptionSettingsData usage in a feature test with an import.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/Feature/Admin/Pages/CustomFieldsFieldManagementTest.php Imports CustomFieldOptionSettingsData and uses it directly when updating option settings in duplication-related tests.
src/Livewire/ManageFieldsTable.php Refreshes the cached field lists when field-created fires (in addition to existing delete/reorder refresh behavior).
src/Livewire/Concerns/ManagesFields.php Refreshes the section when field-created or field-deleted fires, and renames the handler to refreshSection().

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