Skip to content

explorer: facet counts — remaining work after #157/#226 #230

@rdhyee

Description

@rdhyee

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 BY against isamples_202601_sample_facets_v2.parquet
    (5.98M rows) for multi-axis and multi-select-within-axis cases
  • 250 ms debounce, facetCountsReqId cancellation token, .recomputing italic
    loading state, .facet-row.zero dimming 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

Acceptance

  • Decisions recorded on items 1–4
  • Items chosen for implementation broken into sub-issues

Cross-refs: #163, #164, #226. Supersedes #229.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestexplorerInteractive Explorer featuresneeds-discussionRequires team input before implementing

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions