korbit-ai[bot] commented on code in PR #34200:
URL: https://github.com/apache/superset/pull/34200#discussion_r2212406070


##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx:
##########
@@ -359,6 +359,19 @@ const config: ControlPanelConfig = {
         [xAxisLabelRotation],
         [xAxisLabelInterval],
         ...richTooltipSection,
+        [
+        {
+          name: 'show_query_identifiers',
+          config: {
+            type: 'CheckboxControl',
+            label: t('Show query identifiers'),
+            description: t('Adds Query A and Query B identifiers to metrics to 
help differentiate series'),
+            default: false,
+            renderTrigger: true,
+            visibility: ({ controls }) => 
Boolean(controls?.rich_tooltip?.value),

Review Comment:
   ### Inline Visibility Function <sub>![category 
Performance](https://img.shields.io/badge/Performance-4f46e5)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The visibility function is recalculated on every render since it's defined 
inline, creating a new function reference each time.
   
   
   ###### Why this matters
   With frequent re-renders, this can lead to unnecessary recalculations and 
memory churn, especially in larger applications with many controls.
   
   ###### Suggested change ∙ *Feature Preview*
   Extract the visibility function to a memoized or constant function: 
   
   ```typescript
   const checkRichTooltipVisibility = ({ controls }) => 
Boolean(controls?.rich_tooltip?.value);
   
   // In the config:
   visibility: checkRichTooltipVisibility
   ```
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice 
Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/33bd6ef2-2058-4da4-abdd-95331eaa36d3/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/33bd6ef2-2058-4da4-abdd-95331eaa36d3?what_not_true=true)
  [![Not in 
Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/33bd6ef2-2058-4da4-abdd-95331eaa36d3?what_out_of_scope=true)
 [![Not in coding 
standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/33bd6ef2-2058-4da4-abdd-95331eaa36d3?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/33bd6ef2-2058-4da4-abdd-95331eaa36d3)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:606c1e33-4184-4ecc-a469-eab69319b8e1 -->
   
   
   [](606c1e33-4184-4ecc-a469-eab69319b8e1)



-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to