Skip to content

fix: sort AI model and evaluation domain dropdowns alphabetically - #441

Open
anishkb-dev wants to merge 1 commit into
CivicDataLab:devfrom
anishkb-dev:fix/sort-dropdowns-380-379
Open

fix: sort AI model and evaluation domain dropdowns alphabetically#441
anishkb-dev wants to merge 1 commit into
CivicDataLab:devfrom
anishkb-dev:fix/sort-dropdowns-380-379

Conversation

@anishkb-dev

@anishkb-dev anishkb-dev commented Jul 31, 2026

Copy link
Copy Markdown

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.

localeCompare rather 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:

['Airavata', 'apple-model', 'BharatGPT', 'zephyr-7b']

One behaviour change beyond ordering, worth a look before merging: ModelSelectionModal.tsx:367 falls back to options[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 --noEmit and a full next 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.

@anishkb-dev
anishkb-dev changed the base branch from main to dev July 31, 2026 18:31
@anishkb-dev
anishkb-dev force-pushed the fix/sort-dropdowns-380-379 branch from a30f063 to acbf053 Compare August 8, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The dropdown to select evaluation domain is not sorted alphabetically The dropdown to select AI model is not sorted alphabetically

1 participant