codeant-ai-for-open-source[bot] commented on code in PR #41907:
URL: https://github.com/apache/superset/pull/41907#discussion_r3555425754


##########
superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/controlPanel.ts:
##########
@@ -105,6 +105,7 @@ const config: ControlPanelConfig = {
         ],
       ],
     },
+    sections.drilldownHierarchySection,

Review Comment:
   **Suggestion:** This enables drill-down for BoxPlot even though BoxPlot 
click-to-filter mapping is still incompatible when multiple metrics are 
selected: series point names are built as "group, metric" but the 
drill/cross-filter label map is keyed only by group, so the drill handler 
cannot resolve clicked values and returns early. Because drill mode suppresses 
normal cross-filter clicks, user clicks become no-ops. Either block drill-down 
for BoxPlot unless exactly one metric is used, or update BoxPlot 
label-map/drill filter construction to key by the exact clickable series name. 
[incomplete implementation]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Box Plot drilldown clicks ignored with multiple metrics configured.
   - ⚠️ Dashboard cross-filters from Box Plot fail in drill mode.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Create an ECharts Box Plot chart using the plugin defined in
   `superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/index.ts` 
(constructor at
   lines 31-68) with at least one `groupby` dimension and multiple metrics 
configured via the
   `groupby` and `metrics` controls in `src/BoxPlot/controlPanel.ts` (lines 
77-79).
   
   2. In the Box Plot control panel, use the newly added 
`sections.drilldownHierarchySection`
   (line 108 in `src/BoxPlot/controlPanel.ts`) to configure a non-empty 
`drilldown_hierarchy`
   so that the chart has a drilldown hierarchy; the `DrillDownHost` is verified 
in
   `src/components/Chart/DrillDown/DrillDownHost.test.tsx` (lines 3-17 and 
20-37) to supply
   an `onDrillDown` callback whenever `drilldown_hierarchy` is present, 
matching the contract
   described in `plugins/plugin-chart-echarts/src/types.ts` (lines 27-34).
   
   3. Run the chart query and observe `transformProps` in
   `plugins/plugin-chart-echarts/src/BoxPlot/transformProps.ts`: series point 
names are built
   at lines 85-97 so that, when multiple metrics are selected, each point name 
becomes
   ``${groupbyLabel}, ${metric}``, while the `labelMap` is constructed at lines 
165-175 keyed
   only by the `groupbyLabel` (the group value) without the metric suffix.
   
   4. When the chart renders, `EchartsBoxPlot` in 
`src/BoxPlot/EchartsBoxPlot.tsx` (lines
   23-28) passes the transformed props, including `groupby`, `labelMap`, and 
`onDrillDown`,
   into `allEventHandlers` in 
`plugins/plugin-chart-echarts/src/utils/eventHandlers.ts`
   (lines 155-201). Because `onDrillDown` is defined and `groupby.length > 0`,
   `allEventHandlers` chooses `drillDownClickHandler` (lines 175-201) as the 
`click` handler,
   which looks up `const values = labelMap[e.name];`. For multi-metric Box 
Plots, `e.name` is
   the full series label like `"group, metric"` while `labelMap` only has keys 
for `"group"`,
   so `values` is undefined and the handler returns early (lines 178-179) 
without calling
   `onDrillDown`. Since the `click` handler is `drillDownClickHandler` instead 
of the normal
   `clickEventHandler` (lines 203-211), cross-filter clicks are suppressed in 
drill mode, and
   user left-clicks on Box Plot points become no-ops when a drilldown hierarchy 
is configured
   with multiple metrics.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=8e7e9a360fb148eb92c7a1815a942ab1&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=8e7e9a360fb148eb92c7a1815a942ab1&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/BoxPlot/controlPanel.ts
   **Line:** 108:108
   **Comment:**
        *Incomplete Implementation: This enables drill-down for BoxPlot even 
though BoxPlot click-to-filter mapping is still incompatible when multiple 
metrics are selected: series point names are built as "group, metric" but the 
drill/cross-filter label map is keyed only by group, so the drill handler 
cannot resolve clicked values and returns early. Because drill mode suppresses 
normal cross-filter clicks, user clicks become no-ops. Either block drill-down 
for BoxPlot unless exactly one metric is used, or update BoxPlot 
label-map/drill filter construction to key by the exact clickable series name.
   
   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=d7b3cbc8c3f57793443dbd4ecf97bd7cfb3286941eba57edc2def1f6c767441f&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41907&comment_hash=d7b3cbc8c3f57793443dbd4ecf97bd7cfb3286941eba57edc2def1f6c767441f&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]

Reply via email to