Separate the GUI from the daemon which monitors for new messages
As I understand, the way chatty currently works is that chatty is spawned with phosh in the same session.
Closing the window does not stop chatty because it still needs to monitor for messages and notify the user.
You cannot open a second instance of the GUI window on the same machine or remotely with x11 forwarding i.e.
GDK_BACKEND=x11 chatty unless you first fully kill chatty.
There's also not very much feedback if chatty crashes for whatever reason.
I propose separating chatty into two separate primary executables: A daemon which databases and monitors for new messages and a GUI frontend which communicates with the daemon. The daemon can have a systemd user service (or analogue) to be easily restarted or monitored. In this way, it is more clear to the user what to do if chatty crashes. Plus this would help enable users to more easily customize their systems by separating chatty and phosh a bit.
I know very little about how chatty databases the messages it collects, but I think this could be used to help improve caching times.