Skip to content

fix: highlight same-net schematic traces on hover#185

Open
wpearce1 wants to merge 1 commit into
tscircuit:mainfrom
wpearce1:wp/same-net-trace-hover
Open

fix: highlight same-net schematic traces on hover#185
wpearce1 wants to merge 1 commit into
tscircuit:mainfrom
wpearce1:wp/same-net-trace-hover

Conversation

@wpearce1
Copy link
Copy Markdown

/claim tscircuit/tscircuit#1130
/fixes tscircuit/tscircuit#1130

Summary

Adds same-net hover highlighting for schematic traces in @tscircuit/schematic-viewer.

  • Adds useTraceNetHoverHighlight, using event delegation on the generated SVG.
  • Groups rendered schematic traces by electrical connectivity, not just the hovered DOM element:
    • explicit net ids on traces/ports
    • source_net relationships
    • shared connected source ports
    • fallback to the individual source trace when no net metadata is present
  • Highlights all visible trace paths in the hovered net and restores their original stroke/stroke-width on mouseout.
  • Skips invisible hover outlines and crossing outlines so only actual trace strokes change.
  • Adds a Cosmos fixture with multiple traces on net.VOUT and net.GND for manual verification.

Test plan

  • npm install --package-lock=false --legacy-peer-deps (local only; repo normally uses Bun but this machine does not have bun installed)
  • npx biome format .
  • npx -p typescript@^5.0.0 tsc --noEmit
  • git diff --check

Notes

The existing open PR #182 appears to group by source_trace_id; this PR goes a bit broader and unions traces by same-net metadata so separate trace segments connected through net.* labels highlight together as requested.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 11, 2026

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

Project Deployment Actions Updated (UTC)
schematic-viewer Ready Ready Preview, Comment May 11, 2026 2:07am

Request Review

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.

Change of color on hover for traces are missing

1 participant