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
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | Processing state on 0.x.png | 60.52 KB | utkarsh_33 |
| #8 | processing state.png | 59.58 KB | utkarsh_33 |
Issue fork experience_builder-3531955
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:
- 3531955-updated
changes, plain diff MR !1191
- 3531955-ai-created-new-components
compare
Comments
Comment #4
narendrarComment #5
utkarsh_33 commentedI tested the MR and here are my observations from it:-
Clear chatbutton to reset history?Rest everything looks good apart from small nits.Marking it NW for small changes.
Comment #6
narendrarAdded an issue for 'Clear chat' feature https://www.drupal.org/project/experience_builder/issues/3532519.
Comment #7
narendrarNow, the chat history is also cleared when the AI panel is closed and opened again.
Comment #8
utkarsh_33 commentedI 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 this MR:-

The processing states are not correct.
Comment #9
utkarsh_33 commentedMarking this NW for a small left over.
Comment #10
narendrarThanks @utkarsh_33 for testing this issue. This is fixed now.
Comment #11
utkarsh_33 commentedWhen 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.
Comment #12
narendrarThis 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
Comment #13
utkarsh_33 commentedSince 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.
Comment #16
balintbrews