feat: configurable description position for custom fields [3.x]#133
Merged
ManukMinasyan merged 7 commits into3.xfrom Apr 14, 2026
Merged
feat: configurable description position for custom fields [3.x]#133ManukMinasyan merged 7 commits into3.xfrom
ManukMinasyan merged 7 commits into3.xfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a per-custom-field setting to control whether a field’s description renders above or below the input, gated behind a new feature flag and persisted in the existing settings JSON via CustomFieldSettingsData.
Changes:
- Introduces
DescriptionPositionenum (below/above) with translatable labels. - Adds
FIELD_DESCRIPTION_POSITIONfeature flag and a management UI select forsettings.description_position. - Updates Filament form component rendering to use
aboveContent()when configured (otherwise default helper text below).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/Enums/DescriptionPosition.php |
New enum for ABOVE/BELOW description placement with labels. |
src/Enums/CustomFieldsFeature.php |
Adds new FIELD_DESCRIPTION_POSITION feature gate. |
src/Data/CustomFieldSettingsData.php |
Persists nullable descriptionPosition in settings DTO. |
src/Filament/Integration/Base/AbstractFormComponent.php |
Renders description via aboveContent() when enabled/configured. |
src/Filament/Management/Schemas/FieldForm.php |
Adds description position select + makes description textarea live(). |
resources/lang/en/custom-fields.php |
Adds translations for new label/options. |
tests/Feature/DescriptionPositionTest.php |
New Pest coverage for enum/flag/DTO/rendering scenarios. |
docs/superpowers/specs/2026-04-13-custom-field-description-position-design.md |
Design spec for the feature. |
docs/superpowers/plans/2026-04-13-custom-field-description-position.md |
Implementation plan and checklist. |
b62e83d to
98710af
Compare
Collaborator
Author
|
All 4 review comments addressed in dbc3aab:
|
- Add HasLabel interface to DescriptionPosition enum, simplify Select options to use enum class string - Change description Textarea ->live() to ->live(onBlur: true) - Remove dead $default parameter from getDecimalPlaces() - Remove redundant null coalescing on non-nullable properties - Tighten getVisibilityData() return type to non-nullable VisibilityData
dbc3aab to
2b4609f
Compare
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.
Summary
DescriptionPositionenum withBELOW/ABOVEcases mapping to Filament'sbelowContent()andaboveContent()schema slotsFIELD_DESCRIPTION_POSITIONfeature flag (disabled by default) — bothFIELD_DESCRIPTIONandFIELD_DESCRIPTION_POSITIONmust be enabled for the position selector to appearsettingscolumn viaCustomFieldSettingsDataChanges
src/Enums/DescriptionPosition.phpsrc/Enums/CustomFieldsFeature.phpFIELD_DESCRIPTION_POSITIONcasesrc/Data/CustomFieldSettingsData.phpdescriptionPositionpropertysrc/Filament/Integration/Base/AbstractFormComponent.phpwhen()blocksrc/Filament/Management/Schemas/FieldForm.phplive()on description Textarearesources/lang/en/custom-fields.phpTest plan
tests/Feature/DescriptionPositionTest.phpcovering: