Skip to content

chore: [DHIS2-21515] Improve performance for large option sets#4572

Merged
henrikmv merged 6 commits into
masterfrom
hv/chore/DHIS2-21515_single-select-field-windowing
May 27, 2026
Merged

chore: [DHIS2-21515] Improve performance for large option sets#4572
henrikmv merged 6 commits into
masterfrom
hv/chore/DHIS2-21515_single-select-field-windowing

Conversation

@henrikmv
Copy link
Copy Markdown
Contributor

@henrikmv henrikmv commented May 18, 2026

DHIS2-21515

This change introduces incremental client-side rendering using the onEndReached prop already exposed by @dhis2/ui's SimpleSingleSelect. Options remain fully in-memory (no server-side change), but only a window is mounted at a time:

  • Activates only when filteredOptions.length > 200; smaller option sets render as before.
  • Renders the first 100 options initially; onEndReached appends another 100 as the user scrolls.
  • Window resets to the first 100 on every filter change so search results always start from the top.
  • Selected value is still resolved against the full options array, so it displays correctly even when outside the rendered window.

@henrikmv henrikmv marked this pull request as ready for review May 18, 2026 09:28
@henrikmv henrikmv requested a review from a team as a code owner May 18, 2026 09:28
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

@henrikmv henrikmv added testing and removed testing labels May 18, 2026
@linadhis2
Copy link
Copy Markdown

LGTM from QA perspective, was concentrating on option sets and no regressions spotted.

@henrikmv henrikmv changed the title chore: [DHIS2-21515] Improve performance for large option sets in SingleSelectField chore: [DHIS2-21515] Improve performance for large option sets May 27, 2026
@henrikmv henrikmv added testing and removed testing labels May 27, 2026
@henrikmv henrikmv added testing and removed testing labels May 27, 2026
@sonarqubecloud
Copy link
Copy Markdown

@henrikmv henrikmv merged commit 0494a24 into master May 27, 2026
67 of 69 checks passed
@henrikmv henrikmv deleted the hv/chore/DHIS2-21515_single-select-field-windowing branch May 27, 2026 10:15
@dhis2-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 106.2.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants