feat: Resolve reference designator text for {NAME}, {REF}, and {REFERENCE} in SchematicText#2058
Merged
seveibar merged 5 commits intotscircuit:mainfrom Mar 17, 2026
Merged
feat: Resolve reference designator text for {NAME}, {REF}, and {REFERENCE} in SchematicText#2058seveibar merged 5 commits intotscircuit:mainfrom
seveibar merged 5 commits intotscircuit:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
seveibar
requested changes
Mar 15, 2026
Contributor
seveibar
left a comment
There was a problem hiding this comment.
Resolve text should take no arguments
seveibar
reviewed
Mar 16, 2026
| <schematictext schX={-0.35} schY={-0.35} text="-" fontSize={0.3} /> | ||
|
|
||
| <port | ||
| name="IN+" |
Contributor
There was a problem hiding this comment.
This is an invalid port name and should throw, dont use it
Contributor
|
Neither IN+ nor IN- are valid port names |
seveibar
approved these changes
Mar 17, 2026
Contributor
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements dynamic replacement of reference designator within primitives. This allows users to use variables like
{NAME}or{REF}inside symbol text, which will then be automatically resolved to the component's reference designator (e.g.,U1,R5) during rendering.Changes
Added a protected
_resolveTextmethod that searches for the parent NormalComponent and performs regex-based substitution for{NAME},{REF}, and{REFERENCE}.Updated the render phase to process the
textproperty through_resolveTextbefore inserting it into the database.Testing
{NAME}is correctly replaced with the component name.bun test.