 Hello, I am Muhammed Kara from Turkey, LibreOffice developer. I am going to talk about a small hidden feature of LibreOffice, which is not very well known. It was almost dead and I tried to resurrect it. I am going to tell you about the story. A little about me. I am from Turkey currently working on Core and UI as a software consultant. Consultant software engineer at Collabora Productivity since last December. I was working at Pardus Project before then. And I am also part of LibreOffice community. I am a LibreOffice certified developer and a longtime GNOME contributor before that. And member of GNOME Foundation and the Document Foundation. There is a not very well known feature of LibreOffice, which we call Mozilla Demes or Personas. You can find it with tools, options, personalization and load Firefox Deme. It allows you to apply Mozilla Firefox Demes to LibreOffice and use them to put some color into your LibreOffice installation. You can select pre-installed Demes coming with your LibreOffice installation. You can search online for new ones from Mozilla Demes Store. It changes background of main menus and toolbars and heavily relies on Mozilla add-ons API and web content. In the past there were many issues about Personas. There still are, but some of them are performance and reliability issues. The code was, implementation was error-prone. There were unrelated, incomplete categories on the dialogue. And it was constantly getting broken and needs fixing. And it was simply not working well and practically dead. Let me tell you a little about performance and reliability issues. A single search for a keyword for new Personas was taking on a fairly good computer, my computer, with a good connection, like 40 seconds. It's a huge amount of time because it just searches for new Demes and displays previews, not downloading whole Demes. It was fetching whole HTML pages while searching and relying on the design and content of the HTML. So it was easily broken. It was depending on multiple and repetitive string searches in HTML. It was overwriting existing data each time you search and relying on some unreliable library for download. The one above is Deme categories of Mozilla Firefox. There are like 15 categories for Mozilla and we had only six and we had a category called LibreOffice. There is not such a category. And actually I have realized after looking at the code they weren't even really categories. When you hit the button it just takes the word as a search term and brings up the first nine Demes it finds. Fetch and download procedure was not reliable. On preview and whole Deme downloads it was giving errors all the time and failing. For example, you see a screenshot of some errors like there is a 403 forbidden error. But when you copy and paste that URL into a browser you will see that there is no error, it is there. It was causing multiple and duplicate bug reports all the time. And I don't know why this library was working or not working like this. Let me show you some of code pieces causing these problems. This is the code piece about HTML parsing with string search. It was taking the whole HTML content of a persona page on Mozilla site and doing string search, taking the whole content as one string and searching inside it for some tokens or keywords. And it was easily broken as soon as they do some changes in the design of their website. This is an example of that. For example, they changed some encoding on Mozilla website. So instead of some encoding with lambda they started using regular characters for some specific character then our implementation got broken. Fixing was as easy as this. You see just replace the old character with the new one with a patch. But the problem is it keeps broken all the time and you have to chase that all the time. And the implementation wants all its content fresh. So every time you search for a search with a search term it brings, it fetches the search results again and again and for preview images of each demo it downloads them again. If you search for the same term over and over repetitively you will every time wait for 40 seconds for download of each image. And the categories, I told you that they were not really categories just hard-coded strings used as search terms when clicked on the button. And at some point because we were getting a lot of bug reports, complaints we had a dilemma either to keep it or kill it. The ones who would like to keep it was wanting to keep it because it was a little cute feature. It was adding personal touch to LibreOffice implementation, LibreOffice installation. It was giving the users my own product, my own LibreOffice feeling. There were thousands of choices for putting some color into your LibreOffice installation coming from Mozilla. Users and designers were chasing, users were asking for it to work and designers were requesting for patches. And we had a history with that feature. I'll tell you more about that. And the reasons for killing it was getting broken all the time. Needs was needing to chase Mozilla API and web design changes. The same reason as keeping it users and designers were chasing all the time. And it was a headache for QA people and there was no developer to maintain it. But we had a history. In the early days of my LibreOffice development adventures this was one of the first patches I sent to fix personas. It was of course broken again at the time because of some simple URL change. So I fixed that. And it was too cute. I couldn't let it die. Then we had a mission to make it work and to improve it, to make it future proof. So we aimed to first fix the current implementation to have it working. So lower down the number of complaints coming. Then start improving the under the hood mechanism and prepare for switch to using new Mozilla API. And then make visual improvements to make it pretty and more usable. To make it work again it was as simple as just replacing old characters with the new ones. It was a simple page. Then it was working somehow. Then I started improving the code under the hood to prepare for the switch to the new API. The old one was relying on some old XML API returning XML data. It wasn't working properly all the time. Even the API was not working, was not returning the data we want all the time. The new one was better. The old one was just giving you URLs of DEMS when you search. But the new one was giving more information, complete information. So we would not need to go into each web page of DEMS and try to find information there. Instead in one request we will have all data we need. Then I started with some patches to make it... I have realized that there was a feature allowing to embed default personas into LibreOffice. It wasn't being used. So we uncovered that but it wasn't very good implemented. So it was getting broken if you put more DEMS than intended. It was designed for 6 DEMS and if you put 7 it was crashing. First thing was of course to fix the crash. Then we started using Slug. Slug is a unique name for each persona to store personas. Before each persona was being recorded with their display name and it wasn't unique. Then we started using already defined constants for personas. Then put some code to remember URL of applied persona. Because when you apply a persona you had only the images of the persona. No other information about the persona. You can't go back where it was. You can't tell the user where it comes from or what its name is. Then some patches to ensure consistency and separate download thread. So it doesn't block UI while downloading. Then ensure that we don't re-download each image and content every time. And a relatively bigger patch to modernize under the hood search part. To switch to the new API and use JSON and the new structure we have been preparing. Then continued with handling invalid URLs and search strings for personas. The dialogue was so fragile that you could crush it by putting some wrong search terms. So we took measures for that. And dialogue was coming empty. Although there was some space for images of personas. They were coming empty so we made sure they are loaded. Then we got rid of accent color parsing for personas. There was a property of persona which was called accent color. We were parsing it, recording it and getting rid of personas, discarding personas if they don't have accent color. But I have realized that it was never being used anywhere. It was just stored. Then we started using curl to download persona content. It became faster. And increased default persona number to six. Then started some visual additional improvements. First we assumed persona categories with Mozilla. So we now have the same categories with Mozilla. The same number and same categories. And they are actual categories, not just search terms. When you select a category now it goes to request data of that category. And displays personas based on their usage and download counts. Then some more small improvements, visual improvements and UX improvements. Now so it works more fluently, more reliably. It catches downloaded files and doesn't overwrite each time. So it is much faster. My computer didn't check the actual cycles but just a rough number. It went down from 40 seconds to 3 seconds to search for a new persona, new keyword. And it is now easier to extend and improve the code. We have a meta bug for personas. You see on the depends on part the number of related bug reports are there. And as you see we have fixed more than half of them but there are still bug reports waiting to be fixed. And they also keep coming of course because once it started working people started using it more. And of course they are finding age cases and reporting new bugs. You are welcome to check and assign one of these bugs to yourself if you like. This is the new look and feel. You can feel it by following the menu path and applying. We have pre-installed them as designed by volunteers in our design team. You can choose one of these. They come pre-installed with your new Libro office. It will come with 6.2. Or you can click select demo button and search for new demos from Mozilla site. This is the second screen you come to here when you click the button. There are categories. It comes with featured category pre-selected. And the most downloaded ones are displayed. You can select another category or AMP researcher. What's next? We need to keep fixing and improving. There are already some design requests and UX improvement requests from the design team. And it still keeps getting broken because of Mozilla API. It is better now but it still keeps broken because they change API without notice. So I am inclined to put some more weight to pre-installed demos. And there is a request, a suggestion from the design and UX team to make personas extendable with extensions. I am inclined to go that way. But I also intend to keep it working. Thank you for listening. Any questions? Thank you.