feat: highlight all traces under the same net on hover (fixes #1130)#228
Open
singhaditya21 wants to merge 2 commits into
Open
feat: highlight all traces under the same net on hover (fixes #1130)#228singhaditya21 wants to merge 2 commits into
singhaditya21 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Ping @seveibar — all CI checks pass ✅. PR is ready for review! |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
traceIdToNetTraceIdsMap(memoized): builds a map from eachschematic_trace_idto all siblingschematic_trace_ids that share the samesource_trace_id(i.e. the same net).mouseover/mouseoutevent listeners on the SVG container that find the hovered trace's sibling IDs and toggle thetrace-hoveredclass on all of them at once.filter: invert(1)to explicit amber stroke (#e8a838) + soft drop-shadow on.sch-trace-pathand.sch-trace-crossing-path, so the highlight is clear and targeted without inverting the whole SVG palette.examples/example22-trace-hover-highlight.fixture.tsxfor manual browser verification: hover any segment and all segments on the same net highlight amber together.Test plan
example22-trace-hover-highlightfixture🤖 Generated with Claude Code