Skip to content

feat: highlight same-net traces on hover#216

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

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

Conversation

@praysimanjuntak
Copy link
Copy Markdown

@praysimanjuntak praysimanjuntak commented May 26, 2026

Summary

Adds same-net trace hover highlighting. When hovering over a trace, all other traces on the same net are highlighted, making it easier to follow signal paths through complex schematics.

Changes

  • Track net membership for each trace segment during render
  • On mouseenter, highlight all traces sharing the same net
  • On mouseleave, clear the highlight

Notes

  • Vercel preview deployed — visual behavior can be verified there
  • CI failures are infra-side (oven-sh/setup-bun action unavailable), unrelated to this change

Add useSchematicTraceHover hook that:
- Builds a trace→net group map from source_port connectivity keys,
  schematic_port→source_port chain, and geometric adjacency fallback
- On mouseenter: highlights all traces in the same net (orange glow)
  and dims all unrelated traces (opacity 0.3)
- On mouseleave: restores all traces to normal
- Injects a scoped <style> into the SVG on mount, cleans up on unmount
- No dependency on circuit-to-svg internals — works purely via
  data-schematic-trace-id DOM attributes already present in the SVG

Closes tscircuit/tscircuit#1130
@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 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 26, 2026 12:27pm

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.

1 participant