Skip to content

feat: highlight same-net traces on hover#203

Open
fabicholas wants to merge 1 commit into
tscircuit:mainfrom
fabicholas:feat/highlight-same-net-traces-on-hover
Open

feat: highlight same-net traces on hover#203
fabicholas wants to merge 1 commit into
tscircuit:mainfrom
fabicholas:feat/highlight-same-net-traces-on-hover

Conversation

@fabicholas
Copy link
Copy Markdown

@fabicholas fabicholas commented May 20, 2026

Summary

Closes tscircuit/tscircuit#1130

When hovering over a schematic trace, all traces that share the same electrical net are now highlighted in orange.

How it works

  • Added useSchematicTraceHover hook (lib/hooks/useSchematicTraceHover.ts) that attaches mouseover/mouseleave listeners via event delegation on the SVG container div
  • On hover, the hook reads data-subcircuit-connectivity-map-key from the hovered trace group to identify the net, then adds a trace-net-highlighted CSS class to all trace groups sharing that net key
  • Falls back to highlighting just the hovered trace if no net key is present
  • The highlight color (#e8a020 orange) is applied via CSS !important to override SVG presentation attributes on path elements (excluding the invisible hover outline) and circle.trace-junction elements
  • The existing trace-invisible-hover-outline (8× stroke-width transparent path) provides a generous hit area for hover detection

Files changed

  • lib/hooks/useSchematicTraceHover.ts — new hook
  • lib/components/SchematicViewer.tsx — wires up the hook and injects the highlight CSS

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 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 20, 2026 3:20am

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