Repository navigation
explorer: facet counts — remaining work after #157/#226 #230
Description
Context
Cross-filter facet counts are already shipped (commit 7cee6a4, 2026-05-01).
The current implementation:
- Cube fast-path for single-axis-single-value selections (reads
isamples_202601_facet_cross_filter.parquet, 526 cells) - Live DuckDB-WASM
GROUP BYagainstisamples_202601_sample_facets_v2.parquet
(5.98M rows) for multi-axis and multi-select-within-axis cases - 250 ms debounce,
facetCountsReqIdcancellation token,.recomputingitalic
loading state,.facet-row.zerodimming when count = 0
See explorer.qmd lines 2589-2705 + 977-997 for the implementation.
This issue tracks what's not yet covered.
Open work
1. Bbox-aware counts (design question)
Counts today are global. The legend says "OpenContext: 312,887" regardless of
viewport. In-map H3 summary tiles already show in-viewport counts. Should the
legend mirror that? (Lean: keep legend global — H3 tiles are the viewport-scoped
surface.)
2. Text-search-aware counts
When a search term is active, should facet counts reflect only matching samples?
The facets_url parquet has label, description, place_name columns — an
ILIKE predicate plugs into buildCrossFilterWhere cleanly. Decision needed
on whether to actually do it.
3. Hierarchical concept rollup
context = earthinterior is a sub-concept of anysampledfeature. Does the cube
roll children up to parents, or are counts strictly leaf-level? Need to inspect
the cube generation pipeline and verify against the live query path's behavior.
The two paths could disagree — that's a silent correctness bug.
4. Non-canonical axes
Cube schema covers only source / material / context / object_type. If the
explorer adds project / site / curation-location facets (issue #161 territory),
the cube needs schema migration or those axes fall back to live query only.
Worth deciding the contract before the next axis lands.
5. UX polish (lower priority)
- Threshold for showing "…" instead of just italic on slow queries
- Mobile collapse of long facet lists with counts
- "Reset" affordance when a user has heavily filtered
Out of scope
- Refactoring
explorer.qmd(Interactive Explorer rethink: architecture review + UX/feature backlog #163 territory) - Cube generation pipeline (separate repo)
Acceptance
- Decisions recorded on items 1–4
- Items chosen for implementation broken into sub-issues
Activity
rdhyee commentedon Jul 22, 2026
Superseded/absorbed: remaining facet-count work after #157/#226 either landed (mask index, manifest #317, padded-viewport parity — regression-tested via PR #245) or is documented in #305's parking note. — rbotyee 🤖 (Claude, for @rdhyee)