feat: support {props.name} in silkscreen text for component name - #366
feat: support {props.name} in silkscreen text for component name#366techmannih wants to merge 16 commits into
Conversation
…cturer part numbers as component names
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba94f9954e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
seveibar
left a comment
There was a problem hiding this comment.
didn't you just implement {NAME} support, but instead you add U1 which will break things?
| const text = | ||
| silkscreenText.text === "{NAME}" | ||
| ? "{props.name}" | ||
| : JSON.stringify(silkscreenText.text) |
There was a problem hiding this comment.
using this ternary to handle the name/ref placeholder — when the silkscreen text represents the component name, it’s replaced with {props.name}. For any other silkscreen text defined in the component, I keep it unchanged
seveibar
left a comment
There was a problem hiding this comment.
see comment. What are you giving this ternary for constructing the name? Keep it simple and understandable
|
@techmannih make sure to fix your PR title- i almost requested changes because your title is so inaccurate!!!! |
| useModelCdn, | ||
| shouldRecenter = true, | ||
| cadPositionZMm, | ||
| showDesignator = false, |
seveibar
left a comment
There was a problem hiding this comment.
you need to start over. Keep it simple. This code is extremely, extremely unclear.
name things MUCH BETTER- this is seriously unacceptably bad naming!!!
you need to name the variables better. What is text? Is that the circuitJsonText? What isReferenceDesignator? Are you refer to the jlcpcbTextIsRefDes? NAME THINGS BETTER!!!! TERRIBLE NAMING!
This PR improves the EasyEDA to TSX conversion by correctly identifying and standardizing reference designators (like "U1", "R1").
Changes:
REFERENCE_DESIGNATORconstant ({{NAME}}).REFERENCE_DESIGNATORconstant. Added a fallback mechanism for when no designator is explicitly present in the EasyEDA JSON.silkscreentextgeneration to use{props.name}when the text matches theREFERENCE_DESIGNATOR. This makes the generated footprint's reference designator dynamic and tied to the component's name prop.C2652953, including snapshots, to verify the correct conversion and dynamic designator.