Skip to content

Add Import from Schematic Image feature#300

Open
esaruoho wants to merge 2 commits intopfalstad:devfrom
esaruoho:import-from-schematic
Open

Add Import from Schematic Image feature#300
esaruoho wants to merge 2 commits intopfalstad:devfrom
esaruoho:import-from-schematic

Conversation

@esaruoho
Copy link
Copy Markdown

@esaruoho esaruoho commented Mar 5, 2026

Summary

  • Adds File > Import from Schematic Image... menu item
  • Users can upload/drop a schematic photo, screenshot, or scan
  • Calls Google Gemini Vision API directly from the browser (no server needed) to convert the image to CircuitJS1 text format
  • Shows image preview, analysis status, and generated circuit text before importing
  • API key stored in localStorage with masked display and change button
  • Error handling for invalid key, rate limits, network errors, oversized images

New file

  • ImportFromSchematicDialog.java — dialog with image picker, JSNI Gemini API call, and import button (follows ImportFromDropboxDialog pattern)

Modified files

  • Menus.java — added menu item field and File menu entry
  • CommandManager.java — added command dispatch

Test plan

  • Build with gradle compileGwt
  • Verify File menu shows "Import from Schematic Image..."
  • Click menu item, select a PNG of a simple circuit
  • Enter Gemini API key when prompted, verify it persists in localStorage
  • Click Analyze, verify circuit text appears
  • Click Import Circuit, verify circuit loads and simulates
  • Test error cases: no API key, invalid key, no image, large file (>10MB)
  • Test Change button updates the stored API key

Generated with Claude Code

@esaruoho esaruoho changed the base branch from v3-dev to dev April 15, 2026 09:50
esaruoho and others added 2 commits April 15, 2026 12:51
Adds a new File menu item that lets users upload a schematic image
(photo, screenshot, scan) and convert it to a live editable circuit
using Google Gemini API directly from the browser.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use bracket notation ["catch"] instead of .catch() since catch
is a Java reserved word that GWT's JSNI parser rejects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@esaruoho esaruoho force-pushed the import-from-schematic branch from 736ca5b to 87d0998 Compare April 15, 2026 09:51
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