Needs review
Project:
UI Patterns (SDC in Drupal UI)
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Issue tags:
Reporter:
Created:
18 Sep 2026 at 08:07 UTC
Updated:
26 Sep 2026 at 06:27 UTC
Jump to comment: Most recent
Comments
Comment #2
just_like_good_vibesHello,
i had some similar ideas when i first proposed the plugin deriver, when i kept a lot of metadata about the entity fields (base vs configurable...etc).
we don't have any module settings right now,
but what about introducing a way to control/limit the amount of sources generated/shown?
we could also consider such tuning could be in ui_patterns_ui rather than in the main module.
Comment #3
pdureau commentedI am updating the ticket description which was a bit confusing.
The metadata we need or the ones related to display. Maybe they were among the ones you proposed.
In general, it is betetr to avoid module-wide plain settings files in favor of:
It would be better if it can be done in main module, because not everybody is using
ui_patterns_ui(which is mainly for agencies to configure end users experience).Comment #6
mogtofu33 commentedProposal pushed on
3624220-annotate-fields.What the noisy entries in #3620150: Block library content really are:
field:*andentity_reference:*DerivableContext plugins, not Source plugins. That rules out both keys discussed:no_uionly exists on#[Source], andComponentFormBase::sourcesToOptions()already uses it to hide sources from the slot source selector. Not what we want for power users._block_ui_hiddenis a block definition key, never read by core.SourceMetadataKeyis made for this: derivers write, consumers read. Thefieldbag already holdstypeandcardinality.Changes:
SourceMetadataKey::DisplayConfigurable, the rawisDisplayConfigurable('view')value. Bundle-less derivatives: base field value, TRUE for configurable fields.DerivableContextSourceBase::getChoices()exposesmetadataon each choice.BlockSourceandComponentSourcereturn an empty array, for a uniform shape.DerivedPluginIdsTest.No setting, no UI change in UI Patterns. Filtering stays in consumers.
About the whitelist: on a standard site the flag is FALSE for every node, user and comment base field,
titleincluded. So consumers still need an allowlist. Display Builder will keep its own for now: #3620150: Block library content that are not revision metadata keys.If we later want that rule shared, it can be a second key, e.g.
displayable, added beside this one.display_configurablekeeps mirroring core, so the follow-up would be additive, with no BC break.Comment #7
just_like_good_vibesHello,
i think we need to wait before implementing this issue, because in fact the original request formulation may not be the right solution.
Indeed, re-introducing metadata, but only display_configurable, is not the right answer imho.
have a look at what we deleted in #3591167: Tidy metadata plugin attributes. everything was in place for consumers to decide to filter exactly what they want : what the consumers consider "noisy" VS what is considered useful. i was thinking for a long time, advanced UI would need that data.
we had :
- configurable
- editorial
- parent_base
- base
yes because the fields you mentionned (title for nodes, name for terms..etc and published...etc) could be derived automatically (without hardcoded allowList) from smart metadata.
my guess would be to re-introduce not only display_configurable but a list which would allow a classification which makes probably more sense to the final user (sitebuilder + editor).
Comment #8
pdureau commented[Edit] I have deleted my previous comment, because I am now understanding than /src/SourceMetadataKey.php is the union of 2 different levels of metadata.
Directly in the
metadataattribute of Source plugins:Field = 'field'FieldName = 'field_name'Property = 'property'Provider = 'provider':FieldStorageDefinitionInterface->getProvider(): stringInside
SourceMetadataKey::Field:Type = 'type':FieldStorageDefinitionInterface::getType(): stringCardinality = 'cardinality':FieldStorageDefinitionInterface::getCardinality(): intWhere Jean is proposing:
DisplayConfigurable = 'display_configurable':FieldStorageDefinitionInterface->isDisplayConfigurable('view): boolI was very confused, because it was supposed to be 2 different sets during our work on #3591167: Tidy metadata plugin attributes.
So, let's introduce a new field metadata, but are the rules to define
display_configurableenough? In #3620150: Block library content, we have noticed than this filter remove important fields, likeemailandnamefrom User entity,Can we find other criteria?
FieldDefinition::isInternal()to remove "Default revision"FieldDefinition::isComputed()to remove "Path"I don't believe the ones we have recently removed would help here:
EditorialContentEntityBaseDo we have other proposals?
Is it also the opportunity to add comment explaining each item of SourceMetadataKey.
Comment #9
pdureau commentedI may propose something directly in #3620150: Block library content
Comment #11
pdureau commentedI hope the changes proposed in #3620150: Block library content will make this ticket obsolete.
In my opinion, the logic based on
::isDisplayConfigurable()was wrong because this method was not implemented ina reliable way among the entity type provided by Drupal Core (see the example of User entity).Also, I would prefer us to avoid extending
SourceMetadataKeyand using it outside of UI Patterns. It must be considered as an internal mechanism.Let's see how the proposal will be received.
However, this work is the opportunity to bring some clarity. I have open a MR with some comments added to SourceMetadataKey : https://git.drupalcode.org/project/ui_patterns/-/merge_requests/575
Mikael, can you add the missing comments to this MR? Is it relevant to also add a hint telling the enum is internal?
Comment #12
mogtofu33 commentedAgreed, closing my MR: no new SourceMetadataKey, the rules go to #3620150: Block library content.
But Display Builder also needs them in its contextual form, which uses the UI Patterns field select (
DerivableContextSourceBase::getChoices()). Without an extension point, the only way is to swap theentity_fieldandentity_referencesource classes, coupling Display Builder to UI Patterns internals.Proposal, keeping UI Patterns generic: no filtering in UI Patterns, just an alter on the choices, e.g.
hook_ui_patterns_source_choices_alter(array &$choices, SourceInterface $source). Consumers decide, with the source contexts at hand (Display Builder hides editorial noise in entity displays, keeps everything in Views). Default behavior unchanged.OK to retitle this issue for that?
Comment #13
pdureau commentedthanks, i will have a look soon
Comment #14
pdureau commentedI will try something in my MR:
Just to be sure, this hook will be used to filter the fields available for slots in ContextualPanel, not to filter choices for props?
If it is OK, I will update the description, send to review and create a follow-up (which will address some internal UI Patterns stuff, no impact on Display Builder and others ecosystem modules)
Comment #15
pdureau commentedI can't test the hook because I have this every time I want to add a slot source from the Component Form:
Only on Display Builder Contextual Panel, it is OK when using UI Patterns only.
Edit: ticket created: #3626043: Config panel loses source settings on AJAX actions and saves raw values
Comment #16
pdureau commentedPipeline failing because of #3625969: Twig's 3.30 TypeError: Twig\Runtime\EscaperRuntime::escape(): Argument #4 ($autoescape) must be of type bool, null given, I guess