codeant-ai-for-open-source[bot] commented on code in PR #41907:
URL: https://github.com/apache/superset/pull/41907#discussion_r3573618413
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx:
##########
@@ -314,6 +314,7 @@ function createAxisControl(axis: 'x' | 'y'):
ControlSetRow[] {
const config: ControlPanelConfig = {
controlPanelSections: [
sections.echartsTimeSeriesQueryWithXAxisSort,
+ sections.drilldownHierarchySection,
Review Comment:
**Suggestion:** Adding this section unconditionally exposes an empty
“Drill-down hierarchy” panel when the `DrillDown` feature flag is off, because
only the inner control has `visibility` gating. Gate the section itself (or
conditionally add it) so users don’t see a blank section in disabled
environments. [logic error]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
⚠️ Explore Bar chart shows empty Drill-down hierarchy section.
⚠️ Users see feature label without any usable controls.
⚠️ Same empty section on Area, Step, Pie charts.
```
</details>
<details>
<summary><b>Steps of Reproduction ✅ </b></summary>
```mdx
1. Disable the DRILL_DOWN feature flag as shown in
`superset-frontend/src/components/Chart/DrillDown/DrillDownHost.test.tsx:163-166`,
where
`global.featureFlags[FeatureFlag.DrillDown]` is set to `false`.
2. Open Explore for a Bar chart, which uses the control panel config in
`superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx:15-22`;
note `controlPanelSections` includes `sections.drilldownHierarchySection` at
line 317
unconditionally.
3. The section `drilldownHierarchySection` is defined in
`superset-frontend/packages/superset-ui-chart-controls/src/sections/drilldownHierarchy.tsx:2-34`
with label `t('Drill-down hierarchy')` and a single control
`drilldown_hierarchy` whose
`config.visibility` is `() => isFeatureEnabled(FeatureFlag.DrillDown)` at
line 29, so this
control is hidden when the flag is disabled.
4. In Explore, sections are rendered by `renderControlPanelSection` in
`superset-frontend/src/explore/components/ControlPanelsContainer.tsx:593-597`
and 629-135;
section visibility uses only `section.visibility` (`isVisible =
visibility?.call(...) !==
false` at line 14), which is undefined for `drilldownHierarchySection`, so
the section
remains visible with `style: { display: isVisible ? 'block' : 'none' }` at
line 135, while
its only row is dropped because `renderedControls.length === 0` at lines
104-107. The
result is a visible "Drill-down hierarchy" header with no controls whenever
the DRILL_DOWN
feature flag is off.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=af9525b502be41598773d7a62a29c04d&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=af9525b502be41598773d7a62a29c04d&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-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
**Line:** 317:317
**Comment:**
*Logic Error: Adding this section unconditionally exposes an empty
“Drill-down hierarchy” panel when the `DrillDown` feature flag is off, because
only the inner control has `visibility` gating. Gate the section itself (or
conditionally add it) so users don’t see a blank section in disabled
environments.
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%2F41907&comment_hash=82e79493df1cf1a5cee106bfffd480de5e8c23f650737dfebde7a92ea1a13c26&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41907&comment_hash=82e79493df1cf1a5cee106bfffd480de5e8c23f650737dfebde7a92ea1a13c26&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]