Delving into open source territory with Google: An Investigation
Tags: webdev, javascript, opensource, programming
Published: 2023-11-10 19:49:57

## Project repo:
[blockly-samples](https://github.com/google/blockly-samples) by _Google Open Source_. 

## Project description:
[Blockly](https://developers.google.com/blockly) by _Google Open Source_ is a JavaScript library for building visual programming editor, which looks something like this,
>![blockly sample](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/prrqvx0ssmvxdyhvan7b.png)

The project I worked on is called [blockly-samples](https://github.com/google/blockly-samples) which is a supplementary project to the Blockly project. This project holds code for [Plugins](https://github.com/google/blockly-samples/tree/master/plugins) which are _self-contained pieces of code that add functionality to Blockly. Plugins can add fields, define themes, create renderers, and much more_, [Examples](https://github.com/google/blockly-samples/tree/master/examples) which are _self-contained sample projects demonstrating techniques on how to use Blockly's features and extend the Blockly library_ and [Codelabs](https://github.com/google/blockly-samples/tree/master/codelabs) which are _interactive tutorials demonstrating how to use and customize Blockly._

## Issue
[1923](https://github.com/google/blockly-samples/issues/1923)

## PR
N/A

## Code Fixes
For this issue, I didn't file a PR even though I was planning to do it originally but the dynamics of the issue changed after I started working on it. Even though I didn't file a PR, I still thought to include this issue as part of the 0.3 release because I spent time and effort on it to test the solution for project maintainers.

I worked on a plugin called workspace-minimap for this issue. You can find its [codebase here](https://github.com/google/blockly-samples/tree/master/plugins/workspace-minimap) and it's [interactive plugin demo here](https://google.github.io/blockly-samples/plugins/workspace-minimap/test/index.html). A workspace-minimap is a minimap that shows the entire workspace on a tiny map located at the top-right of the workspace. It provides improved navigation and organization within a workspace. A workspace-minimap looks like this, 

>![](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1nmpciwlsg5uy843iokt.png)

Minimap mimics the entire workspace. Certain blocks on a workspace can have comments on them. For example function blocks, 

>![function block](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8sqr5ohmura7jpzra5c.png)

When a user opens the comment section from a block present in the workspace and edits it, it won't update the minimap comments in real-time. So the user has to refresh the page to see the updated comments on minimap. Then when they click on the comments button on the blocks present on the minimap it'll show the comments but, they're in read-only mode, which I'm assuming they shouldn't be. Users should be allowed to edit the comments from the minimap as well, as per my understanding from the description attached on the issue. The project maintainers mentioned that the minimap isn't a perfect impression of the workspace so opening the comments should be disabled from minimap altogether.

Since I was new to the codebase, it was hard for me to figure out what they asked the contributor to do to fix the issue. I asked them to [give me more information](https://github.com/google/blockly-samples/issues/1923#issuecomment-1793545845) on how to disable the comments feature on minimap since I couldn't decipher the original explanation mentioned to resolve the issue. The description mentioned `modify the minimap workspace config to set comments: false` which didn't make sense to me since I looked for a config file that is possibly setting config options for the minimap, but that wasn’t the case.

[They replied](https://github.com/google/blockly-samples/issues/1923#issuecomment-1795561964) by pointing me to the perfect spot to look for and what to edit to fix the issue. And I went on a mission to fix this bug.

It was a simple fix, by adding `comments: false` to the workspace-minimap configuration object which helps build the minimap,

>![minimap configuration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8gn2epce3i0s4paowife.png)

After adding the code changes, I re-ran the reproduction steps only to figure out that the changes I made didn't do anything. At which point I made a [video explanation](https://github.com/google/blockly-samples/assets/71615163/93e2c41c-f653-46b6-94c9-cee7a65438d3) _(will download a video file, upon clicking the link)_ to explain [my investigation](https://github.com/google/blockly-samples/issues/1923#issuecomment-1795771448) on this issue.  

After a bit of testing on their end, the project maintainer [replied](https://github.com/google/blockly-samples/issues/1923#issuecomment-1795897081) saying 
they were under the wrong impression of what these code changes do. These changes merely disable the users from creating/editing the comments and do not entirely disable comments from being constructed programmatically.

At that point, I concluded working on this issue by providing [an ending remark](https://github.com/google/blockly-samples/issues/1923#issuecomment-1795903722) since they wanted to run this issue through their triage team.

It was a good exercise for me regardless since my main goals from the 0.2 to 0.3 release were to interface more with code that is part of a larger project and facilitate healthy and fruitful conversations with the maintainers, among others as mentioned in [first blog of this series](https://dev.to/sdthaker/delving-into-open-source-territory-with-google-pr-1-3gkk) within the section called _"Measuring progress from 0.2 release"_.