Skip to content

Sketchbook folder not created on startup #1445

Closed
@per1234

Description

@per1234

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

  1. Rename or delete your sketchbook folder (you can find the location by checking the "Sketchbook location" preference in the IDE).
  2. Start the Arduino IDE.
  3. Select "File > Preferences" from the Arduino IDE menus.
  4. Modify the "Editor font size" value.
  5. Click the OK button.
    🐛 The preference can not be changed because the button is disabled.
  6. Click the CANCEL button.
  7. Select File > Save as from the Arduino IDE menus.
  8. A path without any enhanced treatment is selected in the "Save sketch folder as..." dialog.

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

  • I searched for previous reports in the issue tracker
    I verified the problem still occurs when using the latest nightly build
    My report contains all necessary details

Activity

added
topic: codeRelated to content of the project itself
type: imperfectionPerceived defect in any part of project
on Sep 16, 2022
self-assigned this
on Sep 16, 2022
added a commit that references this issue on Sep 16, 2022
c90bede
added a commit that references this issue on Sep 21, 2022
6983c5b
added a commit that references this issue on Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @kittaakos@per1234

    Issue actions

      Sketchbook folder not created on startup · Issue #1445 · arduino/arduino-ide