Skip to content

feat: highlight all traces under the same net on hover (fixes #1130)#228

Open
singhaditya21 wants to merge 2 commits into
tscircuit:mainfrom
singhaditya21:feat/trace-hover-1130
Open

feat: highlight all traces under the same net on hover (fixes #1130)#228
singhaditya21 wants to merge 2 commits into
tscircuit:mainfrom
singhaditya21:feat/trace-hover-1130

Conversation

@singhaditya21

@singhaditya21 singhaditya21 commented Jun 19, 2026

Copy link
Copy Markdown

Summary

When hovering over a trace in the schematic viewer, all traces on the same net should change color/highlight together. Previously no highlighting occurred. This PR implements that behavior.

Fixes tscircuit/tscircuit#1130

Changes

  • Added traceIdToNetTraceIdsMap (memoized): builds a map from each schematic_trace_id to all sibling schematic_trace_ids that share the same source_trace_id (i.e. the same net).
  • Added delegated mouseover/mouseout event listeners on the SVG container that find the hovered trace's sibling IDs and toggle the trace-hovered class on all of them at once.
  • Changed hover CSS from filter: invert(1) to explicit amber stroke (#e8a838) + soft drop-shadow on .sch-trace-path and .sch-trace-crossing-path, so the highlight is clear and targeted without inverting the whole SVG palette.
  • Added examples/example22-trace-hover-highlight.fixture.tsx for manual browser verification: hover any segment and all segments on the same net highlight amber together.

Test plan

  • Open Cosmos at example22-trace-hover-highlight fixture
  • Hover the trace connecting R1→R2 — both trace segments belonging to that net turn amber
  • Hover the trace connecting R2→C1 — only that segment highlights; R1→R2 net stays unchanged
  • Mouse-out clears all highlights immediately
  • No regressions on existing fixtures

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 19, 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 26, 2026 4:19pm

Request Review

@AdityaSinghBiztech

Copy link
Copy Markdown

Ping @seveibar — all CI checks pass ✅. PR is ready for review!

@singhaditya21

Copy link
Copy Markdown
Author

This PR implements the trace hover highlighting requested in tscircuit/tscircuit#1130. All CI checks pass.

/claim tscircuit/tscircuit#1130

… add fixture

- Replace `filter: invert(1)` with explicit amber (#e8a838) stroke color
  and a soft drop-shadow so hovered net traces stand out clearly without
  inverting the entire SVG color palette.
- Add example22-trace-hover-highlight.fixture.tsx to demonstrate the
  same-net trace grouping behavior for manual/browser verification.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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

2 participants