You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[WC-3612]: Fix axis title config shape in charts - #2470
Bug fix (non-breaking change which fixes an issue)
Description
Fixes the axis title structure in the generated chart layout configuration, so axis titles are passed through as { text: "..." } instead of being wrapped an extra level.
Adds unit tests covering the shape of the generated layout, config and series options.
What should be covered while testing?
Set X-axis and Y-axis labels on a chart widget and verify they render correctly.
Verify charts without axis labels still render as before.
CI checks: could not fetch automatically — please confirm all checks pass before merging.
Findings
⚠️ Low — Missing CHANGELOG entries for bubble-chart-web and line-chart-web
Files:packages/pluggableWidgets/bubble-chart-web/CHANGELOG.md, packages/pluggableWidgets/line-chart-web/CHANGELOG.md Note: Both widget packages had their E2E visual baselines updated because the axis label rendering changed (the core fix lives in shared/charts, but it is observable behaviour in these widgets). The [Unreleased] sections in both CHANGELOGs are empty. A user-facing bug fix entry belongs there. The shared/charts package is private and has no CHANGELOG, so no entry is needed there. Fix: Add a ### Fixed entry under [Unreleased] in each widget's CHANGELOG.md, e.g.:
### Fixed- We fixed an issue where X-axis and Y-axis labels were not rendered correctly on charts.
Positives
The root cause is cleanly identified: callers already pass { text: "…" } objects (confirmed across all seven widget consumers), so the extra wrapping in getCustomLayoutOptions was creating { text: { text: "…" } } — the two-line fix is exactly the right scope.
The new unit tests directly assert the shape of the generated Plotly Layout object at each level of merging (getCustomLayoutOptions, getModelerLayoutOptions, getModelerConfigOptions, getModelerSeriesOptions), closing the gap that allowed this bug to go undetected.
Parametrised it.each for the four gridLinesMode values is a clean and exhaustive approach.
Updated visual baselines are committed alongside the fix — reviewer can visually verify the label rendering is now correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
Fixes the axis title structure in the generated chart layout configuration, so axis titles are passed through as
{ text: "..." }instead of being wrapped an extra level.Adds unit tests covering the shape of the generated layout, config and series options.
What should be covered while testing?