Skip to content

highlight all same-net traces on hover#230

Open
GautamKumarOffical wants to merge 1 commit into
tscircuit:mainfrom
GautamKumarOffical:feat/trace-net-hover
Open

highlight all same-net traces on hover#230
GautamKumarOffical wants to merge 1 commit into
tscircuit:mainfrom
GautamKumarOffical:feat/trace-net-hover

Conversation

@GautamKumarOffical

Copy link
Copy Markdown

Fixes tscircuit/tscircuit#1130

Adds a useHighlightConnectedTracesOnHover hook that highlights all schematic traces on the same net when hovering any trace segment.

Changes:

  • New hook: lib/hooks/useHighlightConnectedTracesOnHover.ts
  • Integrates the hook into SchematicViewer.tsx

How it works:

  • Builds a traceId -> netId mapping from circuit JSON using union-find on shared source ports
  • Attaches mouseenter/mouseleave listeners to trace SVG elements
  • On hover, applies an amber highlight with glow effect to all traces sharing the same net
  • Cleans up listeners and styles properly on unmount

Verified:

  • bun run format:check passes
  • bunx tsc --noEmit passes
  • bun run build passes

Signed-off-by: Gautam Kumar <gautamkumarofficial@users.noreply.github.com>
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
schematic-viewer Ready Ready Preview, Comment Jun 22, 2026 4:59am

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