I tested this and the only thing that's failing is when we manually change the Metadata of any page before the page generation task, ideally it should not change the value of Metadata rather it should create the page and update the title only for the page.
But with the above changes applied it updates the metadata as well, so marking it NW again to fix the issue.
Here are the scenarios that i tested:-
- Title and metadata not empty or NULL.It updates the metadata and title(Prompt used:-Add 3 hero components to the page around football) Tried 3 times and it works as expected.
- Title empty and metadata has some value(manually entered before page creation task) -> It updates the metadata but it should not(Prompt used:-Create a page for a university website) Tried 3 times and failed 3 times.
- Title has some value and metadata empty -> It updates the metadata Only(Prompt used:-Add 3 hero components to the page around cricket) Tried 3 times and it worked correctly.
- Title and metadata has values related to cricket -> It does not update the metadata and title both(Prompt used:-Add 3 hero components to the page around football) Tried 3 times and it worked correctly.
- Component creation and editing works as expected.
utkarsh_33 â made their first commit to this issueâs fork.
I thought renaming the file is the best approach for now as moving code to files such as AiPanel will lead to circular dependency. Keeping utility/state functions like loadAiPanelOpenState in a separate utility file makes more sense.
Marking it NR again.
I was testing this and i found that the message display is not quiet smoothly transitioned.There is a momentary flash of some other stuff(or maybe the same markup which displays the message) but that does not look good to me. Attaching the video for reference.
I think that was a rebasing issue. Merged latest 1.x changes and i was not able to reproduce this after that. Marking it NR again.
Created a separate MR which fixes the issue reported in the IS. I have kept the MR that @parthbcharya had already opened in case if he has a better solution.
Marking it NR for MR !266.
I tested it couple of times and i can confirm that the issue reported in #5 and #7 are fixed. Marking it RTBC.
Tested this manually and it works fine. Also code changes looks good to me. Marking it RTBC'ed.
I used Using Page Builder, add a two-column layout with 3 Drupal icons in the second column. Exclude column_one slot from response as i was not able to reproduce the issue with Using Page Builder, add a two-column layout with 3 Drupal icons in the second column prompt.
This issues is already fixed as a part of đ Canvas AI: Agent should pass values to image props correctly for JS components Active where we added an exception which will cause a validation error and eventually AI will fix it. This is intermitent so just an exception will help.
The changes are fairly simple and makes the $agent->setTokenContexts() more readable and maintainable. Marking it Rtbc.
utkarsh_33 â made their first commit to this issueâs fork.
I was testing this with the prompt Create a component to render the admin menu as a mega menu with linkset disabled. For the first time it gave the correct message that the user should enable the linkset config to create a component. I prompted it that I have enabled it without actually doing that. For an instance it again gave the message that the linkset is not enabled but eventually it created a component using some different approach which i think is not correct as it does not use what we wanted it to use and also the component does not render anything.
Making it NW.
utkarsh_33 â made their first commit to this issueâs fork.
The fix in the issue ensures that we only edit the component when we are on /code-editor/component route. If i already have a component named test1 and i give another prompt to create another component named test1 then it will create a component but with a different name using it's own intelligence.
Steps for testing that i used were:-
- Create a component named
test1 - Try creating another component using
Can you please create a CTA component named test1 that allows me to use images with a bit of text and to include a CTA to link to other pages and some background colour..
utkarsh_33 â made their first commit to this issueâs fork.
I have enforced a more robust instruction on how it should map the select list for the tailwind classes.
Now it generates the list which contains human readable options to select from instead of tailwind classes which are mapped in the enum.
Attaching the SS.
utkarsh_33 â changed the visibility of the branch 3547666-ai-should-not-props-for-tailwind-classes to hidden.
This is duplicate of đ "Thinking" status persists after a process terminates with an error Active . Closing it as Duplicate.
Tested it manually and confirmed that all the feedbacks are addressed. Also code changes looks good to me so marking it RTBC.
I tested this manually and can confirm that it works as expected. I also tested all the other component generation tasks and everything seems to be working as expected.
So đ AI may generate Tailwind classes only compatible with older Tailwind versions Needs review issue has made the need of this issue more prominent. According to our discussion with Jamie, Markus, Tim, Narendra and Aanand we agreed with not proceeding the hardcoded approach in this issue.
Here's what i suggest until we get a better and a consolidated approach for this, We can find a way of reading the files that are present in the
/canvas/docs/user/src/content/docs/code-components and create temp file/set of instructions(generate a guide for LLM) which can be passed as a context to the LLM and we can avoid the usage of the libraries that are not present in Canvas.
Temporary advantages of this approach are:-
- This will temporary solve the problem of previews being broken.
- This approach is also better than the current approach as it removes the duplication of the instructions and it will also get the latest changes in the documentation.
- This might also be helpful in handling issues such as đ AI may generate Tailwind classes only compatible with older Tailwind versions Needs review which might otherwise need separate instructions in the prompt thus increasing the instructions.
So this might fix the issue for now but we need a better and a concrete way of instructing/providing LLM with the libraries present in the Canvas ecosystem. đ Canvas AI: Give AI more context about the libraries present in Canvas Active Is the issue which i opened up in which we tried to instruct the LLM related to the libraries present in the Canvas.
utkarsh_33 â made their first commit to this issueâs fork.
I tried the prompt mentioned in #3 but without creating a content type for tours. My expectation was it would fail and maybe give user a message that the content type does not exist, but it created a code component which eventually shows unable to load data.
Attaching the SS for it:-
I think this can be handled in the tool which checks for the fields.Marking it NW again.
As per discussion with @tim.plunkett, @NarendraR and @balintbrews for now we can go with the hardcoded approach but we need to figure out a better way to dynamically parse the docs and pass the required libraries as a context to the LLM.
Added the descriptions for each libraries as per the request. This is ready for review again.
I have created a follow-up đ Canvas AI: Find a better approach of passing the libraries supported by canvas as a context to LLM Active .
I tested this but this is preserving the chat history even if i explicitly close the AI panel. I think that's not a required behaviour so marking it NW again.
The prompts that i used for testing are:-
- Create a component that has a formatted text area and gives me an option to change the background colour using a list of colour options
- Can you please create a CTA component named test1 that allows me to use images with a bit of text and to include a CTA to link to other pages and some background colour.
The output must contain the imports for cn and FormattedText.
utkarsh_33 â made their first commit to this issueâs fork.
Discussed with @tim.plunkett and @NarendraR and we agreed that all the above mentioned issues can be fixed in a follow-up, so marking this one as RTBC.
This is working as expected and also the code changes are looking good. Marking it RTBC.
I tested it with 3-4 prompts one of which is like:-
Create a homepage for a spring sales website which contains 3 card components placed adjacent to each other and an image component showing a poster of LIVE SALE and a catchy heading for the website.
I tested it manually and here are my few findings:-
- When we do any operation that calls a subagent(for instance page builder) then we only get the
AiAgentFinishedExecutionfor theorchestratoragent not for the sub agents, which causes the different sub-steps (in this casepage building(step1)>Title generation(step2)>Metadata generation(step3)) not getting completed status or the green check mark before them. All the subtasks have to wait until the orchestrator is completed executing its final steps.Attaching the SS for reference:- - Currently we also get the same messages from the sub-agent and the orchestrator agent twice. For example if we create a component then the component agents returns a message of success which is same as what we get as a final message from the orchestrator. We might need to figure out a way so that there is only 1 final message from either of the agents.Attaching the video demonstrating the scenario.
- Also a small but not so important thing that i noticed is that when we submit the prompt then for a moment the loader loads which is then replaced by the Thinking block. This is not a blocker but just pointing it out.
Apart from this all the functionalities are working as expected.
For testing this the prompt that i used was :-
Can you please create a CTA component named test1 that allows me to use images with a bit of text and to include a CTA to link to other pages and some background colour.
I have pushed the initial work for this. The problem with this is that when i try to select a different value from the dropdown present in the props it does not update the values/color. I will try to fix that issue.
utkarsh_33 â made their first commit to this issueâs fork.
I tested it manually and it does not give the unnecessarily data fetching related messages and also verified that the đ Enable AI agents to generate components that fetch menus Active and đ Enable AI agents to generate components that fetch data from JSON:API Active functionality are not impacted due to the above changes.
I agree with @akhil babu. We should wait until đ XB AI: User selection should be taken into account while building page Active gets in.
@tim.plunkett I have successfully rebased it. Marking it RTBC again.
utkarsh_33 â made their first commit to this issueâs fork.
I tested this and the active_component_uuid is now getting passed as a request parameter. Also the changes looks good to me so marking it RTBC.
I can confirm that the latest changes fixed the issue reported in #15. I also tested the prompts mentioned in #3 and all of them are working along with prompt for a custom field like Create a component to show testing field of all the test1 where test1 is custom entity type and testing field is the custom field.
Also the changes looks good to me overall so marking it RTBC.
Re #5 đ Canvas AI: Request parameters are not passed correctly. Needs review :-
This was fixed in #3545378: Canvas AI: Agents fail due to missing entity type and entity ID parameters and it seems to be working fine when I tested it just now. Are you still experiencing the issue on your side?
This was only fixed for the /canvas/editor/canvas_page/1 url as this contains the required params and their values are correctly extracted from URL. But now the Canvas has a new default page /canvas/ where the above params are not present.
If we are restricting all operations to the Canvas Page entity type, wouldnât it be better to handle this at the orchestrator level by adding a prompt like the following, rather than sub agent level
I intentionally removed it from the orchestrator as that's already present in the subagent(page builder, title and metadata) that require that context and not all the subagents require the entity context for example component creation and editing.
Removing it from orchestrator also reduces the context sent to all the subagent which don't need them.
I tested the issue and it seems to work partially. The following are the commands that i used and the SS for their results:-
- Create a component to show title of the latest page -> Always worked
- Create a component to show title of all the articles -> Worked only once out of five tries
- Create a component to show title and body of all the articles and pages -> Always worked
Prompt 1 SS:-
Prompt 2 failed SS:-
Prompt 2 passed SS:-
Prompt 3 SS:-
The issue related to the article list not loading lies in:
{data && data.length > 0 ? (
data.map((article) => (
<div key={article.id} className="article-item">
<h3 className="article-title">{article.attributes.title}</h3>
</div>
))
)Where it some times uses {article.attributes.title} which is wrong and when it uses {article.title} then the ;ist is correctly rendered.
Apart from the above I also tested the remaining functionality related to code component and everything seems to be working as expected.
Marking it NW to fix a small issue.
utkarsh_33 â changed the visibility of the branch 3544132-give-ai-more to hidden.
utkarsh_33 â changed the visibility of the branch 3544132-give-ai-more to hidden.
utkarsh_33 â changed the visibility of the branch 3543093-xb-ai-ai to hidden.
Marking it RTBC.
Tested the issue and it was failing on 1.x see the SS:-
But adding the try catch block fixes the problem of processing further if 1 tool fails. I tried 7-8 time the same prompt as in the image and every time it successfully generated the page.
utkarsh_33 â changed the visibility of the branch 3544277-xb-ai-use to hidden.
utkarsh_33 â changed the visibility of the branch 3544277-tailwind-directives to hidden.
Successfully migrated to canvas project. This can be reviewed now.