Fix application dropdown in branding page not showing all applications#10427
Fix application dropdown in branding page not showing all applications#10427KaveeshaPiumini wants to merge 2 commits into
Conversation
📝 WalkthroughWalkthroughAdds proactive pagination to the branding page application Autocomplete. A new ChangesProactive pagination for application dropdown
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.changeset/branding-application-dropdown-overflow.md:
- Around line 1-3: The changeset file branding-application-dropdown-overflow.md
currently only includes `@wso2is/admin.branding.v1` with a patch update, but since
this PR modifies code in the features directory, you must also add the consuming
app-level package to the changeset. Determine the appropriate app package
(likely `@wso2is/console` based on the branding feature context) and add it to the
changeset file with a patch version update, following the same format as the
existing `@wso2is/admin.branding.v1` entry to ensure the feature changes are
properly released through the app package.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: b19f1258-cad0-46fc-8491-4975b874440b
📒 Files selected for processing (2)
.changeset/branding-application-dropdown-overflow.mdfeatures/admin.branding.v1/components/branding-page-layout.tsx
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10427 +/- ##
=======================================
Coverage 72.62% 72.62%
=======================================
Files 469 469
Lines 70633 70633
Branches 453 484 +31
=======================================
Hits 51300 51300
- Misses 19037 19040 +3
+ Partials 296 293 -3 🚀 New features to boost your workflow:
|
…s when first page is M2M-heavy
9d5310e to
39e7fb8
Compare
Purpose
Fixes the application dropdown on the Branding page (
/console/branding, Application mode) not showing all non-M2M applications when the first page of results is M2M-heavy.Related Issue
Root cause
The dropdown uses
react-infinite-scroll-component, which fires itsnext()callback only on a scroll event. M2M apps are filtered out client-side, so when the first API page is M2M-heavy (e.g. 7 M2M + 3 OIDC) only a few options remain visible — too few to overflow the 250px listbox. With no overflow there is no scroll,next()never fires, and applications on later pages (e.g. SAML apps) are permanently unreachable.Solution
Added a
useEffectthat, while the dropdown is open, measures whether the scroll container actually overflows (scrollHeight <= clientHeight) once its options are laid out, and proactively loads the next page until the container can scroll or there are no more pages. This measures the real overflow rather than estimating from a fixed item count/height, and gates re-fetching onshouldFetchApplications/isValidatingto avoid duplicate requests.Testing
Verified on a tenant seeded with 3 SAML, 7 M2M and 3 OIDC apps (page 1 = 3 OIDC + 7 M2M, page 2 = 5 SAML): the dropdown now auto-loads later pages and shows all OIDC and SAML apps with no manual scroll, while M2M apps remain filtered out.