Skip to content

The Allegro export writes the pin number, and the pad table shows a through-hole pin once - #159

Merged
Gherkin merged 3 commits into
mainfrom
allegro-pin-names
Oct 30, 2026
Merged

Gherkin merged 3 commits into
mainfrom
allegro-pin-names

Conversation

@Gherkin

@Gherkin Gherkin commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Fixes #158.

The Allegro export never wrote the pin number. The viewer's pad table then showed each pad's place in the list under "Pin", and that is not the pin number. Through-hole pins made it worse: Allegro writes them as two pads (F "th" and B "smd" at one pos), so each one took two rows.

  • allegro-skills/exportJson.il: each pad gets "name": "<pin number>", on both pads of a through-hole pair.
  • web/app.js: the pad table shows a through-hole pair as one row, using the same rule as boardPads in the MCP tools.
  • .github/workflows/ci.yml: PRs from this repo publish ghcr.io/gherkin/htmlpcbviewer:pr-<N> and htmlpcbviewer-mcp:pr-<N>, so a branch can be tried before merge. :latest, version tags and :sha-* are still only set on pushes to main and v* tags.

Testing on Allegro

  1. Run allegro-skills/exportJson.il from this branch in Allegro on a board with SMD, through-hole and BGA parts.
  2. docker pull ghcr.io/gherkin/htmlpcbviewer:pr-<N> and open the export in it.
  3. Check the Pin column and the hover labels against the schematic.

Boards exported before this change have no pin names. Export them again.

Tests

  • npx playwright test: 173/174 passed. The failure was the known flaky timeout in interaction.spec.js:1087, which passed when run alone.
  • npm --prefix mcp test: all passed.
  • npm run test:api: passed.
  • The .il change was not run. It needs Allegro.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UCbPYsA5LYNX8HZaGGZCpK

…hrough-hole pin once (#158)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCbPYsA5LYNX8HZaGGZCpK
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-30 12:01 UTC

@Gherkin

Gherkin commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

Review round 1

Findings:

  1. web/app.js:1239 tablePads (and boardPads, mcp/src/pads.js:56) merges any two pads at one pos on one net when one is "th". It does not check for an F-only/B-only pair. A KiCad EP (smd) with a th thermal pad at its center on GND would lose a row. Not fixed: narrowing the rule is a design choice.
  2. web/app.js:1194 On boards with no names, a merged pair keeps the list place of its first pad: an old 2-pin TH Allegro export shows 1, 3, and hover on the B pad says "pad 4". Not fixed: needs a choice of numbering.
  3. .github/workflows/ci.yml:398 publish now runs on PR pushes but has no concurrency group, so two runs can race on :pr-<N> and leave the older commit. Not fixed: needs a choice of group and cancel rule.
  4. allegro-skills/exportJson.il:1610 pin number went into the JSON unescaped. Fixed with the same pcreReplace as the text export (:333). Not run: needs Allegro.
  5. mcp/src/pads.js:15,37, mcp/src/tools/net_places.js:14, mcp/src/tools/nearest.js:34, web/render.js:1138 still said Allegro exports have no pad names. Fixed.

FYI (not fixed):

  • .github/workflows/ci.yml:431 nothing deletes :pr-<N> images when a PR closes.
  • .github/workflows/ci.yml:453 every PR push now does the arm64 QEMU build of both images.
  • web/app.js:1233 tablePads is a hand copy of boardPads; they already differ (name/pin1 kept from either pad in MCP only).
  • web/app.js:1237 pad.pos.join has no guard; the rest of app.js/render.js also assumes pos, so left as is.
  • tests/browser/pad-names.spec.js:87 covers only F-"th"-first with names; no mirrored-part or unnamed-pair case.

Gherkin and others added 2 commits October 30, 2026 11:39
…ro boards have pad names

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCbPYsA5LYNX8HZaGGZCpK
…cancels the older one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCbPYsA5LYNX8HZaGGZCpK
@Gherkin

Gherkin commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

Round 1, decisions applied in 4bbdd56:

  1. Narrowed in both places: a pair is one ["F"] pad and one ["B"] pad, one "th", same net, same name if both have one. mcp/src/pads.js isPadPair, web/app.js tablePads; tests in mcp/test/net_places.test.js and tests/browser/pad-names.spec.js.
  2. Left as is.
  3. publish has concurrency: publish-${{ github.ref }}, cancel-in-progress only for pull_request (.github/workflows/ci.yml).

@Gherkin

Gherkin commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

Review round 2 (469cbf8, 4bbdd56)

No findings. The pair rule matches in mcp/src/pads.js:47 and web/app.js:1240, the new tests fail on the old rule, and the CI concurrency group is as decided.

FYI (not fixed):

  • allegro-skills/exportJson.il:1610 escapes " but not \. Same as the existing text and property escapes (:334, :1654), and pin numbers with \ are unlikely.
  • .github/workflows/ci.yml:412 with no cancel on main, GitHub still drops a waiting main run when a newer one queues, so that commit gets no :sha-* image. The code comment says so.

@Gherkin
Gherkin merged commit 2783ec3 into main Oct 30, 2026
10 checks passed
@Gherkin
Gherkin deleted the allegro-pin-names branch October 30, 2026 12:00
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.

PIN numbers don't always match source

1 participant