rusackas opened a new pull request, #42599:
URL: https://github.com/apache/superset/pull/42599
### SUMMARY
This is a **test-only PR** opened as a TDD-style validation of issue #42560.
#42560 reports that on an ECharts **Bar Chart**, a custom **X Axis Title**
(Customize tab) is overwritten by "the unit" (e.g. a temporal
grain/number-format label) instead of showing the user's custom text. @dosu
investigated and found no code path in `Timeseries/transformProps.ts` that
derives `xAxis.name` from any unit/format value — `xAxisTitle` is assigned
directly with no fallback.
This PR independently re-verifies dosu's conclusion against the Bar chart's
*actual* code path (Bar reuses the shared `Timeseries/transformProps.ts` and
`Timeseries/buildQuery.ts` — its `Regular/Bar/` folder only contains
`controlPanel.tsx` and `index.ts`, so there is no separate Bar-specific
transform to check). No literal `unit` string logic exists anywhere in that
transform path.
This PR adds 2 regression tests on `Timeseries/transformProps.ts`
(Bar-specific suite):
1. **`custom X Axis Title is preserved verbatim, not overwritten by the axis
number/currency format ("unit")`** — sets a custom `xAxisTitle` alongside a
currency-like `yAxisFormat` and a `xAxisNumberFormat`, and asserts the rendered
`xAxis.name` equals the custom title exactly.
2. **`X Axis Title control maps onto the rendered category (left) axis in
horizontal orientation, not the bottom axis`** — documents the existing (and
easy to misread) axis swap: in horizontal Bar charts, `xAxisTitle` ends up on
`echartOptions.yAxis.name` (the vertical category axis) while `yAxisTitle` ends
up on `echartOptions.xAxis.name` (the horizontal value axis). This swap is
likely the real source of user confusion dosu flagged in point #2 of their
investigation, separate from any "unit overwrite."
### How to interpret CI
- **CI green** (expected) — confirms `xAxisTitle` is never derived from a
unit/number-format value in the code, ruling out that specific theory. **This
does not close #42560** — if the bug is still reproducing for the reporter, the
cause is elsewhere (stale/legacy stored form data, a rendering-layer issue
outside this transform, or the horizontal-orientation control-mapping confusion
documented in test 2).
- **CI red** — would mean the axis-name assignment has a hidden interaction
with format/unit not visible from static reading of the code; would need
re-investigation.
### TESTING INSTRUCTIONS
```bash
cd superset-frontend
npx jest
plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts -t
"42560"
```
### ADDITIONAL INFORMATION
- [ ] Has associated issue: closes #42560
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
**Disclosure:** the local `type-checking-frontend` pre-commit hook was
skipped (`SKIP=type-checking-frontend`) on this worktree — it requires a
pre-built `lib/spec/index.d.ts` that a fresh worktree doesn't have. All other
hooks (prettier, oxlint, custom-rules-frontend, stylelint) passed locally; CI
is the real gate for type-checking.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]