Response generation gets paused, when shifting the focus off the AIChat #39
-
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You're seeing that "pause" because we use the web API requestAnimationFrame to perform the text animation. The advantage of using The downside is that some browsers (like Chrome) would pause animation when the tab or window is not displayed, which means that your generated text's animation will also pause when the tab is not active. Here is what I suggest:
PS: Why you're calling yourself Thank you for the feedback and for contributing to nlux |
Beta Was this translation helpful? Give feedback.
-
Marking this as answered ✔️ — Feel free to re-open / comment if further help is needed. |
Beta Was this translation helpful? Give feedback.
Hi @whisper-ai-team
You're seeing that "pause" because we use the web API requestAnimationFrame to perform the text animation.
The advantage of using
requestAnimationFrame
is that the text appearance animation is faster, and can even be hardware-accelerated if you have a GPU, etc.The downside is that some browsers (like Chrome) would pause animation when the tab or window is not displayed, which means that your generated text's animation will also pause when the tab is not active.
Here is what I suggest:
Currently there is a config parameter at
nlux
that allows you to configure the animation speed:https://nlux.dev/api/ui/ai-chat#conversation-options
Default is 10, but if you set it to
n…