- The AddFile function now correctly parses both the old flat log
format and the new format where chats are grouped by topic.
- It flattens the new structure by iterating through the 'Entries'
of a chat group and appending them to the main chat list.
- This allows the application to transparently load both old and
new log files.
- Sanitize the Chats slice before marshaling or formatting to remove
any nil entries that may have been introduced.
- This is a robust fix for the segmentation fault panics.