fix: column sort in experiments table#1576
Open
shivoomiess wants to merge 20 commits into
Open
Conversation
shivoomiess
requested review from
ChongJiaChua,
jekabs-karklins and
yoganandaness
and removed request for
a team and
ChongJiaChua
June 15, 2026 13:24
yoganandaness
requested changes
Jun 15, 2026
yoganandaness
requested changes
Jul 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes broken column sorting in the Experiments table by introducing a typed sort-field enum end-to-end (frontend → GraphQL → backend → DB column mapping) and updating UI/test behavior around sortable vs non-sortable columns.
Changes:
- Replaced the experiments
sortFieldGraphQL argument fromStringto a dedicatedExperimentTableSortFieldenum and threaded the type through resolvers/queries/datasources. - Added explicit mappings for sortable fields (UI column field → GraphQL enum → DB column) and disabled sorting for columns not supported at the DB layer.
- Updated Cypress e2e coverage around experiments table sorting interactions and added local debugging configuration/script changes.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/frontend/src/graphql/experiment/getAllExperiments.graphql | Changes sortField variable type to ExperimentTableSortField to match backend typing. |
| apps/frontend/src/components/experiment/ExperimentsTable.tsx | Maps MaterialTable column fields to sort enum values and disables sorting for unsupported columns. |
| apps/e2e/cypress/e2e/experiments.cy.ts | Adds/adjusts e2e coverage for experiments table sorting for multiple roles. |
| apps/backend/src/resolvers/queries/ExperimentsQuery.ts | Introduces ExperimentTableSortField enum and uses it for sortField argument typing. |
| apps/backend/src/queries/ExperimentQueries.ts | Updates getExperiments signature to accept the new sort-field enum. |
| apps/backend/src/datasources/postgres/ExperimentDataSource.ts | Adds enum→DB-column map and uses it to build the SQL ORDER BY. |
| apps/backend/src/datasources/mockups/ExperimentDataSource.ts | Updates mock datasource signature to the new enum sort-field type. |
| apps/backend/src/datasources/ExperimentDataSource.ts | Updates datasource interface signature to the new enum sort-field type. |
| apps/backend/package.json | Adds --inspect=9229 to backend dev for easier debugging. |
| .zed/debug.json | Adds Zed editor debug configurations (currently needs JSON validity fix). |
yoganandaness
requested changes
Jul 21, 2026
yoganandaness
left a comment
Contributor
There was a problem hiding this comment.
Requesting to rename to a branch, which holds the context of the problem statement
yoganandaness
requested changes
Jul 21, 2026
…ice-core into SWAP-5630-fix
yoganandaness
approved these changes
Jul 21, 2026
yoganandaness
requested review from
simonfernandes and
zacharyjhankin
and removed request for
jekabs-karklins
July 21, 2026 13:34
simonfernandes
approved these changes
Jul 22, 2026
shivoomiess
enabled auto-merge (squash)
July 22, 2026 08:56
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.
Description
This PR fixes the issue of column sorting not working properly in the Experiments Table.
Motivation and Context
The column sorting feature in the Experiments Table was not functioning as expected, leading to a less intuitive and potentially confusing user experience. This fix is necessary to ensure that users can sort data in a logical and predictable manner, improving the usability of the table.
Changes
devscript was updated to include the--inspectflag, allowing for easier debugging.ExperimentDataSource.tsfile was updated to include a map of fields that can be sorted. This provides explicit control over which columns can have their sorting functionality enabled.experiments.cy.tse2e test file was updated to include tests for the sorting functionality of each column in the visit table. This ensures that our sorting feature works as expected in the future.How Has This Been Tested?
Fixes Jira Issue
https://jira.ess.eu//browse/SWAP-5630
Depends On
Tests included/Docs Updated?