Skip to content

Respect selected layer and visibility in Move Components picker#882

Open
anil08607 wants to merge 1 commit into
tscircuit:mainfrom
anil08607:move-components
Open

Respect selected layer and visibility in Move Components picker#882
anil08607 wants to merge 1 commit into
tscircuit:mainfrom
anil08607:move-components

Conversation

@anil08607
Copy link
Copy Markdown

Summary

Fixes the Move Components picker so it only selects components that should be interactable in the current view.

The picker now:

  • respects the selected copper layer when deciding which component can be picked
  • respects top/bottom component visibility state when that state is provided
  • keeps layerless / through-hole style components pickable from either side

Changes

  • added a small shared predicate for component pickability
  • updated EditPlacementOverlay to filter hit-test candidates before starting a drag
  • replaced the previous loose store access with explicit typed store state for top/bottom component visibility
  • cleaned up the overlay logic with a named selector and named hit-padding constant

Testing

  • bun test tests/lib/should-pick-pcb-component.test.ts
  • targeted tsc --noEmit on the touched files

Notes

  • layerless components are still treated as side-agnostic so through-hole parts remain movable
  • top/bottom component visibility defaults to true, so existing consumers keep current behavior unless they explicitly control those flags

close #757

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

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

Project Deployment Actions Updated (UTC)
pcb-viewer Ready Ready Preview, Comment May 23, 2026 3:29pm

Request Review

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.

Move Components picker ignores selected layer and visibility toggles

1 participant