Categories
GSoC 2021

Search Bar of Doom

It started benign, it was labeled Newcomers, it felt like a good start into the Fractal NEXT codebase: Make Ctrl+K toggle the room search bar… I was so naive!

This first issue took me days. It was a task where the high-level idea is very easy, but the concrete idiomatic and robust solution is non-obvious. What followed was a lot of reading and learning of the concepts and the concrete application of general GTK4, its UI Builder, shortcut handling, GActions and GObject bindings.

With some time spent on the problem and the help of the awesome community at the Rust ♥ GNOME Matrix channel, I was able to tackle the issue in a way I was happy with.¹ Although it took a while, it should be noted that I went with all that hassle, because it seemed from the start like a good learning experience – and it was – but also does Fractal NEXT now have a very well thought out room search bar. So finally, behold:

Room Search Bar (of Doom)

I spent the next days learning more about the GTK4 and Adwaita widgets, as well as the inner workings of the Fractal NEXT codebase, toying around with some code.

Based on the room setting design of our trusted GNOME designer Tobias, I started working on turning the pictures into something interactive. For the design I wanted to stay close to the libadwaita widgets and their intended use, so that it gives GNOME users a consistent experience and we can get all the shiny features like searchable preferences for free. The result does in some aspects deviate from the draft, e.g. the members overview got its own tab, but the overall reaction from the community to it was positive. I expect we will go through some iterations before the room settings UI is actually finished – after all: nothing will break your code faster than getting it into the hands of actual users 😁

Room Settings Window

The next step will be tidying up the code to the point of a merge request and getting some feedback. I will now focus my time on wiring everything up and then get it out the door to face other parts of Fractal.

See you in the next blog post 👋

¹ My solution for implementing the search bar shortcut has a single logical place where the on/off state of the search bar is stored (and that is the search bar). The search button is simply bound to that state. To toggle the search bar, I use a PropertyAction which is installed to the window, but the place to link the Ctrl+K shortcut to the action is not at the window, but at the application level. Setting the shortcut there has the nice side effect of automatically populating the shortcut overview with the proper shortcut. I think that is a good way to do it 🙂

Categories
GSoC 2021

The Beginning

Hello, I’m Kai. I’m a computer science student at the KIT in Germany. This year I am participating in my second Google Summer of Code at the GNOME foundation to work on Fractal. My mentor is Julian Sparber, who works towards end-to-end encryption in Fractal and already gave me a warm welcome. I created this blog to keep everyone interested updated on my progress over the course of the summer.

Fractal Logo
Fractal Logo

For those who don’t already know, Fractal is a messaging client for the GNOME desktop powered by the Matrix protocol. In the last year the ecosystem on which Fractal is built changed dramatically (GTK 4, matrix-rust-sdk) and the current code base shows its weaknesses. With those considerations, Fractal’s developers came to the conclusion that a rewrite from scratch is the best way forward. This undertaking is called Fractal NEXT.

My goal for the Summer of Code 2021 is to bring Fractal NEXT to feature parity with the current Fractal code base. There has already been a lot of work on the architecture and groundwork for the new Fractal over the last months, but the current implementation is still bare-bone.

The main features remaining to be implemented are room management and account management as well as support for more message types. I will start by implementing the elements required to work with rooms and its members. This will mainly manifest in a room settings panel that allows editing of the room avatar, title and description, inviting and kicking members and managing their power levels. Account management will resemble the account page of the current Fractal with options to edit the user’s avatar, name, third party identifiers and the device list, and also the possibility to deactivate ones Matrix account. Another small but important thing will be the addition of shortcuts for all actions, so Fractal is more accessible, and power users will feel at home.

I am very glad to be able to work on Fractal for this Summer of Code and hope it will be a lot of fun.

Also check out Alejandro’s blog, who, too, contributes to Fractal this summer by implementing multi-account support.