First Merge Request to Gnome-Calendar

Posted on August 06, 2024 by Felipe Aníbal

Last updated on August 06, 2024

Introduction

For the past month, Otávio Silva and I have been working on GNOME Calendar. GNOME is one of the most widely used desktop environments for Linux, and GNOME Calendar is an open-source calendar natively available with the GNOME project. We began contributing to the calendar as an assignment from a course at USP, but after our first contribution, Jeff Fortin, one of the maintainers, invited us to help the project by expanding their test coverage and fixing timezone-related issues, which is what we are focusing on now. I'll share more about that in a future post. Here, I share how we got started and what our first contribution was.

First Contribution

To get familiar with the code structure and the calendar's implementation, we decided to start with a newcomer's issue. Our first contribution was an improvement of the display of links in the tooltips of the calendar.

Tooltips are the text boxes that appear next to the mouse pointer when you hover over an event on the calendar. They are used to show concise information about a given event, like the time and location of the event. If you want to see more information, you can click on the event and a popover appears with more details. A nice feature implemented in the popover is the simplified display of online meeting links. If a meeting is scheduled at Google Meet and has the following link: "https://meet.google.com/aaa-aaaa-aaa," for example, the popover has code that parses the URL, recognizes that the meeting is at Google Meet, and shows the name "Google Meet" together with a button to join the meeting.

Example of popover
Example of calendar event popover

On the tooltip, however, only the full link of the meeting would be shown, potentially covering a big part of the calendar. So instead of showing useful concise information, the tooltips could get long and confusing. The issue we worked on proposed a solution to this problem. In the tooltips with online meeting links, instead of showing long URLs, we could simplify the information and only show the name of the meeting service.

Example of tooltip with long link
Example of tooltip with long link

To implement this, we refactored the code to use the same parsing function already implemented in the popover. We moved that function from the popover file to the utils file, made a few changes to have it work in different contexts, and imported it into the tooltip file.

To improve the display when the meeting service was not recognized, we also decided to truncate long links and use ellipses ('...'). That way, if the meeting location is a known meeting service, we show the name of the service instead of the full link. If the meeting is not on a known service, we limit the length of the URL to make the tooltip smaller. And if the location of the meeting is not a link but an actual address, we show the full address, which can be useful (unlike an unclickable link).

Conclusion

Our merge request was approved, and now the tooltips are smaller and present more useful information! We also had the chance to understand how the files in the project are structured and we got in closer contact with the maintainers. In the next post, I'll share our next steps, beginning to fix bugs and write unit tests!