Skip to content

Add a Dataset filter (PanTS / CancerVerse) to advanced search#80

Merged
aperson30 merged 1 commit into
mainfrom
feature/dataset-filter
Jul 18, 2026
Merged

Add a Dataset filter (PanTS / CancerVerse) to advanced search#80
aperson30 merged 1 commit into
mainfrom
feature/dataset-filter

Conversation

@aperson30

Copy link
Copy Markdown
Collaborator

Why

After the CancerVerse backend merged (#78), CV cases were still unreachable from the dashboard: /api/search defaults to the backend's PanTS-only mode, and CV's complete:false sorts them last under quality sort. This adds a Dataset section to advanced filters so users can actually see/filter CancerVerse.

What

A new Dataset filter (multi-select, same UI pattern as Sex/Age — an Any pill + PanTS + CancerVerse), placed first in the advanced-filters panel. Wired through the existing buildSearchParams to the backend's ?dataset= param:

Selection ?dataset=
none / both (Any) all (show everything — default)
PanTS only pants
CancerVerse only cancerverse
  • helpers/search.tsdataset added to SearchFilters / EMPTY_FILTERS / MultiFilterKey; mapping in buildSearchParams, round-trip in parseFiltersFromParams, and countActiveFilters counts it only when it restricts to one dataset.
  • routes/Homepage.tsxDATASET_OPTIONS + the Dataset section.
  • helpers/search.test.ts — dataset round-trip + mapping coverage.

Backward-compatible

select_dataset_df on the backend returns PanTS-only for ?dataset=all when CancerVerse isn't loaded, so defaulting to all is a no-op until the CV env vars are set on the server — then both datasets appear (PanTS first by quality sort, CV after).

Testing

  • tsc -b clean
  • 102/102 frontend tests pass (added dataset mapping + round-trip cases)

CancerVerse cases were unreachable from the dashboard: search defaulted to the
backend's PanTS-only mode, and their complete:false sorts them last under
quality sort. Add a Dataset section to advanced filters (multi-select, same
pattern as Sex/Age) mapped to the backend ?dataset= param:
  - none / both selected -> dataset=all (show everything; default)
  - PanTS only           -> dataset=pants
  - CancerVerse only      -> dataset=cancerverse

Backward-compatible: the backend serves PanTS-only for ?dataset=all when
CancerVerse isn't configured, so this is a no-op until the CV env vars are set.
@aperson30
aperson30 merged commit 3581c53 into main Jul 18, 2026
7 checks passed
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