Tooltip Index Overlay#428
Merged
camdnnn merged 16 commits intoApr 11, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Graph2D “index overlay” by replacing the prior text-based cursor/index overlay with a tooltip-styled DOM overlay component, and wires it into the main Graph2D rendering flow.
Changes:
- Introduces
IndexOverlayto render an index line, dots, and a tooltip-styled overlay. - Removes the old cursor overlay styling and updates Graph2D to use the new overlay.
- Minor formatting-only change in
chartOptions.ts.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
frontend/src/components/graph2D/indexOverlay/IndexOverlay.tsx |
New overlay implementation and replay-driven DOM updates. |
frontend/src/components/graph2D/indexOverlay/IndexOverlay.module.scss |
Styles for the new index line/dots/tooltip overlay. |
frontend/src/components/graph2D/graph2D.tsx |
Switches Graph2D from CursorOverlay to IndexOverlay. |
frontend/src/components/graph2D/cursorOverlay/CursorOverlay.module.scss |
Removes old cursor overlay styles. |
frontend/src/components/graph2D/chartOptions.ts |
No functional change (formatting only). |
Comments suppressed due to low confidence (3)
frontend/src/components/graph2D/indexOverlay/IndexOverlay.tsx:63
updateIndexDomreturns early whenxValueisnull/undefined, but it doesn't hide/reset the overlay DOM.ReplayControllercan emit aProgressevent withcurrentIndex === data.length(end-of-playback), which makesxData[index]undefined and leaves the last overlay state stuck on screen. Consider clamping the index toxData.length - 1(or explicitly hiding the line/dots/tooltip when the index is out of bounds).
frontend/src/components/graph2D/indexOverlay/IndexOverlay.tsx:116tooltipEl.innerHTML = ...interpolatesxAxis.label,yAxis.label, andseriesNamesdirectly into HTML. If any of those values can originate from user/config input, this is an XSS vector. Prefer constructing the tooltip DOM withdocument.createElement+textContent(or at minimum HTML-escape the interpolated strings) instead of assigninginnerHTML.
frontend/src/components/graph2D/indexOverlay/IndexOverlay.tsx:136updateGridRectonly handles numericgrid.left/right/top/bottomvalues and falls back to hard-coded defaults otherwise. SincechartOptionsallows callers to overridegridwith percentages/strings, the overlay can become misaligned. Consider supporting string values (e.g., percentage of width/height) or deriving the grid rect from the chart model/coordinate system instead of re-parsing options.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gr812b
requested changes
Apr 2, 2026
Owner
gr812b
left a comment
There was a problem hiding this comment.
Does the line still go out of the box or is that fixed?
Collaborator
Author
Not fixed in this PR but I did make an issue for it #427 |
…ttps://github.com/gr812b/CVT-Simulator into 423-feature-replace-graph-overlay-text-with-tooltip
This was
linked to
issues
Apr 4, 2026
gr812b
approved these changes
Apr 11, 2026
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.
Description
Replaced the existing text based index values overlay with a new one matching the style of the tooltip
Changes
List the main changes made in this PR:
Screenshots (if applicable)
