Better Room History in Fractal

Over past month I’ve been sponsored by Purism to work on improving the message view in Fractal. This post will highlight the biggest and most interesting changes.

The first thing I improved was how older messages are added to the message view when scrolling back. Before, there was a jarring cut when new messages were loaded, but now you can just scroll upward and older messages are loaded continuously. This makes it much easier to search for a message in the history, because there are no sudden jumps when messages are added to the list. In the video you can see the how the smooth history loading works.

The part I’m most excited about is the new “new message divider”. Here’s a small screen cast to show the new behavior:

When the user opens a room they can directly start reading the conversation from the last seen message and they don’t need to search for the new message divider. Not only has the UX gotten a lot better, but also the underlying code is much cleaner now. Sadly, it doesn’t work (for now) if Fractal doesn’t have a “last seen mark” for the room. This can happen, for example, when there are more than 40 not seen messages. The reason for that is that Fractal only syncs the last 40 messages of a conversation. The new message divider also disappears after a couple of seconds and this time is not yet connected to how many messages an user has to read.

I also spent some time on making message rendering faster. I replaced the RegExp with more efficient code, this made the rendering much faster (from ~10ms to ~ 1ms) for every single message. This is already pretty good, but I think there’s still room for improvement.

In summary, all of these things improve Fractal’s UX a lot and make it feel more like a modern messaging app. To further improve the UX we need to also update the app’s backend and improve how we get data from the Matrix server. Thanks to Purism for sponsoring this work, Daniel for reviewing and merging everything, and everyone else who gave feedback and helped test this.

We don’t have a new stable release with these changes yet, but they have been merged, and you can already try them on Master.