Skip to content

ROX-33443: Fix interactive legend click in Victory v37#19278

Draft
sachaudh wants to merge 1 commit intodv/ROX-28622-pf-6from
sc/ROX-33443-fix-interactive-legend-click
Draft

ROX-33443: Fix interactive legend click in Victory v37#19278
sachaudh wants to merge 1 commit intodv/ROX-28622-pf-6from
sc/ROX-33443-fix-interactive-legend-click

Conversation

@sachaudh
Copy link
Contributor

@sachaudh sachaudh commented Mar 3, 2026

Description

Jira: ROX-33443

Victory v37 (PF charts v8) broke getInteractiveLegendEvents -- the onLegendClick callback passed through Chart's events prop is never invoked. This PR works around the issue by attaching click events directly to the ChartLegend component.

  • Apply click events directly to ChartLegend via its events prop, bypassing the broken Chart-level event propagation
  • Fix chartNames ordering to match legend item indices (was using Object.values() which followed object declaration order instead of the array order used by the legend)
  • Add name prop to ChartBar components so the interactive legend can target chart children for hover effects
  • Unskip the component test for severity toggling and remove stale version pin comment

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

  • Verified severity toggling works by clicking legend items in the dashboard widget
  • Ran component test: all 3 specs pass, including the previously skipped toggling test

Screenshots

Before After

Victory v37 (PF charts v8) broke getInteractiveLegendEvents -- the
onLegendClick callback passed through Chart's events prop is never
invoked. Work around this by attaching click events directly to the
ChartLegend component instead.

Also fixes chartNames ordering to match legend item indices and adds
name props to ChartBar for correct hover muting behavior.

Partially generated by AI.

Signed-off-by: Saif Chaudhry <schaudhr@redhat.com>
@openshift-ci
Copy link

openshift-ci bot commented Mar 3, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@rhacs-bot
Copy link
Contributor

Images are ready for the commit at f801627.

To use with deploy scripts, first export MAIN_IMAGE_TAG=4.11.x-235-gf801627105.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants