feat: native builder filters and field schema extensions - #223
Merged
Conversation
… an edit The section-edit test for a bag key with no form component passed before SettingsMerger existed (Filament already preserved that untouched key), so the spec's predicted wipe did not reproduce there. Kept as a pin. The other wipe case, an extra key alongside a rendered extension key, did reproduce and is fixed by the merge.
Retracts the earlier commit's claim that Filament preserved the untouched extra key on its own; the prior test passed only because SECTION_CONDITIONAL_VISIBILITY was off by default, so the section form rendered no settings.* component and submitted no settings key at all, never exercising the merge.
The settings merge now recurses, so switching a field or section back to Always visible left the old conditions in the row instead of replacing the bag. Every reader gates on the mode, so they were dead weight that would reappear on the next mode change.
Evaluating visibility once for the whole entity moved the model access ahead of the empty-section short circuit, turning a builder without a model from an empty collection into a typed property error.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consumers can filter fields and sections directly on Table, Infolist, and Exporter builders. Application defaults use Laravel container
resolving()callbacks targeted at concrete builders.getFields()andgetSections()expose standard collections. Builders provide nativewhen(),unless(), andtap(), plus model and persisted-record accessors. Eloquent queries remain on the configured custom field model.Adds
FieldForm::extendSchemaUsing()andsetting()accessors with Laravel dot notation. Settings edits preserve unrendered keys while submitted lists and nulls replace stored values.Cloned infolists retain configured callbacks and resolve their current record. Conditional visibility retains cross-section dependencies and prioritizes same-section fields when codes repeat. Reused section scopes replace previous constraints, and collection mutation preserves cached metadata.
Filters apply to presentation builders. Forms and importers retain their existing persistence behavior.
Validation: 983 package tests pass, with three existing todos. PHPStan, Rector, Pint, and the documentation build pass. GitHub CI passes on Laravel 12 and 13 at
5391631. Relaticle passes 4,309 tests, with two existing skips, and retains 100% type coverage. Package type coverage remains 99.4%, matching the five pre-existing gaps on 3.x.Browser checks cover field creation, editing, deletion, table columns, infolists, value persistence and clearing, and mobile empty states. A local infolist filter hides Amount while retaining Close Date and Stage. Light and dark screenshots were inspected.
The existing consumer infolist still needs a reload after saving. The original package reproduces that behavior.