Skip to content

Move Components picker ignores selected layer and visibility toggles #757

@gsdali

Description

@gsdali

Summary

The Move Components picker (EditPlacementOverlay) picks up any component under the cursor, regardless of the currently selected copper layer or the View-menu visibility toggles. With "bottom" selected in the layer dropdown and "Show Top Components" toggled off, you can still grab a top-side component by clicking through the now-empty space — but you can't see what you grabbed, and dragging silently moves a component on the wrong side.

Repro

  1. Open a 2-layer board with components on both top and bottom.
  2. Layer dropdown → "bottom".
  3. View ▼ → uncheck "Show Top Components".
  4. Click "Move Components".
  5. Click on the empty area where a top-side chip used to be (or anywhere — the hit area is the bounding box, padded).
  6. → A red highlight appears on a hidden top-side component, and dragging moves it.

Expected

The picker should respect:

  • the selected copper layer (don't pick a component on the layer that isn't selected), and
  • the visibility toggles (don't pick a component you've explicitly hidden).

Through-hole / via components (which have no layer because they exist on both sides) should remain pickable regardless.

Cause

src/components/EditPlacementOverlay.tsx iterates soup in two places — the onMouseDown click loop and the absolutely-positioned hit-area <div>s — and only tests e.type === "pcb_component" plus a bounding-box hit-test. No layer or visibility check.

Fix

PR coming (stacked on the visibility-toggles feature #756 since that's where is_showing_top_components / is_showing_bottom_components come from). Adds an isPickable() guard used at both call sites that filters by layer and by visibility toggles.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions