Refine API response with DynamicPropSource suggestions to provide better UX
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3547598. --> Reported by: [wim leers](https://www.drupal.org/user/99777) Related to !191 !129 !107 >>> <h3 id="overview">Overview</h3> <p><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/experience_builder/issues/3510896" title="Status: Closed (fixed)">#3510896: Add a new internal HTTP API for candidate `DynamicPropSource`s to enable a `ContentTemplate` UI</a></span> built a HTTP API on top of <code>FieldForComponentSuggester</code>.</p> <p>That's been around for &gt;1 year and never used in the UI. So the labels are developer-supporting, not end-user supporting. But confusing.</p> <ol> <li>&#9989; Too verbose: <code>This Article's Title</code> &rarr; just <code>Title</code> </li><li>&#128993; Way too verbose when matching subsets that do NOT include the main property (or a computed property depending on the main property): <code>Subset of this Article's field_silly_image: alt (1 of 7 props &mdash; absent: entity, title, width, height, srcset_candidate_uri_template, src_with_alternate_widths)</code> switch to a nested structure: just <code>{Silly Image: {Alternative Text}</code>, to allow for a nested contextual menu to be presented in the UI being added at <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3541037" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3541037</a></span>. </li><li>&#9989; Way too verbose when matching subsets that DO include the main property (or a computed property depending on the main property): <code>Subset of this Article's field_silly_image: src_with_alternate_widths, alt, width, height (4 of 7 props &mdash; absent: entity, title, srcset_candidate_uri_template)</code> &rarr; switch to just <code>Silly Image</code> </li><li>&#9989; The ordering does not match the mental model of the site builder: it should match the order of the <code>EntityFormDisplay</code>. </li></ol> <h3 id="proposed-resolution">Proposed resolution</h3> <p>See above!</p> <p>Basically, refactor to be able to remove</p> <pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Generate a label for the suggestion:<br>&hellip;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // - one that describes the subset of the entity field otherwise,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; with explicit (developer-friendly, user-overwhelming) info on<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; which field props are present vs absent.</pre><p> which <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/experience_builder/issues/3512433" title="Status: Closed (fixed)">#3512433: Provide visibility into which (core) field types (74%), field type props (63%) can be mapped into Content Type Templates vs not, and which field widgets (36%) are supported</a></span> added &#129315;</p> <h3 id="ui-changes">User interface changes</h3> <p><span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3541037" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3541037</a></span> becomes much better &#128522;</p> <table> <tr> <th>Which</th> <th>Before</th> <th>Interim (#34)</th> <th>After</th> </tr> <tr> <th><code>type: integer</code></th> <td><img src="https://www.drupal.org/files/issues/2025-10-07/before%20test_integer.png"></td> <td><img src="https://www.drupal.org/files/issues/2025-10-07/interim%20test_integer.png"></td> <td><img src="https://www.drupal.org/files/issues/2025-10-07/after%20test_integer.png"></td> </tr> <tr> <th><code>type: string, format: uri-reference, x-allowed-schemes: [http, https]</code></th> <td><img src="https://www.drupal.org/files/issues/2025-10-07/before%20test_REQUIRED_string_format_uri_reference_web_links.png"></td> <td><img src="https://www.drupal.org/files/issues/2025-10-07/interim%20test_REQUIRED_string_format_uri_reference_web_links.png"></td> <td><img src="https://www.drupal.org/files/issues/2025-10-07/after%20test_REQUIRED_string_format_uri_reference_web_links.png"></td> </tr> </table> <p>(Note that this is still not using the "proper" hierarchical UI, but this visualizes what that WILL show. See <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/canvas/issues/3548322" title="Status: Closed (fixed)">#3548322: Improve how list of field suggestions is displayed in the UI for `ContentTemplates` and remove `ContentTemplates` from feature flag</a></span>.)</p> > Related issue: [Issue #3541037](https://www.drupal.org/node/3541037) > Related issue: [Issue #3512433](https://www.drupal.org/node/3512433) > Related issue: [Issue #3548322](https://www.drupal.org/node/3548322) > Related issue: [Issue #3530521](https://www.drupal.org/node/3530521) > Related issue: [Issue #3541000](https://www.drupal.org/node/3541000)
issue