tscircuit / circuit-to-svg

Convert tscircuit Schematic/PCB JSON ("soup") into an SVG
https://circuit-to-svg.vercel.app
4 stars 8 forks source link

If an option is enabled `shouldDrawErrors` draw trace_errors #52

Closed seveibar closed 6 days ago

seveibar commented 2 months ago

tscircuit/soup zod export for trace_error

import { point } from "src/common"
import { z } from "zod"

export const pcb_trace_error = z
  .object({
    pcb_error_id: z.string(),
    type: z.literal("pcb_error"),
    error_type: z.literal("pcb_trace_error"),
    message: z.string(),
    center: point.optional(),
    pcb_trace_id: z.string(),
    source_trace_id: z.string(),
    pcb_component_ids: z.array(z.string()),
    pcb_port_ids: z.array(z.string()),
  })
  .describe("Defines a trace error on the PCB")

export type PCBTraceErrorInput = z.input<typeof pcb_trace_error>
export type PCBTraceError = z.infer<typeof pcb_trace_error>
seveibar commented 2 months ago

Needed to fix this issue easily in tests: https://github.com/tscircuit/tscircuit/issues/330#issuecomment-2338382505

homie-gg[bot] commented 2 months ago

This might be a duplicate of: Option to render trace_error (e.g. option showErrors: true).

homie-gg[bot] commented 2 months ago

Here are some pull requests that might be helpful reference for this task:

homie-gg[bot] commented 1 month ago

This might have already been done via: updated to circuit-json and added pcb_trace_id to via.

seveibar commented 1 week ago

/bounty $40

A pcb error should be shown as a dotted red line with text indicating the error. The PCB Viewer has an example of this being here: https://pcb-viewer.vercel.app/?path=/story/traceerror--trace-error-circuit-4

However in circuit-to-svg the red text should always be visible, not just on hover

algora-pbc[bot] commented 1 week ago

## 💎 $40 bounty • tscircuit

### Steps to solve: 1. Start working: Comment /attempt #52 with your implementation plan 2. Submit work: Create a pull request including /claim #52 in the PR body to claim the bounty 3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to tscircuit/circuit-to-svg!

Add a bounty • Share on socials

Attempt Started (GMT+0) Solution
🟢 @ShiboSoftwareDev Nov 9, 2024, 5:50:48 AM #114
ShiboSoftwareDev commented 1 week ago

/attempt #52 Image now need to make this optional

@seveibar an error should only be shown when the pcb_trace_error has an array of two ports in pcb_port_ids so that it has two points to connect am I right?

Algora profile Completed bounties Tech Active attempts Options
@ShiboSoftwareDev 2 tscircuit bounties
TypeScript, JavaScript,
HTML
Cancel attempt
algora-pbc[bot] commented 6 days ago

💡 @ShiboSoftwareDev submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] commented 6 days ago

🎉🎈 @ShiboSoftwareDev has been awarded $40! 🎈🎊

ShiboSoftwareDev commented 6 days ago

closed in #114