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


##########
superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx:
##########
@@ -233,6 +233,29 @@ const defaultResizableConfig = (hideFooter: boolean | 
undefined) => ({
   },
 });
 
+/** Merge caller overrides without dropping default resize-handle guards. */
+export function mergeResizableConfig(
+  hideFooter: boolean | undefined,
+  overrides: ModalProps['resizableConfig'] = {},
+): NonNullable<ModalProps['resizableConfig']> {
+  const defaults = defaultResizableConfig(hideFooter);
+  if (!overrides || Object.keys(overrides).length === 0) {
+    return defaults;
+  }
+  const { enable: enableOverride, ...restOverrides } = overrides;
+  return {
+    ...defaults,
+    ...restOverrides,
+    enable:
+      enableOverride === false
+        ? false
+        : {
+            ...defaults.enable,
+            ...(typeof enableOverride === 'object' ? enableOverride : {}),
+          },

Review Comment:
   <!-- Bito Reply -->
   The reviewer's suggestion to add an explicit `enableOverride === true` 
branch is correct. In the current implementation, `enable: true` is a valid 
value for the `re-resizable` library, but it is not an object, so it falls 
through to the `else` block and is replaced by `{}`, effectively losing the 
user's intent to enable all directions. Adding the branch ensures that `true` 
is correctly preserved.
   
   
**superset-frontend/packages/superset-ui-core/src/components/Modal/Modal.tsx**
   ```
   enable:
         enableOverride === false
           ? false
           : enableOverride === true
           ? true
           : {
               ...defaults.enable,
               ...(typeof enableOverride === 'object' ? enableOverride : {}),
             },
   ```



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