feat(Internal HTTP API): #3591669 Heuristics for the content-entity-reference selection UI

Closes #3591669

What this MR does

Applies two heuristics to the content-entity-reference selection UI ("Typed Data browser" picker) so it only offers data a Code Component Developer can meaningfully consume:

  1. Image field (ApiUiContentEntityReferenceControllers::buildFieldEntry()): the picker listed the same image URL twice — src and the src_with_alternate_widths it is cloned from — plus srcset_candidate_uri_template, a raw RFC 6570 URI template. It now offers only the developer-facing src, relabelled "Image URL" in ImageItemOverride, and excludes the two implementation-detail computed properties by name. Done picker-side only, so PropSourceSuggester keeps offering them (it has different needs).
  2. Translation/revision metadata (ApiUiContentEntityReferenceControllers::listFields()): a new isConsideredIrrelevant() heuristic hides default_langcode, revision_log, revision_translation_affected, and the content_translation_source/content_translation_outdated base fields. None are marked internal, so the existing internal-field rule could not reach them; the heuristic mirrors the intent of PropSourceSuggester::isConsideredIrrelevant() but is deliberately separate (the picker offers a reference's target_id, which the suggester hides).

The two concerns are in separate commits for reviewability.

Testing steps

  • Apply the branch, enable the canvas_dev_er module (the feature flag for content-entity-reference props) and clear caches.
  • In the code editor, add a Content entity reference prop and browse into a bundle that has an image field.
  • Confirm the image field offers a single "Image URL" property — not "Resolved image URL with ?alternateWidths query parameter", a duplicate, or the srcset template.
  • Browse into a translatable, revisionable content type (e.g. an Article with translation enabled).
  • Confirm "Default translation", "Revision translation affected", "Translation source", "Translation outdated" and "Revision log message" are not offered, while real fields (including the entity's own langcode) still are.
  • Automated coverage: ApiUiContentEntityReferenceControllersTest (updated image test + new testFieldsEndpointOmitsTranslationAndRevisionMetadataFields).

Notes for reviewers

  • Hiding the image twins is done in the controller, not at the field-type level: marking them internal there would also hide them from PropSourceSuggester, which still relies on src_with_alternate_widths and srcset_candidate_uri_template. 'is source for' can't drive it either — the matcher reads it the other way around (it hides src).
  • The image twins are excluded by name (not "keep only src") so any future image property stays offered by default.
  • src_with_alternate_widths is slated for removal in #3591648; the metadata heuristic uses literal field names where core's getRevisionMetadataKey() does not resolve (revision_translation_affected comes from core defaults, not the node annotation).

AI usage

AI-Generated: Yes (used Claude Code to plan, implement and write tests).

Merge request reports

Loading