Skip to content

add screen option to mountedpcbmodule and corresponding tests#496

Merged
rushabhcodes merged 1 commit intotscircuit:mainfrom
rushabhcodes:mountedpcbmodule_screen
Feb 5, 2026
Merged

add screen option to mountedpcbmodule and corresponding tests#496
rushabhcodes merged 1 commit intotscircuit:mainfrom
rushabhcodes:mountedpcbmodule_screen

Conversation

@rushabhcodes
Copy link
Contributor

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 screen parameter, updates the module logic to render the appropriate outline when enabled, and adds a test to verify the new feature.

Feature addition:

  • Added an optional screen boolean parameter to the mountedpcbmodule_def schema, with a default value of false and a descriptive comment.
  • Updated the mountedpcbmodule function to handle the new screen parameter.
  • Implemented logic to draw a silkscreen rectangle on the PCB module when screen is enabled, using the module's width and height.

Testing:

  • Added a test (mountedpcbmodule_screen.test.ts) to verify that enabling the screen parameter produces the expected SVG output.

Copilot AI review requested due to automatic review settings February 5, 2026 14:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 screen boolean 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.

@rushabhcodes rushabhcodes merged commit 1504e2c into tscircuit:main Feb 5, 2026
11 checks passed
@rushabhcodes rushabhcodes deleted the mountedpcbmodule_screen branch February 5, 2026 15:52
@tscircuitbot
Copy link
Contributor


Thank you for your contribution! 🎉

PR Rating: ⭐⭐⭐
Impact: Major

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants