Skip to content

Fix hover flicker on Runs by status chart#4179

Draft
claude[bot] wants to merge 1 commit into
mainfrom
fix/runs-status-chart-hover-flicker
Draft

Fix hover flicker on Runs by status chart#4179
claude[bot] wants to merge 1 commit into
mainfrom
fix/runs-status-chart-hover-flicker

Conversation

@claude

@claude claude Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Requested by Eric Allam · Slack thread

✅ Checklist

  • I have followed every step in the contributing guide
  • The PR title follows the convention.
  • I ran and tested the code works

Testing

Open a dashboard chart that uses the shared stacked bar primitive (e.g. "Runs by status") and move the mouse across it.

  • Before: the bars strobe between bright and dim while the cursor moves across the chart.
  • After: the hovered series stays highlighted and the other series stay smoothly dimmed with no flicker; leaving the chart entirely restores all bars to full brightness.

Changelog

Fixed a hover flicker on the shared bar chart primitive (ChartBar.tsx).

Each <Bar> had an onMouseLeave={highlight.reset} handler. As the cursor crossed from one series to the next, recharts fired the old bar's onMouseLeave (resetting the active key to null, so every bar snapped bright) immediately before the new bar's onMouseEnter (which re-dimmed the others). That rapid null → key → null churn during normal mouse movement was the strobe.

How: Removed the per-<Bar> onMouseLeave={highlight.reset} in apps/webapp/app/components/primitives/charts/ChartBar.tsx. Moving between bars now only updates the active key via onMouseEnter, with no intermediate reset. The existing chart-level onMouseLeave (handleMouseLeave, which calls highlight.reset) still clears the highlight when the cursor leaves the whole chart, so exit behavior is unchanged. The legend is unaffected because it uses its own onMouseEnter/onMouseLeave handlers.


Screenshots

[Screenshots]

💯


Generated by Claude Code

Moving the mouse across the stacked bar chart caused the bars to strobe
between bright and dim. Each <Bar> had an onMouseLeave that reset the
highlight state, so crossing from one series to the next fired
leave (activeBarKey → null, all bars bright) before the next bar's enter
(activeBarKey → new key, others dim). That null→key churn produced the
flicker.

Remove the per-Bar onMouseLeave. Moving between bars now only updates the
active key via onMouseEnter, and the existing chart-level onMouseLeave
(handleMouseLeave, which calls highlight.reset) still clears the highlight
when the cursor leaves the whole chart. Legend hover is unaffected — it
uses its own onMouseEnter/onMouseLeave handlers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018wP95TbXaujzKBnDJbCD7u
@changeset-bot

changeset-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: c007a86

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants