Multi-bundle content-entity-reference picks fail to coalesce into a branch expression
### Overview A code component developer using a `content-entity-reference` prop cannot pick fields from more than one bundle of a multi-target-bundle reference field when any bundle contributes more than one field. Selecting such fields and saving fails validation with: > Multiple expressions on the same field 'entity:node:…' must be coalesced into a single FieldObjectPropsExpression. The per-bundle picks are meant to combine into a single stored expression at save time, but the coalescer leaves them un-combined, so the same-field validation constraint rejects them. A single field per bundle already works (#3591656); the gap is multiple fields per bundle, and fields reached through a further reference (e.g. an author's name). The cause is in the entity-field coalescer: it groups reference picks by reference chain rather than by their referencer field, and objectifies each bundle in isolation — so a bundle that picks several fields, or a field reached through a nested reference, is emitted separately instead of being combined across bundles. ### Proposed resolution Two pieces of low-level prop-expression infrastructure: - **Coalescer**: group reference picks by their referencer field and coalesce each bundle's picks. When every bundle picks a single field the result stays a field-level reference or branch (unchanged). When a bundle picks several fields — which no single-field branch member can represent — the picks combine into one object on the reference field, grouped by developer-facing key: a key picked in several bundles becomes a bundle-specific branch, a key in one bundle a plain reference. Different shapes per bundle are accepted, so a component can adapt its output to the runtime bundle. `coalesce()` stays the inverse of `expand()`. - **Prop-expression string form**: `FieldObjectPropsExpression` learns to serialize and parse a bundle-specific branch nested in an object property (`↝entity␜[branch][branch]`). Nested branching stays unsupported. This is dormant on `1.x` until #3591656 exposes multi-bundle browsing and removes the save-time constraint; #3591656 owns the constraint/validator changes and the content-entity-reference integration tests. ### Remaining tasks - Group multi-bundle reference picks by referencer field, then coalesce per bundle. - Combine per-bundle picks (direct fields and nested references) into one object whose properties are bundle-specific branches or plain references. - Serialize and parse a branch nested in an object property. - Cover with unit tests (`CoalescerTest`, `PropExpressionTest`); the end-to-end authoring and render scenario is covered by #3591656. ### User interface changes None in this issue. The dialog already offers per-bundle browsing (from #3591656); this issue only makes the resulting selections storable. ### Release notes snippet Code components can now depend on multiple fields from several target bundles of the same entity reference field; the per-bundle selections are combined into a single stored expression instead of being rejected at save.
issue