Skip to content

A net's layers include the layers it has pads on (#140) - #144

Merged
Gherkin merged 2 commits into
mainfrom
net-layers-pads
Oct 27, 2026
Merged

Gherkin merged 2 commits into
mainfrom
net-layers-pads

Conversation

@Gherkin

@Gherkin Gherkin commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Closes #140.

netToLayers was built from tracks and zones only. A net with only pads on a layer, for example SMD pads on B and no track there, did not list that layer. So T and A with a net selected did not tick it, and netlayers=1 did not turn it on.

Pads are now added to the index too. The index now means "the net touches this layer" everywhere it is used:

  • T and A with a net selected
  • netlayers=1 in a link
  • the layer filter in the net list
  • the layer badges under a selected net
  • netLayers in the test API

Pads are stored on F and B only, so inner layers are not affected. The F and B filters in the net list now match most nets.

The README and the link tool description now say "tracks, zones or pads" instead of "routed on".

Tests: one each for the index, T and netlayers=1, using a fixture net that has pads on B and no copper there. npm run test:api, the browser suite and the MCP tests pass. The full browser run had one timeout in an inner layer checkbox changes both sides, a known flaky test; it passes when run alone.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UCbPYsA5LYNX8HZaGGZCpK

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-27 20:24 UTC

@Gherkin

Gherkin commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

Review round 1.

  • web/app.js:57 — a new closure per pad in the timed index loop. Fixed: plain for loop.
  • tests/browser/interaction.spec.js:940, tests/browser/links.spec.js:315 — .find(...).net throws a TypeError if the fixture has no such pad. Fixed: expect(pad).toBeDefined() first, as in smoke.spec.js.

FYI, not fixed:

  • web/app.js:241 — T on a net with pads only on the viewed side now does nothing. Matches the comment at :234-236. Before, such a net fell into the no-net branch only because it had no index entry.
  • web/app.js:667, :1629 — F/B filter matches most nets; netlayers=1 turns B on for TH-pad nets. Both follow from choosing "touches" over "routed on", as the PR body says.
  • web/app.js:57 — TH pads are stored as F/B only, so inner layers reached only by a TH barrel are not listed. Data limit, out of scope.
  • Fixture lookup is copied in three spec files. No shared test helper exists; each spec is standalone.

@Gherkin
Gherkin merged commit df48537 into main Oct 27, 2026
10 checks passed
@Gherkin
Gherkin deleted the net-layers-pads branch October 27, 2026 20:24
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.

netToLayers leaves out layers where a net has only pads

1 participant