Add Run Style Analysis context-menu command with SVG results - #273
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Run Style Analysis to the schematic right-click menu. Selecting it snapshots the current Circuit JSON and opens a scrollable modal containing one annotated SVG per placement/style issue across all sheets. Close and rerun to analyze the updated circuit.
The browser imports the standalone analyzer from
https://jscdn.tscircuit.com/@tscircuit/circuit-json-schematic-placement-analysis/latest/dist/browser.jsonly when the command runs. The analyzer is not bundled with the viewer or application. Vite/Webpack ignore annotations preserve the external URL import. The local analyzer dependency is development-only for real-result tests.The modal includes loading, empty, and CDN/analysis failure states, with focus trapping and Escape/Close dismissal. SVGs are images and Circuit JSON stays local.
latestfollows the latest published release subject to the CDN’s ten-minute cache; browsers reuse the imported module until page reload. Hosts must permit the jscdn script origin in CSP. Analysis executes synchronously after loading.Release prerequisite: merge and publish tscircuit/circuit-json-schematic-placement-analysis#66 first. The CDN URL currently returns 404 until that release. Runtime dependency fix #65 is already merged upstream.
Includes
example36-style-analysisCosmos fixture with overlapping resistors.Validation:
bun test: 30 pass, including real issue SVGs, changed-circuit reruns, no issues, and dismissible CDN failures (network import mocked in tests).