deep-chat
deep-chat copied to clipboard
Custom History Loading HTML Prevents Intro Panel from Showing When Messages Are Empty
Custom Loading HTML Prevents Intro Panel from Showing
Description
Following the documentation, I can add custom loading HTML and CSS animations during chat history loading using the loadHistory interceptor. However, there is a major flaw:
- If the interceptor resolves with empty messages (
[]), the intro panel is not shown. - If I remove the custom
loadingHTML inmessageStyles, it works as expected.
Steps to Reproduce
- Add a custom loading HTML animation in
messageStyles. - Use the
loadHistoryinterceptor, resolving with an empty array ([]). - Observe that the intro panel is not shown.
- Remove the custom loading HTML and test again—this time, the intro panel appears as expected.
Expected Behavior
When loadHistory resolves with an empty array, the intro panel should still be displayed, even if custom loading HTML is defined.
Actual Behavior
The intro panel is not shown when custom loading HTML is present.
Reproducer
I have prepared a reproducer demonstrating this issue. You can find it here.
Environment
- Library Version: both dev and stable
- Browser: Google Chrome
- Operating System: MacOS
Additional Context
Any insights on this behavior would be appreciated. Let me know if further details are needed!