sadpandajoe opened a new pull request, #38387:
URL: https://github.com/apache/superset/pull/38387

   ### SUMMARY
   
   Converts the permissions and groups dropdowns in the role edit modal from 
loading all options upfront to using `AsyncSelect` with server-side search. 
This fixes performance issues when there are thousands of permissions by 
fetching only relevant results as the user types.
   
   **Key changes:**
   
   - **AsyncSelect with server-side search**: Permissions and groups fields now 
use `AsyncSelect` that searches the backend via the `ct` (contains) filter 
operator, with dual-column search (both `view_menu.name` and `permission.name`) 
for permissions
   - **Client-side caching**: Search results are cached in a `Map` (up to 20 
entries with LRU eviction) to avoid redundant API calls when paginating or 
re-visiting the same search term
   - **Concurrent pagination**: When search results exceed the backend page 
size, remaining pages are fetched in batches of 3 concurrent requests
   - **Hydration with fallback**: On modal open, existing permission/group IDs 
are hydrated by fetching their labels from the API. If any IDs can't be 
resolved (e.g., deleted permissions), they're shown as numeric fallback pills 
with a warning toast
   - **Duplicate toast suppression**: When hydration fetch fails entirely 
(network error, API 500), only the fetch error toast fires — the "shown as IDs" 
fallback toast is suppressed to avoid confusing duplicate notifications
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A - behavioral change, no visual layout changes
   
   ### TESTING INSTRUCTIONS
   
   1. Navigate to Security → Roles and edit a role with many permissions
   2. Type in the Permissions dropdown — results should load from the server as 
you type
   3. Verify search works case-insensitively (e.g., "Dataset" and "dataset" 
return the same results)
   4. Verify the Groups dropdown also searches server-side
   5. Verify existing permissions/groups are pre-populated when editing a role
   6. Save the role and verify permissions/groups are preserved correctly
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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