codeant-ai-for-open-source[bot] commented on code in PR #41636:
URL: https://github.com/apache/superset/pull/41636#discussion_r3536903937


##########
superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx:
##########
@@ -778,10 +786,14 @@ const AsyncSelect = forwardRef(
           options={fullSelectOptions}
           optionRender={option => <Space>{option.label || 
option.value}</Space>}
           placeholder={placeholder}
-          showSearch={allowNewOptions ? true : showSearch}
+          showSearch={shouldShowSearch}
           tokenSeparators={tokenSeparators}
           value={selectValue}
-          suffixIcon={getSuffixIcon(isLoading, showSearch, isDropdownVisible)}
+          suffixIcon={getSuffixIcon(
+            isLoading,
+            shouldShowSearch,
+            isDropdownVisible,
+          )}

Review Comment:
   **Suggestion:** The async wrapper still does not pass `builtinPlacements`, 
so after the antd v6 migration it will fall back to default horizontal viewport 
adjustment and can reintroduce the dropdown-shift regression fixed by #36963. 
Mirror the static `Select` wrapper by wiring `DROPDOWN_BUILTIN_PLACEMENTS` into 
this `StyledSelect` instance as well. [incomplete implementation]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Dashboard owners AsyncSelect dropdown misaligned near viewport edges.
   - ⚠️ Dashboard roles AsyncSelect dropdown shifts horizontally unexpectedly.
   - ⚠️ Dashboard tags AsyncSelect dropdown uses unstable placements.
   - ⚠️ Dataset AsyncSelect dropdown misaligned in native filters modal.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Open the dashboard access properties UI, implemented in
   
`superset-frontend/src/dashboard/components/PropertiesModal/sections/AccessSection.tsx:100-75`,
   where the Owners, Roles, and Tags fields render `<AsyncSelect>` components 
(e.g. Owners at
   line 11, Roles at line 36, Tags at line 61).
   
   2. These `AsyncSelect` usages import `AsyncSelect` from 
`@superset-ui/core/components` and
   resolve to the wrapper in
   
`superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx:25-79`,
   which returns a `<StyledSelect>` instance with props such as `placeholder`, 
`showSearch`,
   `tokenSeparators`, `value`, and `suffixIcon` (see `AsyncSelect.tsx:30-18` in 
the
   StyledSelect JSX block).
   
   3. In the static Select wrapper at
   
`superset-frontend/packages/superset-ui-core/src/components/Select/Select.tsx:34-42`,
 the
   same `StyledSelect` is configured with 
`builtinPlacements={DROPDOWN_BUILTIN_PLACEMENTS}`
   (line 38), using the placement map defined in
   
`superset-frontend/packages/superset-ui-core/src/components/Select/constants.ts:4-26`
 and
   validated by `constants.test.ts:4-35` to pin regression #36963 by disabling 
horizontal
   overflow adjustment (`adjustX=false`) while keeping vertical adjustment 
(`adjustY=true`).
   
   4. In contrast, the async wrapper’s `StyledSelect` props at 
`AsyncSelect.tsx:30-27` only
   include `showSearch={shouldShowSearch}`, `tokenSeparators={tokenSeparators}`,
   `value={selectValue}`, and `suffixIcon={getSuffixIcon(...)}` with no 
`builtinPlacements`
   override. At runtime, when a user opens any AsyncSelect dropdown 
(Owners/Roles/Tags
   selectors or the dataset selector in `DatasetSelect.tsx:28-37`), Ant Design 
v6 falls back
   to its default builtin placements, which retain `overflow.adjustX=true`; 
when the dropdown
   is near the viewport edge this causes the popup to shift horizontally 
relative to the
   input, reproducing the dropdown-shift behavior that #36963 fixed for the 
static Select but
   leaving all AsyncSelect-based UIs affected.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=57d764eb993f4d948d348f16dbf5d76f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=57d764eb993f4d948d348f16dbf5d76f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** 
superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx
   **Line:** 789:796
   **Comment:**
        *Incomplete Implementation: The async wrapper still does not pass 
`builtinPlacements`, so after the antd v6 migration it will fall back to 
default horizontal viewport adjustment and can reintroduce the dropdown-shift 
regression fixed by #36963. Mirror the static `Select` wrapper by wiring 
`DROPDOWN_BUILTIN_PLACEMENTS` into this `StyledSelect` instance as well.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41636&comment_hash=71072985a1a71d9c4d6ee1cc096374d1e36a8abe73272fae8ca0b8c11f7d02eb&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41636&comment_hash=71072985a1a71d9c4d6ee1cc096374d1e36a8abe73272fae8ca0b8c11f7d02eb&reaction=dislike'>👎</a>



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