Overview
When updating a component on Canvas AI, the list prop values get removed or missing when adding a follow-up request.
Steps to Reproduce
Case #1:
Create a component on Canvas AI with a list prop (e.g., opt 1, opt 2).
After creation, add a follow-up message to update something in the same component. The code updates, but the options in the list prop get removed.
Case #2:
Create a simple component without a list prop.
Add a follow-up message to include a new prop of type list. The new prop gets created, but without its values/options, resulting in a red error.
Proposed resolution
This seems a regression of #3537620: Allow defining values and labels in List props to me. We might need to update PropsSchema.json to handle this updated case
User interface changes
Issue fork canvas-3559298
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
narendrarCreated a follow-up #3559532: Canvas AI: Use useUpdateCodeComponentMutation to update code components to refactor the Edit component feature using useUpdateCodeComponentMutation.
Comment #4
utkarsh_33 commentedI tested this locally and it is working as expected.Apart from the above prompts mentioned in the IS i tested the MR with the following prompts.
Create a hero banner component which has a customisable background colour which is a list of colour options.Followed by prompt:-Add another background colour option which is orange.Create a heading code component which provides a list of heading tags options via props.Followed by prompt:-Remove the heading level from the list of heading levels which contains values 5 and 6.It was successfully able to add and remove the values from the list type props.
Also code changes looks good to me, so marking it RTBC.
Comment #5
utkarsh_33 commentedComment #10
tedbow