Skip to content

feat: allow manual editing of board size and offset via Edit Board mode#718

Open
victorjzq wants to merge 1 commit intotscircuit:mainfrom
victorjzq:fix/issue-106
Open

feat: allow manual editing of board size and offset via Edit Board mode#718
victorjzq wants to merge 1 commit intotscircuit:mainfrom
victorjzq:fix/issue-106

Conversation

@victorjzq
Copy link
Copy Markdown

/claim #106

Changes

  • Added in_edit_board_mode state to global store with "edit_board" mode in setEditMode
  • Created EditBoardOverlay component that wraps the canvas and shows a blue border + 8 resize handles when a board with explicit width/height is present
  • Dragging the board body offsets the board center; dragging any of the 8 handles resizes width/height accordingly
  • Added "Edit Board" button to ToolbarOverlay (only shown when board has explicit width/height, not an outline polygon)
  • Applied edit_pcb_board_size events locally in PCBViewer before delegating to applyEditEvents from core (core does not yet model board edit events)
  • Added edit-board.fixture.tsx demo fixture

How it works

  1. Board with explicit width/height → "Edit Board" button appears in toolbar
  2. Click "Edit Board" → blue overlay with 8 handles drawn around the board
  3. Drag center area → offsets board center (move)
  4. Drag any handle → resizes width/height while keeping opposite edge fixed

Test

All 20 existing tests pass (bun test). Build and type check clean (bun run build, npx tsc --noEmit).

…cit dimensions

When a pcb_board element has explicit width/height (no outline polygon), an
"Edit Board" button appears in the toolbar. Clicking it enters edit board mode,
which renders a blue outline with 8 resize handles around the board. Users can
drag the board body to offset its center, or drag any handle to resize width and
height. Board edit events (edit_pcb_board_size) are applied locally in
PCBViewer before delegating standard edit events to applyEditEvents from core.
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 19, 2026

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

Project Deployment Actions Updated (UTC)
pcb-viewer Ready Ready Preview, Comment Mar 19, 2026 1:17pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant