This scenario has come up a few times. A student has a sketch.js file on their desktop, not in a folder with an index.html and libraries directory. The student drags that file onto the p5.js editor. It opens but doesn't run of course since the the html file is not there. And if you select "show sidebar" your whole desktop appears (since that's its directory).
I propose making some attempt to detect opening a file not associated with a properly formatted "project" folder, giving a warning to the user, and offering to make a project folder with the sketch.js file. This is a similar behavior to opening a pde file in Processing not in a proper sketch folder.
This scenario has come up a few times. A student has a
sketch.js
file on their desktop, not in a folder with anindex.html
andlibraries
directory. The student drags that file onto the p5.js editor. It opens but doesn't run of course since the the html file is not there. And if you select "show sidebar" your whole desktop appears (since that's its directory).I propose making some attempt to detect opening a file not associated with a properly formatted "project" folder, giving a warning to the user, and offering to make a project folder with the
sketch.js
file. This is a similar behavior to opening apde
file in Processing not in a proper sketch folder.