Repository navigation
fix: wrap long values in release marker tooltips #3391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7ac3868
63665fc
3346c40
c2e006d
bae04f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@hyperdx/app': patch | ||
| --- | ||
|
|
||
| fix: Wrap long values in release marker tooltips instead of overflowing |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| 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 | ||
| // 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: HoveredAnnotation = { | ||
| annotation: { | ||
| time: 1_700_000_000_000, | ||
| x: 1_700_000_000, | ||
| label: LONG_VERSION, | ||
| group: LONG_SERVICE, | ||
| color: '#437eef', | ||
| }, | ||
| point: { x: 100, y: 100 }, | ||
| }; | ||
|
|
||
| describe('AnnotationTooltip', () => { | ||
| it('wraps long release values instead of overflowing the tooltip width', () => { | ||
| renderWithMantine(<AnnotationTooltip hovered={hovered} />); | ||
|
|
||
| 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' }); | ||
| } | ||
| }); | ||
|
|
||
| it('floors the service name width so a long version cannot squeeze it away', () => { | ||
| renderWithMantine(<AnnotationTooltip hovered={hovered} />); | ||
|
|
||
| expect(screen.getByText(LONG_SERVICE)).toHaveStyle({ minWidth: '80px' }); | ||
| }); | ||
|
|
||
| it('gives the release list more height than the shared series-tooltip cap', () => { | ||
| renderWithMantine(<AnnotationTooltip hovered={hovered} />); | ||
|
|
||
| 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'); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 major — Releases past 500px still sit behind a scrollbar nobody can reach
Nothing blocks merge automatically, but a maintainer will expect this fixed if it is a real defect in code this PR changes. If it is about surrounding code, reply and say so instead of patching. Do not widen the PR. How to respond
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Separate fix - and it would be annoying.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — Release tooltip still gets a scrollbar the pointer can't reach once content passes 500px
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond |
||
| max-height: 500px; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — Fixed 500px cap ignores viewport height for a tooltip that never flips The tooltip is Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — 500px tooltip opens below the marker with no viewport clamp
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond |
||
| } | ||
|
|
||
| .chartTooltipFooter { | ||
| padding: 6px 12px; | ||
| border-top: 1px solid var(--color-border); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔵 minor —
minWidthset via rawstyleinstead of a Mantine style propThe Repository conventions say to prefer individual Mantine style props over raw styles. Use
miw={SERVICE_MIN_WIDTH_PX}on theTextand keep onlyoverflowWrapinstyle, since Mantine has no style prop for it.Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond