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


##########
superset-frontend/src/features/roles/RoleFormItems.tsx:
##########
@@ -60,6 +60,13 @@ export const PermissionsField = ({
         placeholder={t('Select permissions')}
         options={options}
         loading={loading}
+        // fetchPermissionOptions already filters server-side against the raw
+        // permission/view_menu names. AsyncSelect's default client-side
+        // re-filter checks the search term against the rendered label, but
+        // that label has had underscores replaced with spaces
+        // (formatPermissionLabel), so a raw-name search term never matches
+        // it and the correctly-fetched option gets hidden. See #42041.
+        filterOption={false}

Review Comment:
   **Suggestion:** Disabling client-side filtering also disables the fallback 
used by `AsyncSelect` after all unsearched options have been loaded. In that 
state, `AsyncSelect` short-circuits subsequent server requests, so typing a 
search term leaves the complete permission list visible instead of narrowing 
it. Ensure searches still invoke the server loader after all base options are 
loaded, or provide filtering that handles the raw permission name without 
hiding relabeled results. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Permission searches stop narrowing cached option lists.
   - ⚠️ Users must manually scan all loaded permissions.
   - ❌ Search results can include unrelated permissions.
   ```
   </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=8be8d4115d3648b9922f1104f3a274f3&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=8be8d4115d3648b9922f1104f3a274f3&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/src/features/roles/RoleFormItems.tsx
   **Line:** 69:69
   **Comment:**
        *Logic Error: Disabling client-side filtering also disables the 
fallback used by `AsyncSelect` after all unsearched options have been loaded. 
In that state, `AsyncSelect` short-circuits subsequent server requests, so 
typing a search term leaves the complete permission list visible instead of 
narrowing it. Ensure searches still invoke the server loader after all base 
options are loaded, or provide filtering that handles the raw permission name 
without hiding relabeled results.
   
   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%2F42592&comment_hash=f801f61da622728812f473734c6f44878983b4d8cad0d72b9d6277d83322b7c9&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42592&comment_hash=f801f61da622728812f473734c6f44878983b4d8cad0d72b9d6277d83322b7c9&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