Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/preview route #179

Merged
merged 28 commits into from
Nov 16, 2024
Merged

/preview route #179

merged 28 commits into from
Nov 16, 2024

Conversation

mrudulpatil18
Copy link
Contributor

Issue: #171

Changes:

  • Added a /preview route
  • created a preview page to view the <PreviewContent> component
  • modified the sidebar to allow copying embed code acc to this route

/claim #171

cc: @seveibar

Copy link

vercel bot commented Nov 9, 2024

@mrudulpatil18 is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent, can you add a playwright test that shows that it works (and prevents others from breaking it?)

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok- so there's a bit of an issue. You should not have to run the code in the iframe, we should be loading circuit json that is precompiled. I believe snippet.circuit_json can be used to get precompiled circuit json code (if not, we will want to introduce snippet.circuit_json)

Basically if someone wants to embed a circuit on their website, their users shouldn't have to hit run.

@mrudulpatil18
Copy link
Contributor Author

@seveibar can you please take a look at the changes. Lots of changes through this PR:

  • now uses snippet.circuit_json for /preview route
  • can add &view parameter to url with values "pcb", "3d" and "schematic"
  • defaults to pcb view if not mentioned
  • added circuit_json in seed.js to allow fake-snippets db tests

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work

seveibar and others added 6 commits November 15, 2024 12:32
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…#219)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…it#224)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

3 participants