Skip to content

feat(pcb): single-view Schematic/Board toggle for electronics#232

Merged
ecto merged 1 commit into
mainfrom
electronics-view-toggle
Jun 4, 2026
Merged

feat(pcb): single-view Schematic/Board toggle for electronics#232
ecto merged 1 commit into
mainfrom
electronics-view-toggle

Conversation

@ecto

@ecto ecto commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Why

Building a circuit in the app surfaced a real UX problem: the 2D schematic rendered as a cramped, floating 400px overlay layered on top of an always-on 3D board — you couldn't tell which you were looking at (the 2D grid and the 3D floor grid blended together). Worse, a three-way ElectronicsLayout = split | schematic-only | pcb-only enum had toolbar toggle buttons that never gated rendering — dead controls.

What

One view at a time: Schematic or Board, flipped by a prominent top-center segmented control (and Tab). Default is Schematic — you design the circuit, then switch to Board to place + route.

  • StoreElectronicsLayout is now "schematic" | "board" (default schematic); added toggleLayout; focusedPane (which drives tool shortcuts) now tracks the visible view; dropped the dead schematicDocked + splitRatio + split state.
  • Viewport — in schematic layout, render a full-canvas opaque SchematicView (z-20) that covers the still-mounted 3D <Canvas>; in board layout it's hidden and the board shows. The board HUD / length-tune panel (z-auto) hide behind the schematic and reappear on the board for free; the place palette + view toggle (z-30) stay above either.
  • usePcbAutoFit — frame the board the first time the board view is shown (not on enter, since we now open in schematic), so toggling to Board isn't an empty camera.
  • Retired the floating SchematicOverlayPanel and the three split buttons. Net −82 lines.

Verification (live in preview)

Step Result
Enter a board ✅ opens in Schematic, full-canvas, no 3D bleed-through
Top-center toggle ✅ prominent Schematic ⇄ Board segmented control
Toggle → Board layout: board, focusedPane: pcb, 3D board framed (green slab + routed trace), HUD top-right
Toggle → Schematic ✅ round-trips, schematic full-canvas again, board hidden
tsc --noEmit + production build ✅ clean

This came directly out of dogfooding the circuit-build flow. Follow-up candidates noted while here: the onboarding "Start blank" doesn't clear an autosaved doc, and clicking a schematic pin selects the component instead of starting a wire.

🤖 Generated with Claude Code

The electronics workspace showed the 2D schematic as a cramped, floating
400px overlay layered on top of an always-on 3D board — ambiguous about
which you were looking at. And a three-way layout enum
(split/schematic-only/pcb-only) had toolbar buttons that never gated
rendering.

Replace both with a single-view model: one view at a time, schematic or
board, flipped by a prominent top-center segmented control (and Tab).

- electronics store: ElectronicsLayout is now "schematic" | "board"
  (default schematic); add toggleLayout; focusedPane tracks the view;
  drop the dead schematicDocked + splitRatio + split state
- Viewport: render a full-canvas, opaque SchematicView (z-20, covering
  the still-mounted 3D Canvas) in schematic layout; show the board in
  board layout. The board HUD / length-tune (z-auto) hide behind the
  schematic and reappear on the board; the place palette + view toggle
  (z-30) stay on top of either
- usePcbAutoFit: frame the board the first time the board view is shown
  (not on enter, since we open in schematic) so switching to Board isn't
  an empty camera
- retire the floating SchematicOverlayPanel and the 3 split buttons

Verified live: opens in schematic (full-canvas, no 3D bleed-through),
toggle to Board frames the board + shows the HUD, round-trips cleanly;
app build + tsc clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

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

4 Skipped Deployments
Project Deployment Actions Updated (UTC)
mecheval Ignored Ignored Jun 4, 2026 8:29pm
vcad Ignored Ignored Jun 4, 2026 8:29pm
vcad-docs Ignored Ignored Jun 4, 2026 8:29pm
vcad-mcp Ignored Ignored Jun 4, 2026 8: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.

1 participant