Skip to content

feat: highlight all traces in same net on hover#171

Open
ysdy823 wants to merge 1 commit intotscircuit:mainfrom
ysdy823:fix-trace-hover-color-1130
Open

feat: highlight all traces in same net on hover#171
ysdy823 wants to merge 1 commit intotscircuit:mainfrom
ysdy823:fix-trace-hover-color-1130

Conversation

@ysdy823
Copy link
Copy Markdown

@ysdy823 ysdy823 commented Mar 29, 2026

Summary

  • Adds useTraceNetHighlighting hook that highlights all schematic traces in the same net when hovering over any trace
  • Uses union-find to group traces by connected source ports, building net groups from circuit JSON
  • On mouseenter, changes stroke color to #60a5fa (blue) for all traces in the same net; restores on mouseleave
  • Properly cleans up event listeners on unmount and re-attaches on SVG DOM mutations

Fixes tscircuit/tscircuit#1130

/claim #1130

Test plan

  • Open a schematic with multiple traces in the same net
  • Hover over one trace and verify all traces in the same net highlight blue
  • Move mouse away and verify colors restore to original
  • Verify traces in different nets do not highlight together
  • Verify no console errors on mount/unmount cycles

🤖 Generated with Claude Code

When hovering over a schematic trace, all traces sharing the same net
now highlight together with a blue (#60a5fa) color change. This uses a
union-find algorithm to group traces by their connected source ports,
then applies mouseenter/mouseleave listeners to coordinate highlighting.

Fixes tscircuit/tscircuit#1130

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

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

Project Deployment Actions Updated (UTC)
schematic-viewer Ready Ready Preview, Comment Mar 29, 2026 7:47am

Request Review

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.

Change of color on hover for traces are missing

1 participant