Overview

Code components can be created through AI in XB. However, immediately after a component is created, the page navigates to the newly created component, causing the chatbox message history to be lost.

Proposed resolution

The chatbot message history should remain intact when a new component is created through AI. It is acceptable to reset the message history on a page refresh.

User interface changes

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 changed the visibility of the branch 3531955-ai-created-new-components to hidden.

narendrar’s picture

Status: Active » Needs review
utkarsh_33’s picture

Status: Needs review » Needs work

I tested the MR and here are my observations from it:-

  • The history of messages remains intact even after navigating to the other page.
  • The issue with this is that even after refreshing or closing the chatbot the history still remains intact.Does it makes sense to add a Clear chat button to reset history?

Rest everything looks good apart from small nits.Marking it NW for small changes.

narendrar’s picture

Status: Needs work » Needs review
Related issues: +#3532519: Implement clear chat history feature in XB AI
narendrar’s picture

Now, the chat history is also cleared when the AI panel is closed and opened again.

utkarsh_33’s picture

StatusFileSize
new59.58 KB
new60.52 KB

I tested this and i can confirm that the message chat history is cleared when the AI panel is closed.I noticed an issue while testing this:-

Processing state on 0.x:-
Processing state on 0.x

Processing state on this MR:-
a
The processing states are not correct.

utkarsh_33’s picture

Status: Needs review » Needs work

Marking this NW for a small left over.

narendrar’s picture

Status: Needs work » Needs review

Thanks @utkarsh_33 for testing this issue. This is fixed now.

utkarsh_33’s picture

Status: Needs review » Needs work

When a user refreshes the page, the panel’s state (open or closed) and its content should be preserved. If the panel was open before the refresh, it should remain open with its content intact after the refresh. The history should only be cleared when the user manually closes the panel, not upon a page refresh.

narendrar’s picture

Status: Needs work » Needs review

This is an existing issue and is not related to the current implementation. I have created a follow-up issue to address this. #3533864: AI panel should preserve its state on refresh

utkarsh_33’s picture

Status: Needs review » Reviewed & tested by the community

Since the follow-up is created and the current functionality reported in the issue is also working fine and the code also looks good to me, marking it RTBC.

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

balintbrews’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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