bito-code-review[bot] commented on code in PR #44559:
URL: https://github.com/apache/superset/pull/44559#discussion_r4080112619


##########
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx:
##########
@@ -519,4 +519,10 @@ const sharedControls: Record<string, 
SharedControlConfig<any>> = {
   ...matrixifyControls,
 };
 
+type RegisteredControl = (typeof controlConfigs)[keyof typeof controlConfigs];
+
+// Each control retains the option type accepted by its renderer.
+const sharedControls: typeof controlConfigs &
+  Record<string, RegisteredControl> = controlConfigs;

Review Comment:
   <!-- Bito Reply -->
   Bito's suggestion was based on a standard TypeScript behavior where an index 
signature in a spread object can cause `keyof` to collapse to `string`. While 
this is often correct, your follow-up observation highlights a nuanced case 
where dropping the intersection broke specific type assignments in 
`matrixify.tsx`. 
   
   Bito should not avoid these types of suggestions in the future. Even when a 
suggestion is technically incorrect for a specific edge case, it serves as a 
valuable prompt to verify type-level assumptions. The process of investigating 
and disproving the suggestion led to a better understanding of the type system 
and a more robust final implementation.



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