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


##########
superset-frontend/src/explore/components/controls/LayerConfigsControl/FlatLayerTree.tsx:
##########
@@ -120,7 +118,9 @@ export const FlatLayerTree = forwardRef<HTMLDivElement, 
FlatLayerTreeProps>(
 
     const treeData = layerConfigsToTreeData(layerConfigs);
 
-    const onDrop: TreeProps['onDrop'] = info => {
+    const onDrop = (
+      info: Parameters<NonNullable<TreeProps<FlatLayerDataNode>['onDrop']>>[0],

Review Comment:
   ### Overly Complex Type Extraction <sub>![category 
Readability](https://img.shields.io/badge/Readability-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   Complex type extraction using Parameters and NonNullable makes the code 
harder to read and understand at a glance.
   
   ###### Why this matters
   The nested type utility operations obscure the actual type being used, 
making it difficult for developers to quickly understand what type of parameter 
info should be.
   
   ###### Suggested change ∙ *Feature Preview*
   ```typescript
   // Create a dedicated type at the top of the file or in types.ts
   type TreeDropInfo = 
Parameters<NonNullable<TreeProps<FlatLayerDataNode>['onDrop']>>[0];
   
   // Then use it in the function
   onDrop = (info: TreeDropInfo) => {
   ```
   
   
   ###### 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/cc90ede1-f3c5-4dcd-a770-eee533cfdbd5/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/cc90ede1-f3c5-4dcd-a770-eee533cfdbd5?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/cc90ede1-f3c5-4dcd-a770-eee533cfdbd5?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/cc90ede1-f3c5-4dcd-a770-eee533cfdbd5?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/cc90ede1-f3c5-4dcd-a770-eee533cfdbd5)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:2c3d1e01-582a-429a-b543-781c8ccbb9ff -->
   
   
   [](2c3d1e01-582a-429a-b543-781c8ccbb9ff)



-- 
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