Skip to content

test: add capacitive touch slider snapshot test with polygon smtpads#2036

Open
CharlesWong wants to merge 2 commits intotscircuit:mainfrom
CharlesWong:feat/capacitive-touch-slider
Open

test: add capacitive touch slider snapshot test with polygon smtpads#2036
CharlesWong wants to merge 2 commits intotscircuit:mainfrom
CharlesWong:feat/capacitive-touch-slider

Conversation

@CharlesWong
Copy link

Summary

Adds a PCB snapshot test for a 5-segment capacitive touch slider using polygon SMT pads with solder mask coverage, demonstrating the use case from tscircuit/tscircuit#786.

Test: tests/components/normal-components/capacitive-touch-slider.test.tsx

The test creates a board with a chip footprint containing 5 diamond-shaped polygon smtpads arranged as a linear capacitive touch slider:

<chip name="U1" footprint={
  <footprint>
    {Array.from({ length: 5 }, (_, i) => {
      const offsetX = (i - 2) * 3.0
      return (
        <smtpad
          shape="polygon"
          points={diamondPoints(1.2, 2.5, offsetX, 0)}
          portHints={[`pin${i + 1}`]}
          coveredWithSolderMask={true}
        />
      )
    })}
  </footprint>
} />

Verifications

  • ✅ All 5 pads render as polygon shape
  • ✅ All pads have is_covered_with_solder_mask: true
  • ✅ No pcb_solder_paste elements generated (correct for touch pads)
  • ✅ Each polygon pad has 4 points (diamond shape)
  • ✅ Pad centroids are distinct across the slider axis
  • ✅ PCB SVG snapshot generated

Related

/claim #786

…scircuit#786)

Add a snapshot test demonstrating capacitive touch slider implementation
using polygon-shaped SMT pads with solder mask coverage.

The test verifies:
- 5-segment capacitive touch slider with diamond-shaped polygon pads
- All pads have is_covered_with_solder_mask: true
- No solder paste is generated for covered pads
- Pads have correct polygon point count (4 for diamonds)
- Pad centroids are distinct across the slider width

Relates to tscircuit/tscircuit#786
@vercel
Copy link

vercel bot commented Mar 11, 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 Mar 14, 2026 9:15pm

Request Review

@github-actions
Copy link

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

…ider test

Remove `key` prop from <smtpad> element since SmtPadProps (a discriminated
union type) does not include `key` in its type definition, causing TS2322.
Also apply biome formatting to break long function call arguments across
multiple lines.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link

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

@CharlesWong
Copy link
Author

Gentle ping — this PR is still relevant and the snapshot tests are passing. Happy to rebase or address any feedback if needed.

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.

1 participant