Sketchbook folder not created on startup #1445
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
The "sketchbook" folder is a storage location for several types of resources used by the Arduino IDE and the user. In addition to its use for global library installations, it is the preferred location for saving sketches due to the integration of this folder with the "Sketchbook" view and File > Sketchbook menu.
Currently, the Arduino IDE does not create the sketchbook folder at the default location if it does not already exist (which it won't for first time users).
🐛 The user is prevented from changing preferences until they have selected a sketchbook folder location that exists (#1444).
🐛 The Save As... dialog will not encourage saving sketches to the preferred location.
To reproduce
🐛 The preference can not be changed because the button is disabled.
Expected behavior
Sketchbook folder is created on IDE startup if it does not exist.
If it is not possible to create the sketchbook folder (e.g., it is on a removable or cloud drive that is not currently connected), the IDE should clearly communicate the problem to the user.
Arduino IDE version
2.0.0-snapshot-4e590ab
Operating system
Windows
Operating system version
10
Additional context
Prior to #1370, the sketchbook folder was generated on first run as a side effect of the "Arduino_Builtin" library installation.
As an alternative to automatically creating the sketchbook on startup, the current behavior of the "Preferences" dialog could be changed.
Currently, the "OK" button is disabled if the path set via the "Sketchbook location" preference does not exist. This is the most significant impact of the sketchbook folder not being created.
So if that check for a valid sketchbook path was removed, the remaining impact would be that saving a sketch to a sketchbook that doesn't exist is very complicated for the beginners who are most likely to experience this bug.
I looked for any other impacts of a missing sketchbook folder and didn't find one. Arduino CLI automatically creates the folder on any operation that requires it (Library Manager installation, "Add ZIP Library").
The combination of this bug with #1259 results in an especially poor user experience.
Arduino IDE 1.x creates the sketchbook folder on startup.
Issue checklist
The text was updated successfully, but these errors were encountered: