bito-code-review[bot] commented on code in PR #44588:
URL: https://github.com/apache/superset/pull/44588#discussion_r4125948811
##########
superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/transformProps.ts:
##########
@@ -266,10 +266,19 @@ export default function transformProps(
metricLabel,
xAxisColumnName,
);
+ // Unlike the X-axis (often a temporal column that already arrives from
+ // the backend in a natural, e.g. chronological, order), the Y-axis
+ // groupby dimension has no such natural ordering to fall back on, so
+ // default it to ascending sort when the user hasn't chosen one.
+ // 'none' is an explicit "keep original order" selection (distinct from
+ // null/undefined, which means the control was never touched or was cleared,
+ // and both map to the alpha_asc default).
+ const effectiveSortYAxis =
+ sortYAxis === 'none' ? undefined : (sortYAxis ?? 'alpha_asc');
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Magic string cross-file coupling</b></div>
<div id="fix">
The `'none'` sentinel is a cross-file contract: defined in
`controlPanel.tsx` (line 41) and compared here (line 277). Renaming the choice
value in one file silently breaks the other (falls through to `alpha_asc`).
Consider a shared named constant to keep the two files in sync.
</div>
</div>
<small><i>Code Review Run #1d32e1</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]