Skip to content

feat: map knockout props in SilkscreenText component#1886

Open
bimakw wants to merge 6 commits intotscircuit:mainfrom
bimakw:feat/knockout-silkscreen-text
Open

feat: map knockout props in SilkscreenText component#1886
bimakw wants to merge 6 commits intotscircuit:mainfrom
bimakw:feat/knockout-silkscreen-text

Conversation

@bimakw
Copy link

@bimakw bimakw commented Feb 1, 2026

Summary

Add support for knockout silkscreen text by mapping component props to circuit-json fields.

  • Map isKnockout prop to is_knockout in pcb_silkscreen_text
  • Map knockoutPaddingLeft/Right/Top/Bottom props to knockout_padding object
  • Add test verifying knockout props are correctly set in circuit-json

Changes

lib/components/primitive-components/SilkscreenText.ts:

  • Build knockout_padding object from individual padding props
  • Pass is_knockout and knockout_padding to db.pcb_silkscreen_text.insert()

Test Plan

  • silkscreen-text-knockout.test.tsx verifies is_knockout: true in database
  • All existing silkscreen tests pass (9 tests)
  • TypeScript type check passes

Related

/claim #770

Part of tscircuit/tscircuit#770 (Pinout Diagram Improvements)
Companion PR: tscircuit/circuit-to-svg#495

@bimakw bimakw force-pushed the feat/knockout-silkscreen-text branch from a200ed0 to 91951db Compare February 3, 2026 07:58
@vercel
Copy link

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview, Comment Feb 7, 2026 9:48am

Request Review

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

@bimakw
Copy link
Author

bimakw commented Feb 6, 2026

Still active. All CI passing, no conflicts. This maps the knockout props (is_knockout + knockout_padding) to pcb_silkscreen_text in circuit-json. Companion PR will be resubmitted on circuit-to-svg.

@seveibar would appreciate a review when you get a chance.

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

knockout text does not appear as knockout text

@bimakw
Copy link
Author

bimakw commented Feb 6, 2026

Companion PR resubmitted: tscircuit/circuit-to-svg#506 (rebased on latest main, #495 was stale-closed).

@seveibar
Copy link
Contributor

seveibar commented Feb 6, 2026

Sorry @bimakw, i see that you have a companion PR, that needs to be merged first

@bimakw
Copy link
Author

bimakw commented Feb 6, 2026

Got it! Yeah the knockout rendering lives in circuit-to-svg#506 — once that's merged and published, the core snapshot will show the actual knockout effect. Could you review #506 first?

@bimakw
Copy link
Author

bimakw commented Feb 6, 2026

Updated — circuit-to-svg bumped to 0.0.327 (includes the merged #506) and regenerated the knockout snapshot. The silkscreen text now renders with the actual SVG mask knockout effect. Rebased on latest main too, all CI should be green.

@bimakw
Copy link
Author

bimakw commented Feb 6, 2026

CI has 2 snapshot mismatches (repro32, repro54) — these are from circuit-to-svg 0.0.326's schematic text positioning change (#497). Snapshots render identically on macOS but slightly different on Ubuntu/CI due to font metrics. All other tests pass (780 total). Could you re-run CI with snapshot updates, or I can try regenerating in a Linux container if needed.

@bimakw
Copy link
Author

bimakw commented Feb 6, 2026

All CI green now — regenerated the 2 schematic snapshots on Ubuntu/bun-1.3.5 via Docker to match CI font rendering. Ready for review.

Add support for knockout silkscreen text by mapping isKnockout and
knockoutPadding props to circuit-json is_knockout and knockout_padding fields.

- Map isKnockout prop to is_knockout in pcb_silkscreen_text
- Map knockoutPaddingLeft/Right/Top/Bottom to knockout_padding object
- Add test for knockout silkscreen text

Part of tscircuit/tscircuit#770
Updated dependency to include merged knockout silkscreen rendering.
Snapshot now shows actual knockout effect with SVG mask.
Schematic SVG output changed slightly with the new circuit-to-svg
version. All 780 tests pass with updated snapshots.
Generated via Docker (ubuntu:24.04 + bun 1.3.5) to match CI
font rendering for schematic text positioning.
The knockoutPadding (uniform) prop was not being used as fallback
for individual padding sides. Now knockoutPadding applies to all
four sides unless overridden by individual knockoutPaddingLeft/Right/
Top/Bottom props.
@bimakw bimakw force-pushed the feat/knockout-silkscreen-text branch from 7ac1e6f to 09e2680 Compare February 7, 2026 09:43
@bimakw
Copy link
Author

bimakw commented Feb 7, 2026

Hey, rebased on latest main (v0.0.1017) and addressed the review:

  • circuit-to-svg bumped to 0.0.327 which includes the knockout silkscreen rendering from circuit-to-svg#506 (merged)
  • Snapshot now shows actual knockout effect with SVG mask
  • Also fixed handling of the uniform knockoutPadding prop (was only handling individual Left/Right/Top/Bottom, now uniform padding works as fallback)
  • Added test for uniform knockout padding
  • All 125 primitive component tests pass

Ready for re-review.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants