OSD600 Release 0.3 – Fixing a feature

In this release I worked on an issue listed in thimble, you can find it here : https://github.com/mozilla/thimble.mozilla.org/issues/1907

To summarize the bug, it involves changing the themes of the editor. When themed changed to dark, the inline color picker still had the same light theme, which of course should be light in this case.

To go about researching this error, it was pointed out that it involved an older commit hat ended up breaking it. Now in order to find this commit we have to do a bit of git magic. Git Bisect is a command that allows you to quickly switch to older commits and find the commit that ended up breaking a feature. Initiate the bisect by running :

  • git bisect start ( Initation git bisect )
  • git checkout master ( Checkout the most latest commit that we know is broken )
  • git bisect bad ( We tell git that the master branch has the bad change)
  • git checkout oldereCommitThatWorks ( Now lets get an older commit that we know for user works properly)
  • git bisect good ( Tell git that this older commit is good )
  • git bad/good ( Now go through the commits and find the one that broke)
  • git bisect reset ( Finish bisect mode and return to normal git mode )

This process will get us the commit that initially broke what we are trying to do. In my case I found that the commit that took place was changing the way thimble changes themes. The change that broke it was $(“body”).toggleClass(“dark”, theme.dark); Which basically turns on a class for CSS so it can use the dark theme. When this was omitted it broke the code that changes the color picker, so for the solution I simply reverted this one line change, it still allows the previously committed code to work normally, and allows the color picker to keep using the previous way of changing themes.

My pull request was accepted and merged here : https://github.com/mozilla/brackets/pull/670


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s