The issue can be found here: https://github.com/mozilla/thimble.mozilla.org/issues/2037
The during the creation of a tutorial.html file a button is created near the preview button. This enables users who remix the project to learn how to modify it to make it their own. The issue arrises when the tutorial.html button is deleted. The button that is created during the generation of the tutorial.html file is not removed when the html file is. This leaves a button that doesn’t do anything. To manually remove it the user needs to refresh the page.
After breaking the dialog.js file and attempting to delete a file I caused an error on the page where the delete file was handled. So I reverted my changes and began thinking of solution.
My initial idea was to fix this issue was to implement an automatic refresh when a file is deleted.
This image lacks the functionality that checks if the file is a tutorial( obviously will be changed it was just implemented a test to see if this line of code would successfully reload the page and remove the button)
this unfortunately resulted in a endless load.
I attempted to use brackets handleReload() method to handle restarting the browser, but this also resulted in an endless loading times. I also tried refreshing without including extensions and got the same result.
I then checked to see if thimble has a reload, which it did not. I wanted to see if the reloading was failing due to the fact that I was working on thimble, so I went on localhost 8000 and attempted to delete a file on brackets to see if the file reloads successfully. It appears it still hangs on something (methods tried : window.location.reload(), handleReload(href), window.location.href = window.location.href).
Sensing this solution not going to work, I did some research on what functionality has already been implemented for tutorial. Upon looking at the available methods I saw a method that handles manipulation of showing and hiding this button. I am unfamiliar with how to include this path. I attempted putting in the standard path, but I got a script error from requirejs. My next attempt was following the same structure as I saw on some of the many other fetchers. This too resulted in a script error. My other attempt was using the getModule(“name”) method, but this results in a message saying “Module name . . . has not been loaded yet for context”, which I am unfamiliar with and plan on doing a bit of research for.
For this plan to work I need to be able to figure out how the system can recognize the files name. This needs to be done so during the event of a file being destroyed I can integrate the functionality to drop the button only when a tutorial.html file is being deleted OR if the name is changed as it should be treated the same way.
Another possibility is that the functionality is already implemented it just isn’t working
I then checked to see if thimble has a reload, which it did not. I wanted to see if the reloading was failing due to the fact that I was working on thimble, so I went on localhost 8000 and attempted to delete a file on brackets to see if the file reloads successfully. It appears it still hangs on something (methods tried : window.location.reload(), handleReload(href)).
A found out the issue with reloading was the location i was implementing the reloading.. I started handling reload in the bramble.js. after a lot of time going over the variables that don’t follow proper naming conventions I was able to fix this issue. I was unable to find a way to extract the name of the file, but I was able to access the path. So with a bit of string manipulation I extracted the file name. So I will be ableto identify if the application needs to be reset ( which would be when tutorial.html is deleted or when tutorial.html is renamed.)
correctly. This is gonna be the next step in researching this issue.