fix: sort AI model and evaluation domain dropdowns alphabetically - #441
Open
anishkb-dev wants to merge 1 commit into
Open
fix: sort AI model and evaluation domain dropdowns alphabetically#441anishkb-dev wants to merge 1 commit into
anishkb-dev wants to merge 1 commit into
Conversation
anishkb-dev
force-pushed
the
fix/sort-dropdowns-380-379
branch
from
August 8, 2026 07:46
a30f063 to
acbf053
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #379
Fixes #380
The "Select AI Model" and "Evaluation Domain" dropdowns rendered options in whatever order the API returned them. Both are now sorted by their visible label with
localeCompare, in the New Evaluation flow and the Model Selection modal.localeComparerather than a plain<comparison so that case doesn't split the list — with<, every model whose name starts with a capital sorts above every model that starts with a lowercase letter. Checked against API-shaped sample data:One behaviour change beyond ordering, worth a look before merging:
ModelSelectionModal.tsx:367falls back tooptions[0]when the currently selected domain isn't present in the newly fetched list. Sorting changes which entry that is — it's now the alphabetically first domain rather than whichever one the API happened to return first. I think that's the better default, since it matches the entry the user sees at the top of the dropdown, but it does mean the pre-selected domain can differ from before for the same API response. Easy to pin to the original order if you'd rather it didn't move.Verified with
npx tsc --noEmitand a fullnext build. No manual click-through — this environment has no Keycloak or backend credentials, so I couldn't reach the evaluation screens in a running instance.