From 7ac3868e0d00d3e57dbd3e77a3fa13435ce6d20a Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 16 Oct 2026 16:42:41 +0000 Subject: [PATCH 1/3] fix: wrap long values in release marker tooltips Co-authored-by: Mike Shi --- .changeset/release-marker-tooltip-wrap.md | 5 +++ .../components/charts/AnnotationTooltip.tsx | 18 ++++++++-- .../__tests__/AnnotationTooltip.test.tsx | 35 +++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 .changeset/release-marker-tooltip-wrap.md create mode 100644 packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx diff --git a/.changeset/release-marker-tooltip-wrap.md b/.changeset/release-marker-tooltip-wrap.md new file mode 100644 index 0000000000..14da3bc9de --- /dev/null +++ b/.changeset/release-marker-tooltip-wrap.md @@ -0,0 +1,5 @@ +--- +'@hyperdx/app': patch +--- + +fix: Wrap long values in release marker tooltips instead of overflowing diff --git a/packages/app/src/components/charts/AnnotationTooltip.tsx b/packages/app/src/components/charts/AnnotationTooltip.tsx index 21c858b37a..c818b714d3 100644 --- a/packages/app/src/components/charts/AnnotationTooltip.tsx +++ b/packages/app/src/components/charts/AnnotationTooltip.tsx @@ -11,6 +11,17 @@ import { /** Gap below the marker so the tooltip does not sit on top of its own label. */ const TOOLTIP_OFFSET_PX = 6; +/** + * Release values are arbitrary attribute values — a version expression that + * concatenates several attributes easily outruns the tooltip's fixed width. + * Wrap rather than overflow: the tooltip is `pointer-events: none`, so the + * scrollbar an overflow produces can never be reached. + * + * `anywhere` rather than `break-word` because only `anywhere` shrinks the + * element's min-content width, which is what the `wrap="nowrap"` row measures. + */ +const wrapLongValue = { overflowWrap: 'anywhere' } as const; + /** * Hover tooltip for a release marker: one row per release in the hovered * cluster, each naming the service it belongs to. @@ -52,6 +63,7 @@ export function AnnotationTooltip({ hovered }: { hovered: HoveredAnnotation }) { key={member.key ?? `annotation-row-${member.x}-${i}`} gap={8} wrap="nowrap" + align="flex-start" >
{member.group != null && ( - + {member.group} )} - + {member.label} diff --git a/packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx b/packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx new file mode 100644 index 0000000000..40496325ca --- /dev/null +++ b/packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx @@ -0,0 +1,35 @@ +import { screen } from '@testing-library/react'; + +import { AnnotationTooltip } from '@/components/charts/AnnotationTooltip'; + +// A version expression that concatenates several resource attributes produces +// one long unbroken value — the case that used to overflow the fixed-width +// tooltip horizontally. +const LONG_VERSION = + 'v2.14.7-rc.3+build.20260216.a1b2c3d4e5f6-k8s-cluster-eu-west-1-canary'; +const LONG_SERVICE = 'checkout-orchestration-service-eu-west-1-canary'; + +const hovered = { + annotation: { + x: 1_700_000_000, + label: LONG_VERSION, + group: LONG_SERVICE, + color: '#437eef', + labelX: 0, + }, + point: { x: 100, y: 100 }, +}; + +describe('AnnotationTooltip', () => { + it('wraps long release values instead of overflowing the tooltip width', () => { + renderWithMantine(); + + for (const value of [LONG_VERSION, LONG_SERVICE]) { + const node = screen.getByText(value); + expect(node).not.toHaveStyle({ whiteSpace: 'nowrap' }); + // `anywhere`, not `break-word`: only `anywhere` shrinks the element's + // min-content width, which is what a `wrap="nowrap"` flex row measures. + expect(node).toHaveStyle({ overflowWrap: 'anywhere' }); + } + }); +}); From 63665fcc4f2c30a1e24d7e513cd2b6a6d4f049f5 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 16 Oct 2026 16:50:05 +0000 Subject: [PATCH 2/3] test: type the annotation tooltip fixture as HoveredAnnotation Co-authored-by: Mike Shi --- .../components/charts/__tests__/AnnotationTooltip.test.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx b/packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx index 40496325ca..b9a77e0a8d 100644 --- a/packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx +++ b/packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx @@ -1,5 +1,6 @@ import { screen } from '@testing-library/react'; +import type { HoveredAnnotation } from '@/components/charts/AnnotationHitLayer'; import { AnnotationTooltip } from '@/components/charts/AnnotationTooltip'; // A version expression that concatenates several resource attributes produces @@ -9,13 +10,13 @@ const LONG_VERSION = 'v2.14.7-rc.3+build.20260216.a1b2c3d4e5f6-k8s-cluster-eu-west-1-canary'; const LONG_SERVICE = 'checkout-orchestration-service-eu-west-1-canary'; -const hovered = { +const hovered: HoveredAnnotation = { annotation: { + time: 1_700_000_000_000, x: 1_700_000_000, label: LONG_VERSION, group: LONG_SERVICE, color: '#437eef', - labelX: 0, }, point: { x: 100, y: 100 }, }; From 3346c400e9f4bb3fa38e9774a0c5b76143069ea0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 16 Oct 2026 17:09:59 +0000 Subject: [PATCH 3/3] fix: floor the service name width and raise the release tooltip height cap Co-authored-by: Mike Shi --- .../src/components/charts/AnnotationTooltip.tsx | 16 +++++++++++++++- .../charts/__tests__/AnnotationTooltip.test.tsx | 15 +++++++++++++++ packages/app/styles/HDXLineChart.module.scss | 6 ++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/packages/app/src/components/charts/AnnotationTooltip.tsx b/packages/app/src/components/charts/AnnotationTooltip.tsx index c818b714d3..171b9e3008 100644 --- a/packages/app/src/components/charts/AnnotationTooltip.tsx +++ b/packages/app/src/components/charts/AnnotationTooltip.tsx @@ -8,6 +8,8 @@ import { useChartTooltipZIndex, } from './ChartTooltip'; +import styles from '@styles/HDXLineChart.module.scss'; + /** Gap below the marker so the tooltip does not sit on top of its own label. */ const TOOLTIP_OFFSET_PX = 6; @@ -22,6 +24,13 @@ const TOOLTIP_OFFSET_PX = 6; */ const wrapLongValue = { overflowWrap: 'anywhere' } as const; +/** + * Floor for the service name column. Both values share the row's width, so + * without this a long version wraps the service name down to a couple of + * characters per line — the one thing the tooltip exists to say. + */ +const SERVICE_MIN_WIDTH_PX = 80; + /** * Hover tooltip for a release marker: one row per release in the hovered * cluster, each naming the service it belongs to. @@ -56,6 +65,7 @@ export function AnnotationTooltip({ hovered }: { hovered: HoveredAnnotation }) { > } + contentClassName={styles.annotationTooltipContent} > {members.map((member, i) => ( @@ -77,7 +87,11 @@ export function AnnotationTooltip({ hovered }: { hovered: HoveredAnnotation }) { }} /> {member.group != null && ( - + {member.group} )} diff --git a/packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx b/packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx index b9a77e0a8d..dbd435b8f6 100644 --- a/packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx +++ b/packages/app/src/components/charts/__tests__/AnnotationTooltip.test.tsx @@ -33,4 +33,19 @@ describe('AnnotationTooltip', () => { expect(node).toHaveStyle({ overflowWrap: 'anywhere' }); } }); + + it('floors the service name width so a long version cannot squeeze it away', () => { + renderWithMantine(); + + expect(screen.getByText(LONG_SERVICE)).toHaveStyle({ minWidth: '80px' }); + }); + + it('gives the release list more height than the shared series-tooltip cap', () => { + renderWithMantine(); + + expect(screen.getByText(LONG_VERSION).closest('.chartTooltipContent')) + // Wrapped values are several lines tall, so the shared 200px cap clips a + // cluster of releases almost immediately. + .toHaveClass('annotationTooltipContent'); + }); }); diff --git a/packages/app/styles/HDXLineChart.module.scss b/packages/app/styles/HDXLineChart.module.scss index 1bf88cdd5c..f2c21ae558 100644 --- a/packages/app/styles/HDXLineChart.module.scss +++ b/packages/app/styles/HDXLineChart.module.scss @@ -92,6 +92,12 @@ overflow: hidden; } +// Release-marker tooltip only. Its values wrap over several lines each, so the +// shared cap above clips a cluster of releases almost immediately. +.annotationTooltipContent { + max-height: 500px; +} + .chartTooltipFooter { padding: 6px 12px; border-top: 1px solid var(--color-border);