Skip to content

In Sketchbook view, sketches are indented by the folder expansion control icon width even when there is no icon #1050

Closed
@per1234

Description

@per1234

Describe the problem

The Arduino IDE's "Sketchbook" view allows the user to browse and open sketches in their sketchbook folder.

The nesting structure of any subfolders of the sketchbook are indicated by indentation levels.

Since a sketch is the project unit used by the Arduino IDE, by default each sketch is shown as a single item in the "Sketchbook" view tree. The "Show files inside Sketches" preference causes the view to also show the files and subfolders of the sketch. The expansion of these is controlled via a /˅ icon to the left of the sketch name, just the same as is always done for non-sketch subfolders.

🐛 The space where the folder expansion control icon would be is preserved even when it is no longer shown due to the "Show files inside Sketches" preference being disabled. This makes the structure of the sketchbook very difficult to understand because the sketch is shown as indented, which indicates it is at a deeper tree level than is actually the case.

This sketchbook structure:

Arduino/
├── Foo/
│   └── Bar/
│       └── Baz/
│           └── Baz.ino
└── SomeSketch/
    └── SomeSketch.ino

Is rendered in the sketchbook view as this:

image

Which incorrectly indicates this structure:

Arduino/
└── Foo/
    └── Bar/
        └── SomeSketch/
            └── SomeSketch.ino

The reason becomes clear after enabling the "Show files inside Sketches" preference:

image

To reproduce

  1. Select File > Preferences... from the Arduino IDE menus.
  2. Uncheck the box next to " Show files inside Sketches if it is checked.
  3. Click the OK button.
  4. Open the "Sketchbook" view.

🐛 The sketches have an inappropriate indentation level.

Expected behavior

The sketch name is not indented by the space where the folder expansion control icon would be when the "Show files inside Sketches" preference is disabled.

The sketch icon should be horizontally aligned with the expansion control icon of any non-sketch subfolders at the same level as the sketch.

Arduino IDE version

2.0.0-rc7

Operating system

Windows, Linux

Operating system version

Windows 10, Ubuntu 20.04

Additional context

See #1038 for an example of confusion caused by this bug.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions