Remember & show chat history
Pre-releaseThis is a release candidate for a function parameter that allows you to remember and then recall past conversations in chat-bubble
. This method will use localStorage
to keep all the data, however, you can probably refit it to use whatever you've saved on your server.
This function isn't as comprehensive as, say, Slack's chat tools. It won't let you incrementally download history while you go backwards in time, neither will it let you go forwards in time should you have searched something in chat history. This is a very simple "last X conversations" reminder for the user.
It is opinionated (in terms of design and how it appears on the screen), however, you can customize how many past interactions you'll want to recall. Just add an integer greater than zero to recallInteractions: Int
to options
object. That's all.
chat-bubble
will attempt not to be repetitive or over-zealous with remembering past interactions. Specifically, it won't memorize the first thing it says when the user opens up the app unless the user has interacted with the bot. This is to avoid unnecessary, uninformative memory recollection of stuff the bot will say anyway.
Note that when the bot "recalls" past conversation, everything appears at once (no animation) and with .25
opacity - you can change the styles as you wish if you customize the CSS files. Trust me, you don't want the bubbles to animate when they are just a matter-of-fact previous conversations user might or might not want to recollect.
That's it!