Fixing a Thimble bug

Choosing a bug

At the time of this writing, Thimble has 185 opened issues (so choosing a bug to fix shouldn’t be that hard). After a few minutes browsing, I decided to go with this one (since it’s one of the oldest bug and its been opened for almost 2 years now). Before I could fix the bug, I had to setup my environment. Oh man, what a nightmare! I’m sort of like a robot when following instructions (I follow them line by line and never assume anything). I found it confusing and it didn’t mention that Bramble needed to be executed with Thimble (I mean, it sort of did, but since I already had Bramble installed, I didn’t read the Bramble installation part). I correct myself, I’m a broken robot haha.

So I decided to read the Thimble source to understand what needed to be installed. After a day or so, I decided to rewrite the instructions. I was a bit worried that they might refuse it (since I’m new to the project) but everyone in the project was really friendly and helpful! After about 3 revisions, I landed my first PR. Awesome! Time to fix my bug!

Gathering info

Actually… before working on a fix, I went back and forth with the Thimble developers until we all came to an agreement. Keep in mind, before asking a question, put yourself into their shoes. Not all developers are nice and not every developer have free time, so choose your question carefully. Don’t sit there and wait for instructions. Be friendly and show them that you’re interested in fixing their project.

It’s ok to be clueless. I was clueless, but I knew that I had to keep the ball rolling. I gave them 4 different possibilities of where the export button could go and even asked them for their opinion. Within hours, I got a few replies. After talking back and forth, we refined the location of the new export button and I was ready to start working on a fix!

Fixing the bug

Since it was an UI issue, fixing it was quite easy. All I had to do was to copy the old working code and paste it to a new section of the page (yep! good old c&p). But before I could do that, I had to find out where the "Export" button needed to go. Quickly looking at the project structure, I saw a MVC like pattern and went straight into the views folder. This is where I found the nav-options.html file and quickly knew I was in the right place 🙂

At first I was confused at what gettext() did. Assuming it was a function that returns a value based on a key (key-value pair) I searched the project for the key word “exportProjectLink”. I had over 20 hits! Jeez, do I really need to look at all 20 files? Actually no. Looking at the file names, I noticed that each file corresponded to a language representation of thimble (Ex: en-US is English US, pt-BR is Portuguese from Brazil, ru is Russian and so on). I didn’t care about these other languages so I went straight into locales/en-US/

I made the necessary changes and bam! It worked!

I wish I had more free time to fix these bugs. I’m taking 8 courses and I barely have time to breathe! I hope to fix a bunch of Thimble bugs over the reading week 🙂

Of course I’m not perfect. There has been small changes made to my code since the initial commit to the PR but once it lands, all these commits will be squashed! My mistakes will be erased and I can claim to be a pro-dev 🙂

Thimble and Brackets Running

Leave a Reply

Your email address will not be published. Required fields are marked *