Repository navigation
fix(chart): prevent stacking bars on a logarithmic axis - #44556
Conversation
Signed-off-by: Deepak Jain <[email protected]>
Code Review Agent Run #723478Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Signed-off-by: Deepak Jain <[email protected]>
|
Added both new control messages to messages.pot in 32494b9. The new Babel job no longer reports either Bar-control string. Its remaining failure is the pre-existing credential-destination message rename: the same missing/stale pair is present at base 61fffbe. I verified the patch and base with the pinned Babel 2.17 extractor; no additional message drift is introduced by this change. The focused 61-test run and staged frontend hooks passed. The public screenshots exercise the production controls in isolated Storybook; they do not claim full application or database-backed chart validation. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #44556 +/- ##
===========================================
+ Coverage 66.22% 81.05% +14.82%
===========================================
Files 2949 2954 +5
Lines 177381 178119 +738
Branches 41107 41248 +141
===========================================
+ Hits 117469 144367 +26898
+ Misses 57409 31042 -26367
- Partials 2503 2710 +207
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review Agent Run #0c1f7bActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
…rol truth table The test.each for controlOverrides.stack.mapStateToProps covered three of the four logAxis x stack quadrants. Add the missing logAxis=false, stack=Stack row (disabled=false per Boolean(logAxis) && !stack).
|
Good catch on the missing truth-table row (bito review #0c1f7b). Added the missing [false, StackControlsValue.Stack, false] row in eb418e3 and verified all four rows against the mapStateToProps formula (disabled: Boolean(logAxis) && !stack). |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #07f66aActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Upstream apache#44574 landed the messages.pot regeneration on master; the babel-extract and unit-tests (check_pot_drift_test.py) failures on this PR were base drift, not contributor code. Fresh CI will run against the new merge commit with the fixed base pot.
EnxDev
left a comment
There was a problem hiding this comment.
Went through this against the explore wiring and it holds up. controlOverrides merges shallowly onto the shared stack control, SelectControl does forward disabled and warning, and CheckboxControl really has no disabled state, so hiding the checkbox is a fair call. The saved-chart recovery path works the way the description says.
Two small notes inline: the new checkbox tooltip mostly shows up in the state where it's wrong, and the tests don't pin the warning text, which is the only explanation users get.
| renderTrigger: true, | ||
| default: logAxis, | ||
| description: t('Logarithmic axis'), | ||
| description: t('Logarithmic axis is not available for stacked bars'), |
There was a problem hiding this comment.
The checkbox is hidden whenever bars are stacked, so outside the saved stack+log case this tooltip is only seen when log is available, and there it reads as if it isn't.
I'd keep the original description here and let the stack warning carry the explanation.
| description: t('Logarithmic axis is not available for stacked bars'), | |
| description: t('Logarithmic axis'), |
(That also drops the new msgid from messages.pot.)
There was a problem hiding this comment.
Addressed in c313d0e: restored the original description and removed the new translation entry. The stack warning carries the explanation. Current-head checks have completed successfully.
| type: 'SelectControl', | ||
| value: stack, | ||
| }), | ||
| ).toMatchObject({ disabled }); |
There was a problem hiding this comment.
Nit, take it or leave it. This only checks disabled, but the warning is the one thing telling the user why Stacked Style is greyed out, and nothing fails if it goes missing.
| ).toMatchObject({ disabled }); | |
| ).toMatchObject({ | |
| disabled, | |
| warning: logAxis ? expect.any(String) : null, | |
| }); |
There was a problem hiding this comment.
Addressed in c313d0e: the four-row test now also checks that warning is a string with log enabled and null otherwise. Current-head checks have completed successfully.
Address EnxDev's review notes on the Bar log-axis/stack guard: the new checkbox tooltip only surfaced in the state where it reads wrong, so the original description is kept (also dropping its new msgid from messages.pot), and the stack-control test now pins the warning text via toMatchObject. Signed-off-by: Deepak Jain <[email protected]>
|
Addressed both EnxDev review notes in commit c313d0e:
Fresh CI is running on the new head. |
Code Review Agent Run #254560Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
No change needed here. The identical description is upstream master's original text (controlPanel.tsx line 249), restored verbatim per EnxDev's review note on this PR to drop the new tooltip. The stack interaction it suggests documenting is already surfaced by the stack control's warning text pinned in the test. Closing as pre-existing, reviewer-directed. |
EnxDev
left a comment
There was a problem hiding this comment.
Follow-up to my earlier pass.
Both notes are handled in c313d0e: the log checkbox is back to its original description with the extra msgid gone from messages.pot, and the truth-table test now pins warning alongside disabled for all four rows. Agree with leaving Bito's redundant-description point alone, that text is what master already ships.
Took another look at the rest and nothing new from me. Nothing on master has touched the Bar panel or the shared stack control since you branched, so this looks good to go from my side.
rusackas
left a comment
There was a problem hiding this comment.
LGTM. Checked the mechanism EnxDev called out, SelectControl does forward disabled/warning, and CheckboxControl really has no disabled prop, so hiding logAxis instead of disabling it is the right call. The stack override's four-row truth table checks out too. Nothing left open from either round of review.
Signed-off-by: Deepak Jain <[email protected]> (cherry picked from commit 697b056)
SUMMARY
Stacked bars on a logarithmic axis can lose visible segments, as reported in #25829. This applies the requested control-panel guard: logarithmic mode disables the Stacked Style selector, and choosing a stacked style hides the logarithmic option. Turning the active setting off makes the other option available again.
A saved chart with both values already set keeps both controls accessible so the user can clear either setting. Its stored configuration and existing rendering are not silently rewritten. The change is limited to the ECharts Bar panel; shared controls, line/area charts and Mixed Timeseries remain unchanged. The logarithmic option uses the panel's visibility mechanism because the shared CheckboxControl does not support a disabled state.
Fixes #25829
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Isolated production SelectControl and CheckboxControl components in Storybook, using the Bar panel configuration. These show the control interaction, not a full Explore page or a database-backed chart.
Stacked mode and a saved invalid combination with a recovery path.
TESTING INSTRUCTIONS
Local checks:
jest plugins/plugin-chart-echarts/test/Timeseries/Bar/controlPanel.test.ts plugins/plugin-chart-echarts/test/Timeseries/Bar/transformProps.test.ts plugins/plugin-chart-echarts/test/MixedTimeseries/controlPanel.test.ts --runInBand: 61 tests passed with Node 24.16.0. The five new guard cases fail against the original panel.npm run plugins:build: passed, including declaration generation.pre-commit run: all applicable hooks passed, including frontend type checking.ADDITIONAL INFORMATION