Skip to content

A part clicked in the net pane becomes the selected part (#148) - #149

Merged
Gherkin merged 5 commits into
mainfrom
net-pane-click-selects-part
Oct 28, 2026
Merged

Gherkin merged 5 commits into
mainfrom
net-pane-click-selects-part

Conversation

@Gherkin

@Gherkin Gherkin commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Closes #148.

A part clicked in the net pane was shown there, but never became the selected part. The main detail pane, the component list and the address bar kept the part selected before it, so the panes disagreed.

The steps in the issue do not show it, because picking a net clears the selected part. It shows when the net is picked first, then a part X, and then a part Y is clicked in the net pane.

Now:

  • The first click on Y pins Y and makes it the selected part. Both detail panes, the list and the address bar show Y. X stays pinned.
  • The second click unpins Y and selects X again, if X is still pinned. Otherwise nothing is selected and the panes close.

Only one step back is kept: X › Y › Z, then Z off gives Y, then Y off gives nothing.

Tests: three new tests in interaction.spec.js. Two of them fail without the fix. Full suite: 163 passed. One known flaky test ("an inner layer checkbox changes both sides") timed out in the full run and passed alone.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UCbPYsA5LYNX8HZaGGZCpK

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-28 07:38 UTC

@Gherkin

Gherkin commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

Review round 1 (10 findings)

Fixed:

  • web/app.js:967 Unpinning a part that is not the selected part hid the net pane detail while the selection stayed. Now it only drops the pin.
  • web/app.js:966 Unpinning any other part cleared the saved part. Now it is only read when the selected part comes off.
  • web/app.js:25 The saved part was not cleared by other selection paths (list, canvas, breadcrumbs, selectNet). Now selectFootprint, deselectFootprint and selectNet clear it, and the net pane click sets it after selectFootprint.
  • web/app.js:976 Pinning a part that was already selected kept an old saved part. Fixed by the same change.
  • web/app.js:967 In the restore branch the net pane detail was hidden and then drawn again. Hide moved into the else branch.
  • tests/browser/interaction.spec.js:386 findIndex gave -1 and the test would time out. Added an assert.
  • tests/browser/interaction.spec.js:425 No test for unpinning a part that is not selected. Added one; it fails on the old code.

Not fixed:

  • web/app.js:961 Only the net pane gives the selection back. The list (:641) and canvas (:1391) still clear it. Making all paths agree is a design choice.
  • web/app.js:965 selectionRegistry already keeps pin order. Using it would give full history instead of one step. Same design choice as above.
  • web/app.js:977 A click rebuilds the net list and redraws twice (togglePinComponent and then selectFootprint). That was there before this PR, and the cost is small.

Gherkin and others added 3 commits October 28, 2026 07:28
The saved part is now cleared by every other selection path, and is
only used when the selected part comes off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCbPYsA5LYNX8HZaGGZCpK
A second click on the selected part, in the component list, the net
pane or on the board, takes its pin off and selects the part before it
again, if that part is still pinned. The three click paths now share
clickFootprint, so they behave the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCbPYsA5LYNX8HZaGGZCpK
Wherever the pin comes off (list, net pane, board, or Esc), the net
pane detail no longer shows that part.

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

Gherkin commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

Review round 2 (commits 6390e78, dc3ea6d, ac56140; 1 finding)

Fixed:

  • tests/browser/interaction.spec.js:476 nth(1) times out if the net has fewer than two parts. Added a count assert.

Not fixed (FYI):

  • web/app.js:963 After a give-back in the net pane, the net pane detail shows the restored part even when it is not on the net. This was already in round 1. Changing what that pane shows is a design choice.
  • web/app.js:1911 Arrow keys call togglePinComponent on every step, so arrowing onto a pinned part unpins it. Same on main, not from this PR.
  • web/app.js:894 selectNet does not clear the net pane detail, so a part from the last net can stay shown. Same on main.
  • web/app.js:1058 Each click rebuilds the lists twice. Noted in round 1, small cost.

Checked and not a bug: one-step give-back and "only if still pinned" are the stated design.

@Gherkin
Gherkin merged commit dcfa229 into main Oct 28, 2026
10 checks passed
@Gherkin
Gherkin deleted the net-pane-click-selects-part branch October 28, 2026 07:38
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.

Unpinning a part in the net pane closes the detail pane while another part is selected

1 participant