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.
This commit is contained in:
parent
d4ec4fe04d
commit
ca799136f6
|
|
@ -336,8 +336,11 @@ export const ComponentPropertyDialog: React.FC<ComponentPropertyDialogProps> = (
|
|||
)}
|
||||
|
||||
{/* 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) && (
|
||||
<SdCardPanel
|
||||
files={(componentProperties.sdFiles as UploadedSdFile[] | undefined) ?? []}
|
||||
onChange={(next) => onPropertyChange?.(componentId, 'sdFiles', next)}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue