add screen option to mountedpcbmodule and corresponding tests#496
Merged
rushabhcodes merged 1 commit intotscircuit:mainfrom Feb 5, 2026
Merged
Conversation
seveibar
approved these changes
Feb 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an optional screen parameter to the mountedpcbmodule function that renders a silkscreen outline to indicate a screen/display area on a mounted PCB module. The feature defaults to false and uses a 95% inset rectangle with a thinner stroke width to distinguish it from the main module outline.
Changes:
- Added
screenboolean parameter to the schema with appropriate description - Implemented screen outline rendering logic with coordinates calculated at 95% of module dimensions
- Added snapshot test to verify the feature works correctly
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/fn/mountedpcbmodule.ts |
Added screen parameter to schema definition and implementation logic to draw silkscreen rectangle for display area |
tests/mountedpcbmodule_screen.test.ts |
Added test case to verify screen parameter produces expected SVG output |
tests/__snapshots__/mountedpcbmodule_screen_1.snap.svg |
Snapshot file capturing expected SVG output with screen outline enabled |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 pull request adds support for an optional silkscreen outline to indicate a screen/display area on a mounted PCB module. It introduces a new
screenparameter, updates the module logic to render the appropriate outline when enabled, and adds a test to verify the new feature.Feature addition:
screenboolean parameter to themountedpcbmodule_defschema, with a default value offalseand a descriptive comment.mountedpcbmodulefunction to handle the newscreenparameter.screenis enabled, using the module's width and height.Testing:
mountedpcbmodule_screen.test.ts) to verify that enabling thescreenparameter produces the expected SVG output.