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

Command icon 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

narendrar created an issue. See original summary.

narendrar’s picture

Status: Active » Needs review

Created a follow-up #3559532: Canvas AI: Use useUpdateCodeComponentMutation to update code components to refactor the Edit component feature using useUpdateCodeComponentMutation.

utkarsh_33’s picture

I 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.

  1. Prompt:- 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.
  2. Prompt:- 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.

utkarsh_33’s picture

Status: Needs review » Reviewed & tested by the community

neha_bawankar changed the visibility of the branch 3559298-canvas-ai- to hidden.

narendrar changed the visibility of the branch 3559298-canvas-ai- to active.

tedbow made their first commit to this issue’s fork.

  • tedbow committed ac18e255 on 1.x authored by narendrar
    feat: #3559298 Canvas AI : List Prop Error When Updating Component Using...
tedbow’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.