codeant-ai-for-open-source[bot] commented on code in PR #39760: URL: https://github.com/apache/superset/pull/39760#discussion_r3613163201
########## superset-frontend/plugins/plugin-chart-cartodiagram/src/components/MapMaxExtentControl/MapMaxExtentTag.tsx: ########## @@ -0,0 +1,48 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { t } from '@apache-superset/core/translation'; +import { Tag } from 'antd'; Review Comment: **Suggestion:** Replace the direct Ant Design import with the corresponding component wrapper from @superset-ui/core/components. [custom_rule] **Severity Level:** Minor ๐งน <details> <summary><b>Why it matters? โญ </b></summary> The file directly imports `Tag` from `antd`, which violates the rule requiring Superset UI core wrappers from `@superset-ui/core/components` instead of direct Ant Design imports. </details> <details> <summary><b>Rule source ๐ </b></summary> === .cursor/rules/dev-standard.mdc === (line 19) </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=c1ff36d086584dc883b6470dcf6b46d5&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=c1ff36d086584dc883b6470dcf6b46d5&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) *(Use Cmd/Ctrl + Click for best experience)* <details> <summary><b>Prompt for AI Agent ๐ค </b></summary> ```mdx This is a comment left during a code review. **Path:** superset-frontend/plugins/plugin-chart-cartodiagram/src/components/MapMaxExtentControl/MapMaxExtentTag.tsx **Line:** 21:21 **Comment:** *Custom Rule: Replace the direct Ant Design import with the corresponding component wrapper from @superset-ui/core/components. Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix ``` </details> <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39760&comment_hash=52549cf90c4241be2b6f9d2505a3d4e48f15904899f72ed26e667b96c801ef44&reaction=like'>๐</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39760&comment_hash=52549cf90c4241be2b6f9d2505a3d4e48f15904899f72ed26e667b96c801ef44&reaction=dislike'>๐</a> ########## superset-frontend/plugins/plugin-chart-cartodiagram/src/components/MapMaxExtentControl/MapMaxExtentViewControl.tsx: ########## @@ -0,0 +1,156 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { ControlHeader } from '@superset-ui/chart-controls'; +import { t } from '@apache-superset/core/translation'; +import { css, styled } from '@apache-superset/core/theme'; +import { Button, Radio } from 'antd'; Review Comment: **Suggestion:** Replace the direct Ant Design component import with the corresponding component wrappers from `@superset-ui/core/components`. [custom_rule] **Severity Level:** Major โ ๏ธ <details> <summary><b>Why it matters? โญ </b></summary> The rule requires using @superset-ui/core wrappers instead of importing Ant Design directly. This code imports Button and Radio from 'antd', so it is a real violation. </details> <details> <summary><b>Rule source ๐ </b></summary> === .cursor/rules/dev-standard.mdc === (line 19) </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=4d028b708d7d4d66bae839a2a3254658&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=4d028b708d7d4d66bae839a2a3254658&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) *(Use Cmd/Ctrl + Click for best experience)* <details> <summary><b>Prompt for AI Agent ๐ค </b></summary> ```mdx This is a comment left during a code review. **Path:** superset-frontend/plugins/plugin-chart-cartodiagram/src/components/MapMaxExtentControl/MapMaxExtentViewControl.tsx **Line:** 22:22 **Comment:** *Custom Rule: Replace the direct Ant Design component import with the corresponding component wrappers from `@superset-ui/core/components`. Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix ``` </details> <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39760&comment_hash=72ba00a5d7da0bbd0bd73efb6f392e2b2733ecd2b5c917585c7314eb4a5a6ae4&reaction=like'>๐</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39760&comment_hash=72ba00a5d7da0bbd0bd73efb6f392e2b2733ecd2b5c917585c7314eb4a5a6ae4&reaction=dislike'>๐</a> ########## superset-frontend/plugins/plugin-chart-cartodiagram/src/components/MapMaxExtentControl/MapMaxExtentViewControl.tsx: ########## @@ -0,0 +1,156 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { ControlHeader } from '@superset-ui/chart-controls'; +import { t } from '@apache-superset/core/translation'; +import { css, styled } from '@apache-superset/core/theme'; +import { Button, Radio } from 'antd'; +import { FC } from 'react'; +import { mix } from 'polished'; +import { RadioChangeEvent } from 'antd/lib/radio'; Review Comment: **Suggestion:** Avoid importing internal Ant Design module paths and use the appropriate type exports through Superset UI core-supported imports. [custom_rule] **Severity Level:** Major โ ๏ธ <details> <summary><b>Why it matters? โญ </b></summary> This is still a direct Ant Design import, just from an internal module path. The custom rule forbids direct Ant Design imports in favor of Superset UI core-supported components and imports, so this is a valid violation. </details> <details> <summary><b>Rule source ๐ </b></summary> === .cursor/rules/dev-standard.mdc === (line 19) </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=aa30573c20724584bd3705b95ac70476&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=aa30573c20724584bd3705b95ac70476&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) *(Use Cmd/Ctrl + Click for best experience)* <details> <summary><b>Prompt for AI Agent ๐ค </b></summary> ```mdx This is a comment left during a code review. **Path:** superset-frontend/plugins/plugin-chart-cartodiagram/src/components/MapMaxExtentControl/MapMaxExtentViewControl.tsx **Line:** 25:25 **Comment:** *Custom Rule: Avoid importing internal Ant Design module paths and use the appropriate type exports through Superset UI core-supported imports. Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix ``` </details> <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39760&comment_hash=fb951bc67295d86df6f010345a969c9954f5d31a06bd4bc861b6cf14a0ac0f88&reaction=like'>๐</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39760&comment_hash=fb951bc67295d86df6f010345a969c9954f5d31a06bd4bc861b6cf14a0ac0f88&reaction=dislike'>๐</a> ########## superset-frontend/plugins/plugin-chart-cartodiagram/src/components/OlChartMap.tsx: ########## @@ -118,12 +130,48 @@ export const OlChartMap = (props: OlChartMapProps) => { }); }, [mapView]); + /** + * The prop mapMaxExtent will always be created on the fly, + * therefore the shallow comparison of the effect hooks will + * always trigger. In this hook, we compare only those props + * that might be changed from outside of the component, i.e the + * fixed properties and the mode. Only if these values differ will + * we set the state to the new object. All other effect hooks that + * depend on mapView should now depend on currentMapMaxExtent instead. Review Comment: **Suggestion:** Rewrite this comment to remove time-specific wording (for example, avoid using โnowโ) so it remains accurate over time. [custom_rule] **Severity Level:** Minor ๐งน <details> <summary><b>Why it matters? โญ </b></summary> The comment uses the time-specific word โnow,โ which matches the custom rule forbidding time-specific language in code comments. This is a real violation present in the existing code. </details> <details> <summary><b>Rule source ๐ </b></summary> === .github/copilot-instructions.md === (line 95) </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=4a38e7ae474148d698ea5fd65d8579af&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=4a38e7ae474148d698ea5fd65d8579af&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) *(Use Cmd/Ctrl + Click for best experience)* <details> <summary><b>Prompt for AI Agent ๐ค </b></summary> ```mdx This is a comment left during a code review. **Path:** superset-frontend/plugins/plugin-chart-cartodiagram/src/components/OlChartMap.tsx **Line:** 140:140 **Comment:** *Custom Rule: Rewrite this comment to remove time-specific wording (for example, avoid using โnowโ) so it remains accurate over time. Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix ``` </details> <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39760&comment_hash=51c40f43050bb6156605b8604e7a8de1b572ea9d03d72d201dfbe303f37a3b49&reaction=like'>๐</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39760&comment_hash=51c40f43050bb6156605b8604e7a8de1b572ea9d03d72d201dfbe303f37a3b49&reaction=dislike'>๐</a> ########## superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/transformProps.ts: ########## @@ -26,35 +26,56 @@ export default function transformProps(chartProps: ChartProps) { const { width, height, formData, hooks, theme } = chartProps; const { geomColumn, + geomFormat, selectedChart: selectedChartString, chartSize, layerConfigs, + mapExtentPadding, + mapMaxExtent, mapView, + maxZoom, + minZoom, chartBackgroundColor, chartBackgroundBorderRadius, + sliceId, } = formData; const { setControlValue = () => {} } = hooks; const selectedChart = parseSelectedChart(selectedChartString); const transformPropsRegistry = getChartTransformPropsRegistry(); const chartTransformer = transformPropsRegistry.get(selectedChart.viz_type); - const chartConfigs = getChartConfigs( - selectedChart, - geomColumn, - chartProps, - chartTransformer, - ); + let chartConfigs; Review Comment: **Suggestion:** Add an explicit concrete type annotation for this variable instead of leaving it implicitly typed, so it does not default to an `any`-like type. [custom_rule] **Severity Level:** Major โ ๏ธ <details> <summary><b>Why it matters? โญ </b></summary> The variable is declared without a type annotation or initializer, so it is effectively an implicit any-like declaration in TypeScript. That directly violates the no-any-types rule. </details> <details> <summary><b>Rule source ๐ </b></summary> === .cursor/rules/dev-standard.mdc === (line 16) </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=7cd07da889bc4710b232c5e5ac7d441c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=7cd07da889bc4710b232c5e5ac7d441c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) *(Use Cmd/Ctrl + Click for best experience)* <details> <summary><b>Prompt for AI Agent ๐ค </b></summary> ```mdx This is a comment left during a code review. **Path:** superset-frontend/plugins/plugin-chart-cartodiagram/src/plugin/transformProps.ts **Line:** 47:47 **Comment:** *Custom Rule: Add an explicit concrete type annotation for this variable instead of leaving it implicitly typed, so it does not default to an `any`-like type. Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise. Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix ``` </details> <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39760&comment_hash=8b6a985c97b329ab322b57bcdecdab1bd83ff341f774a90d43f274db1b978994&reaction=like'>๐</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39760&comment_hash=8b6a985c97b329ab322b57bcdecdab1bd83ff341f774a90d43f274db1b978994&reaction=dislike'>๐</a> -- 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]
