Skip to content

fix: hide measure chart info box when cursor moves onto y-axis - #9409

Open
Di7design wants to merge 2 commits into
mainfrom
dimu/app-890-info-box-y-axis
Open

Di7design wants to merge 2 commits into
mainfrom
dimu/app-890-info-box-y-axis

Conversation

@Di7design

@Di7design Di7design commented May 7, 2026 •

Copy link
Copy Markdown

The measure 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 the index to the plot edge) and the floating tooltip stayed visible.

  • Treat any mousemove outside the plot bounds as a leave; clears the floating tooltip, the inline MeasureChartTooltip, and the top-left date readout.
  • Run scrub updates first so a drag that strays into the margins keeps tracking.

Closes APP-890

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

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>
@Di7design
Di7design requested a review from a team as a code owner May 7, 2026 04:50
@Di7design
Di7design requested a review from ericokuma May 7, 2026 04:54
@Di7design Di7design changed the title fix: hide measure chart info box when cursor moves onto y-axis App-890: fix: hide measure chart info box when cursor moves onto y-axis May 7, 2026
@Di7design Di7design changed the title App-890: fix: hide measure chart info box when cursor moves onto y-axis fix: hide measure chart info box when cursor moves onto y-axis May 7, 2026
@Di7design Di7design changed the title fix: hide measure chart info box when cursor moves onto y-axis fix: hide measure chart info box when cursor moves onto y-axis May 7, 2026
@nishantmonu51 nishantmonu51 added Type:Bug Something isn't working Area:Dashboard nit Nit Issue Type Size:S Small change: under 100 lines labels Jun 30, 2026
@AdityaHegde AdityaHegde self-assigned this Jul 7, 2026

@nishantmonu51 nishantmonu51 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area:Dashboard nit Nit Issue Type Size:S Small change: under 100 lines Type:Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants