Skip to content

Use more appropriate File > Examples menu section for "built-in" libraries #2259

Open
@per1234

Description

@per1234

Describe the request

Place the examples of the "built-in" libraries under a more appropriate section of the File > Examples menu section.

Option A: Move to "Examples from Custom Libraries"

Under the current menu structure, the "Examples from Custom Libraries" section is more appropriate for these examples. The reason

alternative of moving the examples of the "built-in" libraries to the "Examples from Custom Libraries" section would also not be appropriate because it is not accurate to call these official libraries, which are automatically installed by Arduino IDE to a location fairly inaccessible to the user and thus unlikely to be subject to modification, "Custom".

Option B: Move to dedicated section

This is the approach taken by Arduino IDE 1.x, places the examples of the "built-in" libraries under a section of the menu named "Examples for any board".

I don't think the "Examples for any board" label is appropriate because the examples of the built-in libraries aren't necessarily for "any board" (though the situation was probably different at the time this label was chosen by the IDE 1.x developers). For example, the built-in "Keyboard" library's example can not be used with boards that don't have a native USB capability (e.g., UNO, Mega, Nano). Something like "Examples from Built-in Libraries" would be more appropriate.

Something that should be noted in relation to this option is that Arduino IDE 1.x had a larger number of "built-in" libraries (we pruned obsolete/less relevant libraries from the "built-in" set used by IDE 2.x), and the initial trend was for the number of "built-in" libraries to grow steadily over time (because this was the primary distribution mechanism for official libraries prior to the creation of Library Manager). So Arduino IDE 1.x had a greater need for a dedicated section in the menu.

Describe the current behavior

There are three1 different categories of locations where Arduino libraries are installed:

  • Platform2 (e.g., C:\Users\<username>\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\)
  • Built-in3 (e.g., C:\Users\<username>\AppData\Local\Arduino15\libraries\)
  • Sketchbook (e.g., C:\Users\<username>\Documents\Arduino\libraries\)


1. There is a fourth category (LIBRARY_LOCATION_UNMANAGED), but it is not relevant to Arduino IDE.

2. At a lower level, these fall into two subcategories (LIBRARY_LOCATION_PLATFORM_BUILTIN, LIBRARY_LOCATION_REFERENCED_PLATFORM_BUILTIN), but this is not significant for the user so they can be combined in the IDE UI.

3. Despite the similar name, this is completely different from the standalone example sketches that are listed under the "Built-in examples" section of the menu.

The libraries under the platform location are typically bundled with the platform due to being very specific to the architecture of the boards of that platform. Only the libraries of the specific platform of the currently selected board are accessible at any given time.

The libraries under the built-in location are the libraries that are automatically installed by Arduino IDE on the first run after a fresh installation. These are fundamental official libraries which are installed by default in order to provide new users with a gentle learning curve by allowing them to make a decent range of projects before introducing the requirement to learn how to use Library Manager.

The libraries under the sketchbook folder are the ones the user has installed or updated (via Library Manager, "Add .ZIP Library...", or manual installation).

The example sketches bundled with the installed libraries are listed in the File > Examples menu. This menu is separated into sections. The section under which a given library is placed in the menu depends on its location category:

Location Menu Section
platform "Examples for <board name>"
built-in "Examples for <board name>"
sketchbook "Examples from Custom Libraries"

🙁 The "Examples for <board name>" label might not be accurate for the examples of the "built-in" libraries:

  • These examples are completely incompatible with some boards
  • The examples are not specifically targeted to a given board in the way the platform-bundled libraries are.

Arduino IDE version

153e34f

Operating system

Windows

Operating system version

11

Additional context

Related

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: enhancementProposed improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions