Skip to content

Conversation

@Devesh36
Copy link

@Devesh36 Devesh36 commented Dec 12, 2025

This pull request introduces significant improvements to the SPICE simulation error handling and user experience in the schematic viewer. It adds a user-friendly error display component, a new loading state indicator, and enhances the retry logic for failed simulations. These changes make simulation errors much clearer and more actionable for users, and improve the overall UI responsiveness during simulation runs.

SPICE Simulation Error Handling and UI Improvements:

  • Added a new SpiceErrorDisplay component that categorizes SPICE errors, provides user-friendly messages, suggestions, technical details, and actions such as retry and copy error details. This replaces the previous generic error display. [1] [2]
  • Integrated the new SpiceErrorDisplay and LoadingState components into the simulation workflow, replacing plain text loading/error messages with more informative and visually appealing UI elements in SpicePlot and SpiceSimulationOverlay. [1] [2] [3]

Retry Logic and Simulation State Management:

  • Enhanced retry logic for SPICE simulations by introducing a spiceRetryCounter state and passing it to the useSpiceSimulation hook, ensuring that retries trigger a new simulation run. [1] [2] [3] [4] [5]
  • Added onRetry prop support to relevant components (SpicePlot, SpiceSimulationOverlay, SchematicViewer) to allow users to retry failed simulations directly from the UI. [1] [2] [3] [4] [5]

New Components and Exports:

  • Introduced and exported the new LoadingState and SpiceErrorDisplay components for use in other parts of the application or by consumers of the library. [1] [2]

Miscellaneous UI and Code Quality Improvements:

  • Improved UI consistency and accessibility by adding type="button" to button elements and minor style/code cleanups. [1] [2] [3]

These changes collectively provide a much better user experience when running and debugging SPICE simulations.
Screenshot 2025-12-12 at 4 58 26 PM

/fix #113

@vercel
Copy link

vercel bot commented Dec 12, 2025

@Devesh36 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

@rushabhcodes rushabhcodes left a comment

Choose a reason for hiding this comment

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

lgtm

@vercel
Copy link

vercel bot commented Dec 12, 2025

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

Project Deployment Preview Comments Updated (UTC)
schematic-viewer Ready Ready Preview Comment Dec 12, 2025 2:13pm

Copy link
Member

@imrishabh18 imrishabh18 left a comment

Choose a reason for hiding this comment

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

image

Did you even test your example? I can't see any error it is stuck at this point. Make sure you test your code before requesting reviews

@Devesh36 Devesh36 requested a review from imrishabh18 December 12, 2025 10:57
@Devesh36
Copy link
Author

image Did you even test your example? I can't see any error it is stuck at this point. Make sure you test your code before requesting reviews

apologies for inconvenience @imrishabh18 sirr

Copy link
Member

@imrishabh18 imrishabh18 left a comment

Choose a reason for hiding this comment

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

There should be example fixtures for each of the cases of error which you are trying to handle

error={spiceGenerationError}
onRetry={onRetry}
onCopyDetails={() => {
console.log("Error details copied to clipboard")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log("Error details copied to clipboard")

onRetry={onRetry}
onCopyDetails={() => {
// Optional: show toast notification when copied
console.log("Error details copied to clipboard")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log("Error details copied to clipboard")

)
setIsLoading(false)
}
}, 10000)
Copy link
Member

Choose a reason for hiding this comment

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

Make the timeout configurable

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.

improve spice sim errors

3 participants