-
-
Notifications
You must be signed in to change notification settings - Fork 488
Order custom board option menus as defined in platform configuration #2717
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
Conversation
Title: Custom board option menus not following the order sent by the cli Fixes "Custom board option menus not following the order inside boards.txt" Line 74-76 of "boards-data-menu-updater.ts": for (const { label, option, values } of configOptions.sort( ConfigOption.LABEL_COMPARATOR )) { New Line 74: for (const { label, option, values } of configOptions ) { IMHO using sort on configOptions will produce the mentioned failure. Simply don't sort and the order will be as in Arduino IDE 1.x (as desfined inside board.txt) I don't have the tools to build and test this change. I use the AppImage "arduino-ide_2.3.6_Linux_64bit.AppImage" Signed-off-by: Günter Neiß <gneiss@web.de>
CLA assistant check
All committers have signed the CLA.
Signed-off-by: Günter Neiß <gneiss@web.de>
@per1234
Just one additional remark.
Before I found this "configOptions.sort...", I are confused about the order of the menu entries.
IMHO these should be either "as defined in boards.txt" (as in IDE 1.x) or alphabetical by name.
But it's sorted by the menu-id (label) instead of value.
Using a sort by value will produce a sorted order that is understandable by a human, but if that is what is wanted the documentation has to be adopted for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your pull request @gneiss15. Unfortunately it doesn't appear to have fixed #2036.
If the change you propose had fixed #2036 then we would expect the custom board options menus to be ordered as they are in the Arduino IDE 1.8.19 Tools menu. For example, with Tools > Board > esp32 > ESP32 Dev Module selected from the Arduino IDE menus:
Note the order of the custom board menus:
- Upload Speed
- CPU Frequency
- Flash Frequency
- ...
However, when I use the tester build and select Tools > Board > esp32 > ESP32 Dev Module, the Tools menu contains:
Note the order of the custom board menus:
- CPU Frequency
- Core Debug Level
- Erase All Flash Before Sketch Upload
- ...
Signed-off-by: Günter Neiß <gneiss@web.de>
Hi @per1234,
in the meanwhile I had installed all the necessary tools for compiling and testing.
.. And yes my previous PR did not solve the problem.
Now I found, that removing the sort isn't enough, because that will not change the order inside the menu (only the order the confiOptions are processed).
Now I found (I am new to electron, typescript and so on), that the menu entries will be sorted by the last value of 'menuPath', which is currently '${option}'.
And that is the reason why they are sorted as shown above (by You). I now use '${order}`.
order is calculated from the current entry-number (or index of the entry inside configOptions).
So now the PR works as he should be.
PS.: The checks show some errors. I don’t know how to fix them, because they are not related to my PR
The checks show some errors.
I see:
https://github.com/arduino/arduino-ide/actions/runs/14632188215/job/41056410243?pr=2717#step:9:264
electron-app: electron-app: $ theia download:plugins
electron-app: --- downloading plugins ---
electron-app: + vscode-arduino-tools: downloaded successfully
electron-app: + vscode-arduino-api: downloaded successfully
electron-app: + cortex-debug: downloaded successfully
electron-app: --- collecting extension-packs ---
electron-app: --- collecting extension dependencies ---
electron-app: x vscode-builtin-json: failed to download with: 503
electron-app: x vscode-builtin-cpp: failed to download with: 503
electron-app: x vscode-language-pack-bg: failed to download with: 503
electron-app: x vscode-builtin-json-language-features: failed to download with: 503
electron-app: x vscode-language-pack-ko: failed to download with: 503
electron-app: x vscode-language-pack-cs: failed to download with: 503
electron-app: x vscode-language-pack-fr: failed to download with: 503
electron-app: x vscode-language-pack-de: failed to download with: 503
electron-app: x vscode-language-pack-it: failed to download with: 503
electron-app: x vscode-language-pack-hu: failed to download with: 503
electron-app: x vscode-language-pack-pt-BR: failed to download with: 503
electron-app: x vscode-language-pack-es: failed to download with: 503
electron-app: x vscode-language-pack-pl: failed to download with: 503
electron-app: x vscode-language-pack-ja: failed to download with: 503
electron-app: x vscode-language-pack-ru: failed to download with: 503
electron-app: x vscode-language-pack-zh-hans: failed to download with: 503
electron-app: x vscode-language-pack-zh-hant: failed to download with: 503
electron-app: x vscode-language-pack-nl: failed to download with: 503
electron-app: x vscode-language-pack-tr: failed to download with: 503
electron-app: x vscode-language-pack-uk: failed to download with: 503
electron-app: Error: Errors downloading some plugins. To make these errors non fatal, re-run with --ignore-errors
electron-app: at downloadPlugins (/home/runner/work/arduino-ide/arduino-ide/node_modules/@theia/cli/lib/download-plugins.js:116:15)
electron-app: at async Object.handler (/home/runner/work/arduino-ide/arduino-ide/node_modules/@theia/cli/lib/theia.js:371:13)
electron-app: electron-app: error Command failed with exit code 1.
I don’t know how to fix them, because they are not related to my PR
The problem is that the "Open VSX Registry" from which these extensions are downloaded from is currently down:
There is no way for us to do anything about this. We must simply wait until they are able to resolve the outage. I'll trigger another run of the automated checks once that happens.
The checks show some errors.
...
The problem is that the "Open VSX Registry" from which these extensions are downloaded from is currently down:
...
There is no way for us to do anything about this. We must simply wait until they are able to resolve the outage. I'll trigger another run of the automated checks once that happens.
I saw that it is a "503 Service unavailable" error/problem, but don't know how to trigger another run of the automated checks. So thanks for doing it for me.
@per1234 Hm, the PR is now mared as "closed" ?? I am not sure, did this mean he will not be merged ?
Uh oh!
There was an error while loading. Please reload this page.
The use of
sort
onconfigOptions
caused the custom board options menus to be ordered according to the lexicographical order of the machine identifiers of the menus instead of allowing the platform developer to control the order in a manner that will be most friendly for human users (via the ordering in theboards.txt
platform configuration file).Removing the sorting code allows the order to be as intended by the platform developer, and aligns the behavior with that of Arduino IDE 1.x.
Fixes #2036
Reviewer checklist