From 0653aad3d47cb899cf7f5e88fd5a714ccd2468c9 Mon Sep 17 00:00:00 2001 From: David Montero Date: Mon, 10 Aug 2026 21:44:55 +0200 Subject: [PATCH] =?UTF-8?q?fix(picker):=20hide=20the=20Nano=20RP2040=20Con?= =?UTF-8?q?nect=20shell=20=E2=80=94=20art=20without=20a=20simulator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- frontend/src/components/ComponentPickerModal.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/src/components/ComponentPickerModal.tsx b/frontend/src/components/ComponentPickerModal.tsx index 58be7a36..45f8c233 100644 --- a/frontend/src/components/ComponentPickerModal.tsx +++ b/frontend/src/components/ComponentPickerModal.tsx @@ -103,6 +103,15 @@ const BOARD_DESCRIPTIONS: Record = { 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 = ({ // (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 —