Repository navigation
[pending ParakhAI-frontend#441] Sort AI model / evaluation domain dropdowns - #17
Draft
saqibmanan wants to merge 1 commit into
Draft
saqibmanan wants to merge 1 commit into
saqibmanan wants to merge 1 commit into
Conversation
… sort)
Covers the open dev PR that sorts the 'Select AI Model' and 'Evaluation
Domain' dropdowns by label. Gated with pending_pr("ParakhAI-frontend#441")
so it skips until the source PR merges.
Adds a small Page Object gap fill (MODAL_EVALUATION_DOMAIN_DROPDOWN
locator + two NewEvaluationPage helpers) since nothing previously read
that dropdown's options.
Contributor
Author
|
Flagging ahead of time: this PR's E2E Tests job (3 shards) ran against the same dev environment as PR #18, which hit 12 pre-existing E2E failures unrelated to either diff (worker crash in Generated by Claude Code |
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.
Pending: covers open CivicDataLab/ParakhAI-frontend#441 (head
acbf053512e5a2bfa7a87136d2105f74eb5e95c9). Skipped in CI until it merges. Safe to merge before it.Source PR
CivicDataLab/ParakhAI-frontend#441 — open since 2026-07-31, base
dev.What changed (from the diff, not the title)
ModelSelectionModal.tsxandNewEvaluationContent.tsxboth used to render dropdown options in whatever order the API returned them:<select name="modelSelect">(New Evaluation flow, and the Model Selection modal), and<select name="evaluationDomain">(modal step 2,parseDomainOptions) / evaluation-scope options (NewEvaluationContent.tsx).Both are now sorted by visible label via
localeCompare. The PR also flags one side effect worth a look on review:ModelSelectionModal.tsx:367falls back tooptions[0]when the previously-selected domain isn't in a newly fetched list — sorting changes which option that is.Categories added, and why
e2e— this is a UI-behavior change (rendering order of two dropdowns), not an API/schema change, soe2eis the right category per this repo's table. Nosmoke— it's not a critical-path happy-flow test, it's specific to this fix.Tests added
tests/e2e/test_new_evaluation_dropdown_sort.py:test_model_dropdown_options_sorted_alphabetically— opens the New Evaluation modal, reads every "Select AI Model" option label, asserts the list equals itself sorted case-insensitively.test_evaluation_domain_dropdown_options_sorted_alphabetically— advances to modal step 2, tries up to 5 valid models until one renders an "Evaluation Domain" dropdown (it's conditional on the model having a domain with non-empty backend options), then does the same sorted-order assertion.Both skip cleanly (not a false pass) when there's too little live data to distinguish sorted from unsorted (<2 options), or when no candidate model renders the domain dropdown at all.
Page Object gap filled
Nothing previously read the "Evaluation Domain" select's options, so I added:
locators/evaluations_locators.py:MODAL_EVALUATION_DOMAIN_DROPDOWN = "select[name='evaluationDomain']"pages/new_evaluation_page.py:is_modal_evaluation_domain_dropdown_visible(),get_modal_evaluation_domain_options()No raw selectors in the test file — both new locators/methods follow the existing
MODAL_MODEL_DROPDOWN/get_modal_model_options()pattern.Why this approach catches the actual regression, not just a flipped assertion
The assertion is
labels == sorted(labels, key=casefold), notis_sorted-with-a-flip. Against the pre-fix code (API order), this only passes by coincidence if the live API response happens to already be alphabetical — which is the same limitation any "order" test built on live dev data has (noted honestly below), but it is still a real behavioral check, not a tautology.Red/green proof — UNVERIFIED, no credentials in this environment
This is the cloud routine's sweep run; it has no
TEST_EMAIL_1/TEST_PASSWORD_1, so it cannot reach the AI Maker dashboard behind Keycloak login at all (both the modal and the dropdowns are behindauthenticated_page). Collection and thepending_prgate ARE verified locally:(That skip reason came from a real, unauthenticated call to the GitHub API confirming #441 is still open — the hook itself is verified working, not just mocked.)
What a human with credentials must run to get the actual red/green proof:
pending_prmarker, run against dev now → expect FAIL on whichever assertion doesn't hold under current (unsorted) API order.gh pr checkout 441on ParakhAI-frontend, serve locally against the dev API perCivicDataSpace-test'spr-test-syncSKILL.md §6 local-serve recipe, pointBASE_URL/HOME_URL_DEVat the local port → expect PASS.Label on both tests: UNVERIFIED — not executed, no credentials in this cloud sandbox.
Gaps / follow-ups
readonly/prod-gate concerns (§7 of the skill) don't apply yet — this only runs oncedevships it, and ParakhAI_test has noreadonlyprod-gate pattern like CivicDataSpace-test.ModelSelectionModal.tsx:367fallback-selection side effect the PR author flagged — that needs a specific model whose previously-selected domain is no longer first after sorting, which isn't reliably reproducible against live dev data. Flagging as a gap rather than faking it.