Skip to content

fix(website): pass order property to download dialog field selector - #6179

Merged
anna-parker merged 1 commit into
mainfrom
fix/download-field-order
Mar 23, 2026
Merged

fix(website): pass order property to download dialog field selector#6179
anna-parker merged 1 commit into
mainfrom
fix/download-field-order

Conversation

@theosanderson-agent

@theosanderson-agent theosanderson-agent commented Mar 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

The download dialog's field selector was missing the order property when constructing FieldItem[] arrays from schema metadata. This caused fields and section groups to appear in arbitrary order (based on insertion order) instead of matching the configured order used by both the search form and customize columns modals.

The fix adds order: field.order to the field item mapping in website/src/components/SearchPage/DownloadDialog/FieldSelector/FieldSelectorModal.tsx, ensuring all three field selector modals display metadata in the same consistent order.

Closes #6178

Test plan

  • Open the download dialog's field selector and verify sections/fields appear in the same order as the customize columns and search field selectors

🤖 Generated with Claude Code

🚀 Preview: https://fix-download-field-order.loculus.org

The download dialog's field selector was missing the `order` property
when constructing FieldItem arrays, causing fields and sections to
appear in arbitrary order instead of matching the configured order
used by the search form and customize columns modals.

Closes #6178

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude claude Bot added the website Tasks related to the web application label Mar 23, 2026
@anna-parker anna-parker added the preview Triggers a deployment to argocd label Mar 23, 2026

@anna-parker anna-parker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing thanks!

@anna-parker
anna-parker marked this pull request as ready for review March 23, 2026 15:50
@claude

claude Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

Claude finished @anna-parker's task in 36s —— View job


Code Review

  • Read changed file and common field selector modal
  • Analyze fix correctness

The fix is correct and minimal. The common FieldSelectorModal sorts fields within groups by order (line 97 of common/FieldSelectorModal.tsx) and sorts groups by their mean order (line 107). Without order: field.order being passed, all values would be undefined, causing every field to sort to Number.POSITIVE_INFINITY — meaning insertion order was preserved but group ordering was also broken.

The one-line addition resolves both the per-group field ordering and the inter-group header ordering. No other callers of this component are affected since this is the download dialog's own wrapper.

No issues found. LGTM.

@anna-parker
anna-parker merged commit ceb5192 into main Mar 23, 2026
68 checks passed
@anna-parker
anna-parker deleted the fix/download-field-order branch March 23, 2026 15:55
@theosanderson

Copy link
Copy Markdown
Member

doesn't matter for this one, but for any slightly bigger PRs we should generally keep to our policy of having two human eyes see it

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

Labels

preview Triggers a deployment to argocd website Tasks related to the web application

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metadata section order differs between customize columns(= add search fields) and download all entries-> metadata

3 participants