← Back to community index
# support·Active

astrimid - schematicbox doesn't suport schSecti...

schematicbox doesn't suport schSectionName. Autogenerated bug description: code sample

Started by astrimidJul 23, 202616 messages

Discussion

Last active last month · plain text
astrimidoriginal post
schematicbox doesn't suport schSectionName. Autogenerated bug description: ``` The <schematicsection /> documentation states that "any component that accepts schematic position props also accepts schSectionName." schematicsection.mdx:67-75 Since <schematicbox /> accepts schX and schY, it should theoretically support schSectionName according to this rule. However, the explicit props table for <schematicbox /> doesn't include it, which suggests either: The prop is supported but missing from the documentation <schematicbox /> is an exception to the general rule ```
astrimid
```Type '{ schSectionName: string; }' is not assignable to type 'SchematicBoxProps'. ``` This is what editor parser says.
astrimid
the compiler ignores any properties that don't exist, not even a warning
astrimid
I guess editor linter stage and the eval/runframe are not doing the same thing?
astrimid
My intuition says that all `sch*` properties should be present in some schematic props interface that should be implemented/inherited by all components that support them? This potentially creates a self referential problem, but maybe nesting sections is a good thing? Nesting schematic sheets probably doesn't make sense, but schematic sheets can't be positioned either, so `schX`, `schY` and `schSectionName` should live in the same interface I believe.
astrimid
The workaround is to use another component and just treat schematic box as an overlay. But it won't expand the section size so that schematicbox will fit:
astrimid
<@809856037376491570> take a look at this as well
Seve
yep, we need to add to tscircuit/props so that it can be implemented in tscircuit/core
astrimid
Here's what I found: `SchematicBox` extends `PrimitiveComponent` and uses schematicBoxProps, which doesn't appear to include `schSectionName` and `schSheetName`. So the documentation is lying, there's no code enfoced guarantee that `schX` and `schSectionName` are in the same inferace.
astrimid
https://github.com/tscircuit/docs/blob/main/docs/elements/schematicsection.mdx#component-schsectionname
astrimid
or rather `schematicbox` change didn't update all the places where it breaks a convention
astrimid
Ok, schematicbox zod schema does include schSectionNmae: ``` export const schematicBoxProps = z .object({ name: z.string().optional(), chipRef: z.string().optional(), pinLabels: pinLabelsProp.optional(), schPinArrangement: schematicPinArrangement.optional(), schX: distance.optional(), schY: distance.optional(), schSectionName: z.string().optional(), schSheetName: z.string().optional(), ```
astrimid
Ah, wait. Ok, I'm slow...
astrimid
my claim stands though, there's no interface or schema that enforces the rule that everything that contains `schX` also contains `schSectionName`, it's all based on manually assured consistency.
astrimid
which I guess you can't automate, as each component requires custom implementation of its properties?
astrimid
But since props are merged before `core` implementation, I guess there's no guarantee that any version of `props` has a corresponding implementation in `core`

Want to add to the conversation?

Reply in Discord so your notes stay connected to the source.
Continue in Discord ↗