feat(#375): add hover tooltip to connections - #376
Merged
Conversation
Connection paths now render an SVG <title>, mirroring the box titles, so hovering a flow shows "<source> → <target>: <value><unit>". This lets you read individual flows into/out of nodes that have multiple connections without manually subtracting the other flows. - Connection now carries startName/endName, populated in getChildConnections (survives the state>0 filter, preserving the target association) - renderBranchConnectors renders the title as a single concatenated string - Add a DOM-level test asserting the tooltip text https://claude.ai/code/session_01VwVhfSVfk12Aj11HLKEW75
Address review findings on the connection tooltip: - Under unit_prefix: 'auto', boxes are rescaled per-box at render while the connection state stays in base units, so the tooltip showed e.g. "1800W" while the box label showed "1.8kW". Re-apply normalizeStateValue to the flow value so it matches the box (no-op for explicit prefixes). - Node names may contain intentional newlines for box labels; concatenating two of them produced an unreadable multi-line tooltip. Collapse whitespace so the flow reads on one line. Add DOM-level tests for both cases (auto-prefix value matches the box label; multi-line names collapse to a single line). https://claude.ai/code/session_01VwVhfSVfk12Aj11HLKEW75
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.
Connection paths now render an SVG <title>, mirroring the box titles, so → : ". This lets you
hovering a flow shows "
read individual flows into/out of nodes that have multiple connections
without manually subtracting the other flows.
(survives the state>0 filter, preserving the target association)
Fixes #375