deep-chat icon indicating copy to clipboard operation
deep-chat copied to clipboard

Custom History Loading HTML Prevents Intro Panel from Showing When Messages Are Empty

Open lekhnath opened this issue 8 months ago • 2 comments

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 loading HTML in messageStyles, it works as expected.

Steps to Reproduce

  1. Add a custom loading HTML animation in messageStyles.
  2. Use the loadHistory interceptor, resolving with an empty array ([]).
  3. Observe that the intro panel is not shown.
  4. 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!

lekhnath avatar Mar 22 '25 08:03 lekhnath