Skip to content

Library Not Appearing in Alphabetical Order in "Import Library" Menu #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SableRaf opened this issue Mar 17, 2025 · 6 comments · Fixed by processing/processing4#1002
Closed

Comments

@SableRaf
Copy link
Collaborator

Description

While following the Getting Started tutorial, I noticed that the example library A Template Example Library does not appear in alphabetical order in the Sketch > Import Library... menu in Processing 4.

Processing version

4.4.0

Operating System

macOS 13.4

Expected Behavior

The library should be listed in alphabetical order among other contributed libraries.

Actual Behavior

The library appears out of order, making it harder to find, especially if there are a lot of other libraries installed.

Steps to Reproduce

  1. Follow the Getting Started guide to create a new library using the template.
  2. Run the deployToProcessingSketchbook Gradle task to install the example library.
  3. Open Processing and navigate to Sketch > Import Library....
  4. Observe that "A Template Example Library" is not sorted alphabetically with other contributed libraries.

Screen Capture

Image
@mingness
Copy link
Collaborator

Hmm, I wonder what the order of the listed libraries is dependent on then. Could it be the library short name, meaning, the name of the folder containing the library?

@SableRaf
Copy link
Collaborator Author

Thanks @mingness! Looks like that was it.

Image

I see two possible ways to address this:

  1. Update library.properties to change the long name from A Template Example Library to My Template Example Library, so it sorts more intuitively.

  2. Alternatively, we could look into modifying how libraries are ordered in the PDE (cc @Stefterv), and use the library's name property rather than the folder name for sorting.

@SableRaf
Copy link
Collaborator Author

On second thought, I think option 2 (sorting libraries by name) is the better approach. @Stefterv does it make sense from a technical point of view?

@Stefterv
Copy link
Collaborator

Just took a quick look, the order of the libraries defined well before this tree view is generated. I'd prefer to fix this when we create a new examples frame

@Stefterv
Copy link
Collaborator

Oh... speaking of second thoughts

Before
Image
After
Image

@SableRaf
Copy link
Collaborator Author

Nice! How did you fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants