bito-code-review[bot] commented on code in PR #44657:
URL: https://github.com/apache/superset/pull/44657#discussion_r4176690964
##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx:
##########
@@ -243,6 +251,34 @@ const config: ControlPanelConfig = {
},
},
],
+ [
+ {
+ name: 'aggregateFunction',
+ config: {
+ type: 'SelectControl',
+ label: t('Aggregation function'),
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Eager t() in label</b></div>
<div id="fix">
Same eager-`t()` regression: `label: t('Aggregation function')` is evaluated
at module load and won't update on runtime language switch. Use `label: () =>
t('Aggregation function')` per the `i18n-strings/no-eager-t-in-config` rule.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
label: () => t('Aggregation function'),
````
</div>
</details>
</div>
<small><i>Code Review Run #c66760</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-pivot-table/src/plugin/controlPanel.tsx:
##########
@@ -173,7 +178,10 @@ const config: ControlPanelConfig = {
name: 'rowTotals',
config: {
type: 'CheckboxControl',
- label: t('Show rows total'),
+ // The displayed value may be a result aggregation (Median,
+ // Average, ...) rather than a plain total once
`aggregateFunction`
+ // is set below, so "summary" rather than "total".
+ label: t('Show row summaries'),
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Eager t() in label</b></div>
<div id="fix">
This changes `label: () => t('Show row summaries')` to eager `label:
t(...)`. The repo's `i18n-strings/no-eager-t-in-config` rule (warn on
`**/controlPanel.{ts,tsx}`) and `BaseControlConfig` doc in
`chart-controls/src/types.ts` flag eager `label: t(...)`: it captures the
fallback language at module load and never updates on runtime language switch.
Use `label: () => t(...)`.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
label: () => t('Show row summaries'),
````
</div>
</details>
</div>
<small><i>Code Review Run #c66760</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-pivot-table/src/plugin/controlPanel.tsx:
##########
@@ -197,7 +205,7 @@ const config: ControlPanelConfig = {
name: 'colTotals',
config: {
type: 'CheckboxControl',
- label: t('Show columns total'),
+ label: t('Show column summaries'),
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Eager t() in label</b></div>
<div id="fix">
Same eager-`t()` regression as line 184: `label: t('Show column summaries')`
is evaluated at module load, so the label stays in the fallback language and
never updates on runtime language switch. Use `label: () => t('Show column
summaries')` per the `i18n-strings/no-eager-t-in-config` rule.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
label: () => t('Show column summaries'),
````
</div>
</details>
</div>
<small><i>Code Review Run #c66760</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]