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


##########
superset-frontend/src/components/Flex/Flex.stories.tsx:
##########
@@ -0,0 +1,86 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Flex, FlexProps } from 'src/components/Flex';
+import { css } from '@superset-ui/core';
+
+export default {
+  title: 'Flex',
+  component: Flex,
+};
+
+export const InteractiveFlex = (args: FlexProps) => (
+  <Flex
+    {...args}
+    css={css`
+      width: 100%;
+      height: 90vh;
+    `}
+  >
+    {new Array(20).fill(null).map((_, i) => (
+      <p key={i}>Item</p>
+    ))}
+  </Flex>
+);
+
+InteractiveFlex.args = {
+  vertical: false,
+  wrap: 'nowrap',
+  justify: 'normal',
+  align: 'normal',
+  flex: 'normal',
+  gap: 'small',
+};
+
+InteractiveFlex.argTypes = {
+  vertical: {
+    control: { type: 'boolean' },
+    type: { name: 'boolean', required: false },
+  },
+  wrap: {
+    control: { type: 'select' },
+    options: ['nowrap', 'wrap', 'wrap-reverse', false, true],

Review Comment:
   ### Type Inconsistency in Wrap Property Options <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The wrap property options include boolean values (false, true) which are 
inconsistent with the string type declaration and may cause type conflicts.
   
   ###### Why this matters
   This type mismatch could lead to runtime errors when the component receives 
boolean values, as the type system expects string values. This contradicts the 
TypeScript type safety principles.
   
   ###### Suggested change ∙ *Feature Preview*
   Remove the boolean options and keep only string values that match the type 
declaration:
   ```typescript
   options: ['nowrap', 'wrap', 'wrap-reverse'],
   ```
   
   
   ###### 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/7d1ac8ea-4c3a-4317-87f8-ab1a09d837dc/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7d1ac8ea-4c3a-4317-87f8-ab1a09d837dc?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/7d1ac8ea-4c3a-4317-87f8-ab1a09d837dc?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/7d1ac8ea-4c3a-4317-87f8-ab1a09d837dc?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/7d1ac8ea-4c3a-4317-87f8-ab1a09d837dc)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:fd3b36e5-aef5-47f1-9d7f-5f04c9858544 -->
   
   [](fd3b36e5-aef5-47f1-9d7f-5f04c9858544)



##########
superset-frontend/src/components/Flex/Flex.stories.tsx:
##########
@@ -0,0 +1,86 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Flex, FlexProps } from 'src/components/Flex';
+import { css } from '@superset-ui/core';
+
+export default {
+  title: 'Flex',
+  component: Flex,
+};
+
+export const InteractiveFlex = (args: FlexProps) => (
+  <Flex
+    {...args}
+    css={css`
+      width: 100%;
+      height: 90vh;
+    `}
+  >
+    {new Array(20).fill(null).map((_, i) => (
+      <p key={i}>Item</p>
+    ))}

Review Comment:
   ### Non-configurable demo items in story <sub>![category 
Design](https://img.shields.io/badge/Design-0d9488)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The story component uses hardcoded array creation with map for demonstration 
items rather than making the items configurable through story args.
   
   ###### Why this matters
   This reduces the reusability and flexibility of the story component for 
testing different scenarios. It violates the Open-Closed Principle by not 
allowing extension without modification.
   
   ###### Suggested change ∙ *Feature Preview*
   Make items configurable through story args:
   ```typescript
   export const InteractiveFlex = ({ items = 20, ...args }: FlexProps & { 
items?: number }) => (
     <Flex {...args}>
       {Array.from({ length: items }, (_, i) => (
         <p key={i}>Item {i + 1}</p>
       ))}
     </Flex>
   );
   
   InteractiveFlex.args = {
     items: 20,
     // ... other args
   };
   ```
   
   
   ###### 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/bc8c18fb-344b-445e-9d44-6263a1f9fb35/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/bc8c18fb-344b-445e-9d44-6263a1f9fb35?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/bc8c18fb-344b-445e-9d44-6263a1f9fb35?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/bc8c18fb-344b-445e-9d44-6263a1f9fb35?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/bc8c18fb-344b-445e-9d44-6263a1f9fb35)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:c0570da8-064d-49f4-9834-8f314f7a40c1 -->
   
   [](c0570da8-064d-49f4-9834-8f314f7a40c1)



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