feat(charts): name the service on release marker hover - #2895
Conversation
🦋 Changeset detectedLatest commit: 5256985 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryHovering a release marker now opens a portaled tooltip that names every service and version represented by its annotation cluster.
Confidence Score: 4/5The PR should not merge until active annotation hover state is cleared or reconciled when the underlying marker data or geometry changes. The previously reported lifecycle defect remains: annotation layout can refresh or resize while hoveredAnnotation continues referencing and displaying the old cluster because only mouse-enter and mouse-leave events update that state. Files Needing Attention: packages/app/src/HDXMultiSeriesTimeChart.tsx
|
| Filename | Overview |
|---|---|
| packages/app/src/HDXMultiSeriesTimeChart.tsx | Integrates annotation hover state, tooltip rendering, and the Recharts hit layer, but does not reconcile an active hover when annotations or geometry change. |
| packages/app/src/components/charts/AnnotationHitLayer.tsx | Adds clustered SVG hover targets and captures a viewport anchor when the pointer enters. |
| packages/app/src/components/charts/AnnotationTooltip.tsx | Renders clustered release details through a fixed-position body portal. |
| packages/app/src/components/charts/chartAnnotations.tsx | Exposes annotation layout and preserves cluster members for rendering and tooltip content. |
| packages/app/tests/e2e/features/release-markers.spec.ts | Covers opening the marker tooltip and displaying its service and version. |
Reviews (7): Last reviewed commit: "feat(charts): name the service on releas..." | Re-trigger Greptile
Deep ReviewScope: PR #2895 — release-marker hover tooltip. 8 files, base Intent: Let a release marker name its service on hover, since colour is unresolvable once the legend overflows ✅ No critical issues found. The geometry refactor is sound: 🟡 P2 — recommended
🔵 P3 nitpicks (3)
Reviewers (10): correctness, adversarial, testing, maintainability, performance, project-standards, kieran-typescript, julik-frontend-races, agent-native, learnings-researcher. Testing gaps: No unit tests for |
d65c53c to
b8b84ab
Compare
E2E Test Results✅ All tests passed • 294 passed • 1 skipped • 1084s
Tests ran across 4 shards in parallel. |
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
b8b84ab to
bccb65c
Compare
bccb65c to
db7d363
Compare
db7d363 to
9bce2e5
Compare
9bce2e5 to
b51f8ea
Compare
Colour was the only thing tying a marker to a service, and that lookup breaks down exactly when it matters. The legend caps at 4 entries, so on a chart with more series than that a marker can be tinted to match a line whose legend entry is hidden behind "+N more" - there is nothing on screen to resolve the colour against. Collapsed clusters were worse still: "6 releases" named nobody at all. Hovering a marker now lists every release in its cluster with the service that shipped it, its version, and the time. Implementation notes: - The hit targets live in a ZIndexLayer above every other chart layer. Without that the series areas (zIndex 100) and the marker lines (400) receive the pointer first. The lines and labels are now pointer-transparent for the same reason; they are decoration and the hit layer owns the interaction. - Targets are confined to the label headroom rather than the full plot height. Covering the plot made the series tooltip fire alongside this one, and the label is the natural thing to aim at anyway. Events are never stopped, so drag-to-zoom still works underneath. - One target per cluster, spanning it, so the muted lines inside a cluster are covered by their anchor rather than intercepting it. - The tooltip is portaled and fixed-positioned, matching the series tooltip: a dashboard tile clips its overflow, so an absolutely positioned tooltip is cut off at the tile edge. Its anchor is measured from the hit band in the event handler, so nothing reads a ref during render. Layout is shared between the rendered lines and the hit layer via `layoutAnnotations`, so the hover bands can't drift from the markers they belong to.
b51f8ea to
5256985
Compare
Summary
Colour was the only thing tying a release marker to a service, and that lookup breaks down exactly when it matters. The legend caps at 4 entries (
MAX_LEGEND_ITEMS), so on a chart with more series than that a marker can be tinted to match a line whose legend entry is hidden behind "+N more" — there is nothing on screen to resolve the colour against. Collapsed clusters were worse still: "6 releases" named nobody at all.Hovering a marker now lists every release in its cluster with the service that shipped it, its version, and the time. Verified on a 6-service chart: all six named, no colour lookup needed.
Implementation notes for reviewers
Most of the work here is getting a hover target to actually receive the pointer inside a Recharts chart:
ZIndexLayerabove every other chart layer. Without that the series areas (zIndex 100) and the marker lines (400) receive the pointer first. The lines and labels are now pointer-transparent for the same reason: they are decoration, and the hit layer owns the interaction.Layout is shared between the rendered lines and the hit layer via
layoutAnnotations, so the hover bands can't drift from the markers they belong to.Stack: based on #2894 (release markers), which is based on #2893 (the source field). Review those first.
How to test on Vercel preview
Preview routes: /dashboards
Steps:
?releaseMarkers=trueto the URL.Note: markers only render if the preview's demo data carries a version attribute. Step 5 holds regardless.
https://hyperdx-oss-git-tom-release-marker-hover-hyperdx.vercel.app/dashboards/50dd68a8a37a1420?granularity=auto&from=1786546044852&to=1786718844852&releaseMarkers=true