Skip to content

"Port" menu section headings are located at bottom of section #1566

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
3 tasks done
per1234 opened this issue Oct 18, 2022 · 1 comment · Fixed by #1569
Closed
3 tasks done

"Port" menu section headings are located at bottom of section #1566

per1234 opened this issue Oct 18, 2022 · 1 comment · Fixed by #1569
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Oct 18, 2022

Describe the problem

Arduino IDE supports communication channels (referred to as "ports") between board and computer of any arbitrary type. The Tools > Port menu is segmented into separate sections for each protocol of the available ports. Each of these sections has a heading describing the protocol.

🐛 The headings are located at the bottom of the sections in the Tools > Port menu.

To reproduce

Equipment

At least one recognized "port" on your computer. This could be produced by an Arduino, some other device, or an internal system port.

Steps

  1. Select Tools > Port from the Arduino IDE menus.

🐛 The headings are located at the bottom of the sections in the Tools > Port menu:

image

Expected behavior

Headings to be located at the top of the sections:

image

Arduino IDE version

2.0.1-snapshot-99b1094

Operating system

Windows

Operating system version

10

Additional context

I bisected the introduction of the bug to 960a2d0 (doesn't occur when using the build for e577de4)

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
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Oct 18, 2022
@nmzaheer
Copy link
Contributor

nmzaheer commented Oct 18, 2022

I think this has to do with some part of the code that is sorting the menu entries in alphabetical order. I will try to pin point the code that has caused this regression.

Edit : I think it has to do with line number 279 wherein it should be { order: protocolOrder.toString().padStart(4) }

const placeholder = new PlaceholderMenuNode(
menuPath,
nls.localize(
'arduino/board/typeOfPorts',
'{0} ports',
Port.Protocols.protocolLabel(protocol)
),
{ order: protocolOrder.toString() }
);

Please let me know if my analysis is right. In that case, I can submit a PR .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants