When using the the chat especially when on either of my laptops. I think it would be useful to be able to minimize/hide the chat but not have it completely close so you can stay in the same session.
In my head I see it working by adding a simple minimize button next to the close button. When it minimizes, the icon for the chat can stay highlighted to alert that it is still active. Also, when switching from chat to other options like bookmarks, history or tabs. If there is a current chat open it should use the minimize behavior so the same chat is still active when you navigate back. So essentially the only time the chat closes or resets is when you close it.