Canvas AI: Components should be added to the intended slot
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3552030. --> Reported by: [akhil babu](https://www.drupal.org/user/3632866) Related to !231 >>> <h3 id="overview">Overview</h3> <p>Currently, it is not possible to place components in a specific slot using Page Builder, following the changes in <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3540211" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3540211</a></span>.</p> <h3>Testing Steps</h3> <ul> <li>Install the canvas_test_sdc module to get the test components.</li> <li>Try the prompt: <em>'Using Page Builder, add a two-column layout with 3 Drupal icons in the second column'.</em></li> <li>You might see that the Drupal icons are added in the first column rather than the second column.</li> </ul> <p>The agent generates the correct output</p> <pre>operations:<br>&nbsp; - target: content<br>&nbsp;&nbsp;&nbsp; placement: inside<br>&nbsp;&nbsp;&nbsp; components:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - sdc.canvas_test_sdc.two_column:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; props:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width: 25<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; slots:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; column_two:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - sdc.canvas_test_sdc.druplicon: {}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - sdc.canvas_test_sdc.druplicon: {}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - sdc.canvas_test_sdc.druplicon: {}</pre><p>However, the underlying code does not consider the slot index.</p> <p>If the issue is not reproducible, the agent&rsquo;s output may have added an empty value for the column_one slot:</p> <pre>operations:<br>&nbsp; - target: content<br>&nbsp;&nbsp;&nbsp; placement: inside<br>&nbsp;&nbsp;&nbsp; components:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - sdc.canvas_test_sdc.two_column:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; props:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width: 25<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; slots:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; column_one: []&nbsp; #If this is present in the agent's response, the issue will not be reproducible.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; column_two:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - sdc.canvas_test_sdc.druplicon: {}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - sdc.canvas_test_sdc.druplicon: {}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - sdc.canvas_test_sdc.druplicon: {}</pre><p>In such cases try "Using Page Builder, add a two-column layout with 3 Drupal icons in the second column. Exclude column_one slot from response"</p> <h3 id="proposed-resolution">Proposed resolution</h3> <h3 id="ui-changes">User interface changes</h3>
issue