From ca799136f69b71d6c7b6e9fe08bf4618374ecc18 Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Mon, 3 Aug 2026 18:34:46 +0200 Subject: [PATCH] feat(sd): parts with their own TF slot get the SD upload panel The "SD Card" upload panel in the property dialog was keyed to one component id, microsd-card, so a part that CARRIES a slot of its own (the Seeed Round Display shield) had a working card electrically but no way to put files on it - the user saw the slot mount and could never feed it. New metadata flag sdSlot: the dialog shows the same panel for any part that declares it, persisting uploads as properties.sdFiles exactly like the standalone card. The part's simulation is responsible for reading them when it builds its card image. --- .../src/components/simulator/ComponentPropertyDialog.tsx | 7 +++++-- frontend/src/types/component-metadata.ts | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/simulator/ComponentPropertyDialog.tsx b/frontend/src/components/simulator/ComponentPropertyDialog.tsx index 89ce04fe..4311d2f1 100644 --- a/frontend/src/components/simulator/ComponentPropertyDialog.tsx +++ b/frontend/src/components/simulator/ComponentPropertyDialog.tsx @@ -336,8 +336,11 @@ export const ComponentPropertyDialog: React.FC = ( )} {/* microSD card — upload your own files (paid). Free auto-copy of the - project's files happens at simulation start, not here. */} - {componentMetadata.id === 'microsd-card' && ( + project's files happens at simulation start, not here. Parts that + carry their OWN TF slot (metadata.sdSlot, e.g. the Seeed Round + Display shield) get the same panel: their attach reads + properties.sdFiles when it builds the card image. */} + {(componentMetadata.id === 'microsd-card' || componentMetadata.sdSlot === true) && ( onPropertyChange?.(componentId, 'sdFiles', next)} diff --git a/frontend/src/types/component-metadata.ts b/frontend/src/types/component-metadata.ts index 5fc808f4..dffaf4cb 100644 --- a/frontend/src/types/component-metadata.ts +++ b/frontend/src/types/component-metadata.ts @@ -51,6 +51,12 @@ export interface ComponentMetadata { // ComponentRegistry sorts featured components first after loading the // metadata, keeping the original order within each group. featured?: boolean; + // The part carries a microSD/TF slot of its own (e.g. the Seeed Round + // Display shield). The property dialog shows the same "SD Card" upload + // panel the standalone microsd-card gets, and the part's simulation reads + // `properties.sdFiles` when it builds the card image. Without this flag a + // built-in slot exists electrically but there is no way to put files on it. + sdSlot?: boolean; } export interface ComponentMetadataCollection {