bito-code-review[bot] commented on code in PR #38657:
URL: https://github.com/apache/superset/pull/38657#discussion_r3602399156
##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts:
##########
@@ -1837,3 +1867,26 @@ describe('Tooltip with long labels', () => {
expect(result).toContain('599616000000');
});
});
+
+test('should adjust dataZoom bottom when chart height changes', () => {
+ const smallChart = createTestChartProps({
+ height: 300,
+ formData: { zoomable: true },
+ });
+ const largeChart = createTestChartProps({
+ height: 600,
+ formData: { zoomable: true },
+ });
+
+ const smallResult = transformProps(smallChart);
+ const largeResult = transformProps(largeChart);
+
+ const smallBottom = (smallResult.echartOptions.dataZoom as any[])[0].bottom;
+ const largeBottom = (largeResult.echartOptions.dataZoom as any[])[0].bottom;
+
+ expect(smallBottom).toBeDefined();
+ expect(largeBottom).toBeDefined();
+
+ // Bottom should vary with height
+ expect(smallBottom).not.toEqual(largeBottom);
+});
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Duplicate test case</b></div>
<div id="fix">
This test is semantically duplicated - identical test already exists at
lines 1744-1772. Having two tests with the same setup, assertions, and purpose
increases maintenance burden and creates divergence risk if one is updated
without the other.
</div>
</div>
<small><i>Code Review Run #bf02fc</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
superset-frontend/plugins/plugin-chart-echarts/src/constants.ts:
##########
@@ -39,6 +39,7 @@ export const TIMESERIES_CONSTANTS = {
legendRightTopOffset: 30,
legendTopRightOffset: 55,
zoomBottom: 30,
+ zoomBottomMin: 10,
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Inconsistent zoom padding across chart types</b></div>
<div id="fix">
The new `zoomBottomMin` constant (10) is only applied to Timeseries charts,
while Gantt and MixedTimeseries charts continue using the hardcoded
`zoomBottom` value (30) directly. This creates inconsistent behavior where
small-height Gantt/MixedTimeseries charts will have excessive 30px zoom padding
instead of the minimum 10px. Update both files to use
`Math.min(TIMESERIES_CONSTANTS.zoomBottom,
Math.max(TIMESERIES_CONSTANTS.zoomBottomMin, Math.floor(height * 0.08)))`.
</div>
</div>
<small><i>Code Review Run #bf02fc</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]