Skip to content

feat(discover): activate channel density + montage filter - #137

Merged
neuromechanist merged 2 commits into
mainfrom
feature/activate-channel-montage-filter
Jun 29, 2026
Merged

neuromechanist merged 2 commits into
mainfrom
feature/activate-channel-montage-filter

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Activates the previously-guarded Channels & montage filter on /discover, now that api.nemar.org returns n_channels + electrode_system on every catalog row (nemar-cli#854, backfill converged on prod).

  • Channel density select -> n_channels range presets: Low (≤32), Standard (33–64), High (65–128), High-density (129+). URL param density.
  • Electrode system select -> exact class match: 10-20 / 10-10 / 10-05 / BioSemi / EGI geodesic / Other. URL param es.
  • Both filter client-side over the full server-prefiltered set (the catalog API has no server-side param for either — verified prod, count unchanged), reusing the existing listAllDatasets + needsClientPaging path so the count and pager stay honest.
  • Disabled while a search query is active (same treatment as the license filter), since the hybrid search projection carries no channel facts.

Null-safety

applyClientFilters distinguishes undefined (reduced search projection — skip the predicate, can't evaluate) from null (known to have no scalp montage — excluded by a positive filter). Raw c_min/c_max still work for power users; the density preset takes precedence when both are set.

Backend context

Consumer side of nemar-cli#854 (closed; feature delivered + prod backfill converged: 392/575 EEG-matching datasets classified). The residual unpopulated rows are diagnosed in nemar-cli#867 (iEEG predicate over-match, orphaned nm0002xx repo pointers, annexed/sparse channels.tsv) — they correctly fall out of these filters as "no resolvable montage".

Test plan

  • bun run test — 634 pass (added density/es URL round-trip + applyClientFilters density/range/electrode/AND/undefined-guard cases)
  • bun run typecheck — 0 errors
  • bun run lint — clean
  • bun run build — compiles

Also collapses one biome-reflowed line in standard-montage.test.ts (pre-existing format debt from #136) to keep lint green.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 29, 2026 •

Copy link
Copy Markdown

Deploying nemar-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8d10c42
Status: ✅  Deploy successful!
Preview URL: https://f9d5714c.nemar-website.pages.dev
Branch Preview URL: https://feature-activate-channel-mon.nemar-website.pages.dev

View logs

@neuromechanist
neuromechanist merged commit 64c190d into main Jun 29, 2026
1 check passed
@neuromechanist
neuromechanist deleted the feature/activate-channel-montage-filter branch September 30, 2026 19:25
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