Skip to content

Second Week of Coding Period | GSoC 2023

Posted on:June 12, 2023 at 06:00 PM

Introduction

During the second week of the coding period, I accomplished the following tasks:

  1. Implemented a feature to add a link to an audio call to the chat.
  2. Modified the design of the Bulk Delete Drafts UI.
  3. Fixing the script that transfer assets from Zulip Python Bots Repository to the production tarball of Zulip.
  4. Made contributions to GitLab.

I believe my contribution to GitLab deserves a dedicated blog post, which I will write separately. In this blog post, I will discuss the remaining three things.

Audio call feature for Zulip

The feature is about adding an option to add a link to an audio call, similar to how the users can add a link to a video call. Jitsi Meet, BigBlueButton, and Zoom are the three video call providers in Zulip.

Here an audio call is not actually an audio call, it’s a video call but when the user opens the link the camera is turned off by default. So, the user can use it as an audio call.

The change UI is very minimal β€” just a πŸ“ž call icon had to be added and the functionality is pretty much similar but I had adjust how the link is created for the audio call as some extra parameters had to be added to the URL.

Before
After
BeforeAfter

For Jitsi Meet, the URL creation is pretty simple. All one has to do is to simply append a meeting name to the URL and you have a new video call link. So, in Zulip the implementation is also done pretty much the same way. A 15 digit random number is generated and appended to the URL and we have a new video call link. Pretty simple, right?

You can also have a look at the code that does this here. Although there are other things in the code that might not be very straightforward. But I think you can get the idea.

A sample URL for Jitsi Meet can be:

https://meet.jit.si/123456789012345

After the link is generated all that is left is to add #config.startWithVideoMuted=true to the end of the URL and then we have a new audio call link. The documentation for this can be found on this link.

So the final URL for Jitsi Meet with the camera turned off by default will be:

https://meet.jit.si/123456789012345#config.startWithVideoMuted=true

The Pull Request is in a very early stage and requires manual testing. I also need to create node-tests for this feature. I will keep updating about this in my further posts.

Design of the Bulk Delete Drafts UI

Right now, if a user has to delete multiple drafts they have to delete them one by one which is a very tedious task. There is an issue open to track the feature that will make it possible to delete multiple drafts at once.

The groundwork was already done by another contributor for this feature. So I took that PR, rebased it β€” had to resolve some conflicts β€” and started working on polishing the UI.

The main change I made was making use of flexboxes to make the UI more clean and responsive. Discussion around how things should appear on smaller screens was also done on chat.zulip.org.

This UI had a very interesting point to it. I had to make the Select all drafts button have a checkbox in it, which can be easily implemented by using a checkbox inside a button. But the problem was that this has done accessibility issues β€” when using keyboard to press the button it was not working properly β€” which were pointed out by my fellow contributor at Zulip.

Bulk Delete Drafts UI

The solution that came out of the discussion was to not use a checkbox instead use an icon that looks like a checkbox. (Modern Problems, Modern Solutions 😌) This way the button will work properly and the user will also get an impression that there is a checkbox inside the button. To make sure that the screen reader also reads the button as a checkbox, I was suggested to add aria-checked attribute to the button.

The Pull Request has still some work left to be done β€” some minor changes to the UI are required and then it will be ready to be merged.

Fixing script that transfer assets from Zulip Python Bots Repository to the production tarball of Zulip

Zulip supports interactive bots that can be used to interact with the user and perform some tasks. These bots are written in Python and are hosted in a separate repository. When the Zulip server is built, the assets from this repository are transferred to the production tarball of Zulip.

To perform the transfer, this script is used. The main issue was that a user reported that the documentation page for the xkcd bot was not opening. After inspection of the code, it was found that the script was not transferring the contents of assets directory for all the bots. So the fix was to add some code to the script that will enable that.

To solve this issue I had to look upon various methods that are used for file handling in Python, viz.

I used ChatGPT a lot to understand how these methods work, it also churned out some very good examples that cleared out things for me. Also, it was certainly a good experience as compared to doing file handling in C/C++. πŸ˜‰

The Pull Request for this is under review and the issue should be fixed soon. I am having some Django trouble here which I need to work on and then the PR will be ready to be merged.

Conclusion

I think the week was pretty productive. I was able to do a good amount of work and also learned a lot of new things. Still I think I can do better and I will try to do that in the coming weeks.

Feel free to drop any suggestions either on my Twitter or you can do it the old school way by sending me an mail at sbansal1999@gmail.com