fix(picker): hide the Nano RP2040 Connect shell — art without a simulator
The metadata auto-scan sweeps every wokwi-elements board into the registry, and boards Velxio does not emulate surface as component cards that promise support we don't have. Filtered in the picker, not deleted from the metadata: four saved projects already contain the element and must keep rendering.
This commit is contained in:
parent
1800f57225
commit
0653aad3d4
|
|
@ -103,6 +103,15 @@ const BOARD_DESCRIPTIONS: Record<BoardKind, string> = {
|
|||
attiny85: '8-bit AVR, 8KB flash, 6 GPIO (browser)',
|
||||
};
|
||||
|
||||
/**
|
||||
* wokwi-elements ships art for boards Velxio does not emulate; the metadata
|
||||
* auto-scan sweeps them into the registry as plain components. Listing one in
|
||||
* the picker promises a board that will never boot, so they are hidden here —
|
||||
* NOT deleted from components-metadata.json, because saved projects that
|
||||
* already contain one still need the element to render.
|
||||
*/
|
||||
const UNSIMULATED_BOARD_SHELLS = new Set(['nano-rp2040-connect']);
|
||||
|
||||
/**
|
||||
* Maker-first category order for the picker grid and the category filter.
|
||||
* Velxio's audience is hobbyist-heavy: everyday digital parts (sensors,
|
||||
|
|
@ -266,6 +275,12 @@ export const ComponentPickerModal: React.FC<ComponentPickerModalProps> = ({
|
|||
// (that is how "add a Pi 4" placed a 40-pin prop that never boots).
|
||||
components = components.filter((c) => !(c.id in BOARD_KIND_LABELS));
|
||||
|
||||
// wokwi-elements board shells with no simulator behind them. They come
|
||||
// in through the metadata auto-scan and offering them reads as board
|
||||
// support we don't have. Filtered here rather than removed from the
|
||||
// metadata: saved projects that already placed one must keep rendering.
|
||||
components = components.filter((c) => !UNSIMULATED_BOARD_SHELLS.has(c.id));
|
||||
|
||||
// Maker-first ordering: most users reach for a sensor, an LED or a
|
||||
// display far more often than a bare transistor or a 74HC gate, so
|
||||
// passives / analog / logic sink to the end. Array.sort is stable —
|
||||
|
|
|
|||
Loading…
Reference in New Issue