-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(quantic): CRGA component not showing collapsed when answer appear…
…s without streaming (#4840) [SFINT-5914](https://coveord.atlassian.net/browse/SFINT-5914) ## ISSUE: This is following a maintenance case where some cases of customers would trigger a CRGA answer directly without the stream. This would cause the answer to show fully rather than collapsed. The culprit is caused by the following code: <img width="504" alt="image" src="https://github.com/user-attachments/assets/3972a842-4178-479f-a55e-73efc3e5a270" /> The `generatedAnswerElementHeight`, when `isStreaming` is false ( case where the answer is generated in one shot rather than being streamed), is essentially 0. Therefore, the `this._exceedsMaximumHeight = 0 > 250px` which is false and therefore does not result in the answer being collapsed. This is happening since the component does not re-render and therefore does not re-calculates the height and CSS variables. ## SOLUTION: Adding `quantic__answergenerated` event. We are proposing dispatching an event from the `quanticGeneratedAnswerContent` component when the answer's HTML is updated. We then listen for this event in the `quanticGeneratedAnswer` component and recalculate the CSS variables. When the event is triggered, it calls this function: <img width="341" alt="image" src="https://github.com/user-attachments/assets/7ddc3ae1-9c1b-4f30-9b7d-ebf88c128ee8" /> ## E2E: <img width="780" alt="image" src="https://github.com/user-attachments/assets/dc5795dc-30be-41a8-8cf9-a86178fb6b36" /> [SFINT-5914]: https://coveord.atlassian.net/browse/SFINT-5914?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: GitHub Actions Bot <>
- Loading branch information
1 parent
b69cf0a
commit 0cfeec7
Showing
6 changed files
with
49 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters