Repository navigation
Conversation
The chart's `<svg>` extends into the right margin where y-axis labels render, so `onmouseleave` never fires when the cursor crosses from the plot onto a label. The mousemove handler kept `hoverState.isHovered` true (with `clampX` pinning to the plot edge) and the floating tooltip stayed visible. Treat any mousemove outside the plot bounds as a leave so the tooltip, inline tooltip, and date readout all clear. Scrub updates still run first, so a drag that strays into the margins keeps tracking. Closes [APP-890](https://linear.app/rilldata/issue/APP-890/info-box-stays-visible-after-cursor-moves-off-chart-onto-y-axis) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nishantmonu51
left a comment
There was a problem hiding this comment.
The branch is 431 commits behind main and this hunk conflicts textually with it (the aria-label i18n change plus the scrubController guard), so it needs a rebase before it can merge.
main has not made the fix redundant: its handler still sets hoverState.isHovered = true on every mousemove with no plot-bounds check, so the y-axis tooltip bug is still present there. Note also that the early return hides the tooltip over the x-axis labels in the bottom margin as well, which the PR body states is intended.
| onmousemove={(e) => { | ||
| const x = clampX(e.offsetX); | ||
| const fractionalIndex = xScale.invert(x); | ||
| const isScrubbingNow = get(scrubController.state).isScrubbing; |
There was a problem hiding this comment.
main has since made this prop optional — export let scrubController: ScrubController | undefined = undefined — and guards this same branch with scrubController && get(scrubController.state).isScrubbing, because ScreenshotContainer.svelte:163 renders MeasureChart without a controller and MeasureChart.svelte:381 forwards that undefined down. Hoisting the unguarded dereference to the top of the handler means that if this hunk's conflict is resolved by taking the PR side, svelte-check fails on the possibly-undefined access and, at runtime, any mousemove over a controller-less chart throws before the tooltip logic runs. Keep the scrubController && guard (or use scrubController?.state) when rebasing.
The measure chart's
<svg>extends into the right margin where y-axis labels render, soonmouseleavenever fires when the cursor crosses from the plot onto a label. The mousemove handler kepthoverState.isHoveredtrue (withclampXpinning the index to the plot edge) and the floating tooltip stayed visible.MeasureChartTooltip, and the top-left date readout.Closes APP-890
Checklist:
Developed in collaboration with Claude Code