Skip to content

wire up search result sorting - #376

Open
iimpulse wants to merge 1 commit into
redesignfrom
HPO-134-implement-design
Open

wire up search result sorting#376
iimpulse wants to merge 1 commit into
redesignfrom
HPO-134-implement-design

Conversation

@iimpulse

Copy link
Copy Markdown
Member

Implement the four non-default sort options client-side until the search endpoint supports sorting. "Most Relevant" stays as the order the API returned - the sort is non-mutating so switching back restores it.

Identifiers compare with numeric collation so unpadded ids (NCBIGene:2 vs NCBIGene:10) order correctly. Sorted results are recomputed only on data load, tab change and sort change rather than in a getter, to avoid re-sorting on every change detection pass.

Adds Jest coverage for the ordering rules and a stubbed Cypress spec for the dropdown wiring. jsdom has no ResizeObserver, which p-tablist binds in ngAfterViewInit, so test-setup gets a no-op stub.

Implement the four non-default sort options client-side until the search
endpoint supports sorting. "Most Relevant" stays as the order the API
returned - the sort is non-mutating so switching back restores it.

Identifiers compare with numeric collation so unpadded ids (NCBIGene:2 vs
NCBIGene:10) order correctly. Sorted results are recomputed only on data
load, tab change and sort change rather than in a getter, to avoid
re-sorting on every change detection pass.

Adds Jest coverage for the ordering rules and a stubbed Cypress spec for
the dropdown wiring. jsdom has no ResizeObserver, which p-tablist binds in
ngAfterViewInit, so test-setup gets a no-op stub.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant