rusackas opened a new pull request, #41833:
URL: https://github.com/apache/superset/pull/41833
### SUMMARY
Test-only PR that proves issue #39540 ("Legend type setting has no effect on
charts of version 6.1.0rc2") is fixed on master, and guards against it
regressing.
The regression was introduced by #36306 (December 2025), which
unconditionally forced `scroll` legends for horizontal (Top/Bottom)
orientations to prevent overlap — so switching the legend type control from
`scroll` to `plain` (list) had no visible effect. #38675 (March 2026) restored
the user's choice by adding plain-legend layout estimation with an
`effectiveType` fallback: a user-selected `plain` legend is honored whenever it
fits the available space, and `scroll` is only used as a fallback when it does
not.
This PR adds no production code. It pins the fixed contract at two levels:
- `getLegendLayoutResult`
(`superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts`):
- a user-selected plain type is honored for a horizontal legend with many
items on a wide chart (the exact issue scenario: "enough dimensions to be
scrolled");
- a user-selected plain type is kept for bottom-oriented legends when
space allows;
- a user-selected scroll type passes through untouched.
- Timeseries `transformProps`
(`superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts`):
the `legendType: plain` form-data selection survives end-to-end into
`echartOptions.legend.type` for both Top and Bottom orientations when space
allows — the layer where #36306 had forced `scroll`.
Faithfulness check: temporarily re-instating the forced-scroll behavior for
horizontal legends in `getLegendLayoutResult` makes 3 of these tests fail with
`Expected: "plain" / Received: "scroll"`, confirming they would have caught the
original regression.
closes #39540
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A (test-only change)
### TESTING INSTRUCTIONS
```bash
cd superset-frontend
npm run test -- plugins/plugin-chart-echarts/test/utils/series.test.ts
plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts
--maxWorkers=2
```
All 146 tests in the two suites pass on master.
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [x] Has associated issue: closes #39540
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
🤖 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]