Skip to content

Fix broken categories in pxtToolbox#1046

Open
THEb0nny wants to merge 2 commits intomicrosoft:masterfrom
THEb0nny:fix-broken-pxtToolbox
Open

Fix broken categories in pxtToolbox#1046
THEb0nny wants to merge 2 commits intomicrosoft:masterfrom
THEb0nny:fix-broken-pxtToolbox

Conversation

@THEb0nny
Copy link
Contributor

@THEb0nny THEb0nny commented Feb 6, 2024

I created a fix for pxtToolbox which breaks when adding some extensions. This bug appeared during the first beta version. I have attached a video of how this happens.
I actually don't understand why this leads to such a bug and why my solution works.

But adding custom.ts solved the bug. I don't know why this happens either.

Another observation worth noting is that the extensions that come from github do not break the categories in pxtToolbox.

2024-02-07_00-24-41.mp4
@THEb0nny
Copy link
Contributor Author

THEb0nny commented Feb 6, 2024

I tried moving the namespace attributes into my libraries and it worked. To be honest I don't know why this works.
But this doesn't work for namespace brick. I don't understand, it's not logical.
Namespace console is also in lib ev3, because the file is there, there is no bug for it.

2024-02-07_00-30-43.mp4
@THEb0nny
Copy link
Contributor Author

THEb0nny commented Feb 7, 2024

I have corrected the Brick category as follows.
I noticed that the namespace brick is in the files of another core library. Accordingly, I thought that because of this the category was being redefined and breaking. I moved the category attributes to ns.ts of the core library. This solved the problem.

I also thought that maybe I should move the files with the namespace brick from the core to the ev3 library. But this breaks the build, even though I specified the dependencies.

2024-02-07_13-33-55.mp4
@THEb0nny
Copy link
Contributor Author

@jwunderl hi, can you see the change?

@THEb0nny
Copy link
Contributor Author

@abchatra a pls review is needed here

@abchatra abchatra requested a review from Copilot February 27, 2026 22:53
@abchatra
Copy link
Collaborator

@riknoll possible to review this?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a regression where the MakeCode/PXT toolbox categories can break when certain extensions are added by relocating/adding the namespace-level toolbox metadata (colors, icons, groups) into the packages that own those namespaces more consistently.

Changes:

  • Add toolbox metadata for the music category via a new libs/music/ns.ts.
  • Move toolbox category metadata for motors, sensors, control, and brick from libs/ev3/ns.ts into libs/core/ns.ts.
  • Minor whitespace/formatting adjustments in libs/ev3/pxt.json.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
libs/music/ns.ts Adds namespace annotations to stabilize the music toolbox category/groups.
libs/ev3/pxt.json Formatting-only changes (no semantic change).
libs/ev3/ns.ts Removes category metadata for namespaces now defined in core/music; keeps EV3-specific categories.
libs/core/ns.ts Centralizes category metadata for core namespaces to avoid extension-order/category breakage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants