12 Commits

Author SHA1 Message Date
Kyle 82d8570767 Add formboard harness layout designer
Separate read-only canvas for physically laying out wire harnesses.
Syncs connectors from the main diagram (one-way), no changes flow back.

Backend:
- FormboardLayout, FormboardNode, FormboardSegment models
- /api/formboard/ router: get/create layout, sync connectors from diagram,
  full CRUD for nodes and segments

Frontend (formboard.js):
- Konva canvas: drag nodes, click-to-connect segments, zoom/pan
- Node types: Connector (blue rect, synced from diagram), Branch (green
  circle, manual), Splice/joint (orange diamond, manual)
- Segments scale thickness by wire count; fitting overlays for open,
  split loom, conduit, heat shrink, tape wrap
- Right-click context menu for delete on nodes/segments

App integration:
- "⊞ Formboard" tab in view-tab-bar (distinct color, independent of views)
- Sub-toolbar: Select / Branch / Splice / Connect / Sync / Fit / Delete
- Right panel swaps to formboard props when active:
  - Node: label, notes, linked device info
  - Segment: fitting type, fitting color, label, length, wire checklist
    (checkboxes for every wire in the main diagram)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 07:18:43 -04:00
Kyle 0bbcaa8ee5 Scope git history to current diagram by default
- History panel defaults to "This diagram" / "All" toggle
- "This diagram" filters git log to commits that touched only that
  diagram's JSON file (git log -- diagrams/0001_*.json)
- Automatically switches to "All" when no diagram is open
- Restore flow still works per-commit, per-file

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 20:07:05 -04:00
Kyle 072e620d56 Scope git commit to current diagram + fix complete JSON export/import
- Git commit: "Current diagram only" checkbox stages only that diagram's
  JSON file instead of all diagrams
- JSON export now includes: waypoints, twisted_pair, twist_pitch, shielded,
  show_size_label, bundle_id, bundle_label, sheet_id, sheets, wire_bundles
- JSON import reconstructs sheets and bundles with remapped IDs so restored
  diagrams are exact copies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 20:02:19 -04:00
Kyle 7c701c7d9c Fix git modal not appearing (missing position:fixed in CSS selector) 2026-04-24 19:52:48 -04:00
Kyle 01e7b5630b Add git version control panel and LAN hosting support
- Git modal (⎇ Git button): commit all diagrams as JSON to diagrams/ folder,
  push to remote, view history, restore any diagram from any past commit
- Diagrams exported to diagrams/{id}_{name}.json on each commit so diffs are
  human-readable and individual diagrams can be restored independently
- backend/run.py: changed host to 0.0.0.0 for LAN access

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 19:48:29 -04:00
Kyle e4a80dc0e6 Add views, import/duplicate, DRC, jumps toggle, multi-wire select, auto-route, delete view tabs
- Roadmap #22: File→Import JSON to restore a diagram (drag-drop or file picker)
- Roadmap #23: Duplicate diagram from diagram list
- Roadmap #24: DRC panel with collapsible categories (unconnected pins, dup refs, no length, no P/N)
- Multi-view tabs: named views per diagram with independent device/wire layouts; snapshot-on-entry prevents bleed
- Keyboard arrow nudge for selected device(s)
- Undo for move, duplicate, label/property changes
- Wire jump arcs toggle (⌒ Jumps button in toolbar)
- Shift+click multi-wire selection; right-click bulk clear waypoints or auto-route
- Auto-route: obstacle-avoiding ortho routing for single or bulk selected wires
- Delete view tab with × button; right-click context menu for rename/delete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 19:18:39 -04:00
Kyle f43cd3409c Fix undo gaps and add right-click menu items 16-20
Undo fixes:
- Move undo now redraws deviceLayer so devices visually snap back
- Label, reference, gauge, color, and all wire/device property changes are now undoable
- Duplicate and paste are now undoable (deletes cloned devices on Ctrl+Z)

Right-click menu additions (roadmap 16-20):
- Align & distribute: left/right/top/bottom edges, H/V spacing for multi-select
- Bring to front / Send to back via zOrder in device.properties
- Copy/paste wire style (color, gauge, stripe, twisted pair, shielded)
- Select all wires on net highlights every wire sharing the same label
- Lock device: prevents moves, shows padlock badge, persists across refresh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 17:19:45 -04:00
Kyle f958027528 Render stripe as solid 1px center line (1/3 wire width)
Replaces tick marks with a solid stripe line following the wire path
at strokeWidth=1 (main wire is 3px), centered on the wire body.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 15:07:07 -04:00
Kyle 353a2cb2ef Render stripe as perpendicular tick marks along wire path
Replaces the helix-based stripe (which looked like a squiggling twisted
pair) with short perpendicular tick marks centered on the wire body,
spaced every 8px. This gives the characteristic slash/stripe appearance
of real striped wire, contained within the wire width.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 15:04:38 -04:00
Kyle e8905d312e Render striped wires as a helix instead of dashes
Stripe color is now drawn as a single spiral wrapping around the solid
wire body (using the same quadratic-bezier helix as twisted pair) rather
than a dashed overlay. Pitch is fixed at 20px for stripes. Updated all
three rendering paths: _renderWire, _recomputeJumps, _redrawWiresFor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 15:00:12 -04:00
Kyle 0e507a95d3 Fix wire property persistence and enable server auto-reload
Wire options (twisted pair, shielded, stripe, bundle) were not
persisting because the backend server had stale Python modules loaded
from before the WireUpdate schema was updated with these fields.
Pydantic silently ignored unrecognized fields, so only pre-existing
fields like color_stripe were saved.

Frontend fixes applied alongside the schema work:
- _patchWire now shows visible error on save failure instead of
  swallowing errors and falsely flashing Saved
- Bundle dropdown rebuild is guarded with _updatingBundleDropdown flag
  to prevent spurious change events from triggering unwanted PATCHes
- Enable uvicorn reload=True so server auto-restarts on code changes,
  preventing stale module issues in the future

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 14:57:36 -04:00
Kyle f32203b630 Initial commit — wiring diagram maker with full feature set
- FastAPI + SQLite backend with routers for diagrams, devices, wires,
  bundles, connectors, export, and Octopart/Nexar search
- Konva.js canvas: ortho/direct/curved routing, wire crossings, harness
  mode, snap-to-grid, multi-select, drag, resize, undo
- Wire features: color/stripe, twisted pair helix, shielded glow,
  gauge size label, multi-core bundle grouping, length/unit tracking
- Device library: connector, terminal block, cable, splice, label, group,
  relay, fuse, switch, component with custom connector support
- Exports: BOM CSV, assembly TXT, JSON, formboard layout, PNG image
- Auto-migration for schema changes via ALTER TABLE at startup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 12:51:21 -04:00