Skip to content

fix: restore cursor date label on binary/discrete chart mouseover#4740

Draft
SylvainChevalier wants to merge 1 commit into
mainfrom
claude/issue-4737-date-is-disappearing-from-binary
Draft

fix: restore cursor date label on binary/discrete chart mouseover#4740
SylvainChevalier wants to merge 1 commit into
mainfrom
claude/issue-4737-date-is-disappearing-from-binary

Conversation

@SylvainChevalier
Copy link
Copy Markdown
Contributor

Fixes #4737

Root cause

VictoryPortal's useEffect has dependency [props.children]. When VictoryCursorContainer re-clones the portal element on each mouse move, it preserves the same children reference, so the effect never re-runs and the portal keeps rendering the stale initial cursor label (empty text at defaultCursor).

Fix

Unwrap ChartCursorLabel from VictoryPortal in numeric_chart.tsx and group_chart.tsx, matching the working pattern in multiple_choice_chart.tsx which was unaffected by the bug.

Test plan

  • Hover a binary question chart → date label follows cursor
  • Hover a discrete question chart → date label follows cursor
  • Hover a numeric/date question chart → date label follows cursor
  • Multiple choice chart still works (no regression)

Generated with Claude Code

VictoryPortal's useEffect dep `[props.children]` doesn't re-run when
VictoryCursorContainer clones the portal with new cursor props each
mouse move, so the portal kept rendering the frozen initial label
(empty text at defaultCursor) instead of updating with the hover date.

Unwrap ChartCursorLabel from VictoryPortal in numeric_chart.tsx and
group_chart.tsx, matching multiple_choice_chart.tsx which never had
the wrapper and was unaffected.

Fixes #4737

Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d47ec584-d077-4614-af86-0d2da6aa4e45

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-4737-date-is-disappearing-from-binary

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Date is disappearing from binary chart on mouseover

1 participant