Skip to content

explorer: clearing a search does not deterministically restore viewport-scoped counts (needs repro) #286

@rdhyee

Description

@rdhyee

Status: observed, root-cause unconfirmed — tracking issue, not fix-ready.

Cross-refs: #239 (its diagnostics already note "source counts at cold load were global, not viewport-scoped — possibly a separate finding"), #234 (filter-coherence roadmap), #237 (viewport-aware facet counts).

How this surfaced

While writing the PR2 (#11) characterization test (a-) (tests/playwright/explorer-characterization.spec.js, lines ~93–123). The test wanted to assert that clearing a search returns the table to its prior viewport-scoped count, but had to fall back to WORLD view + "total > 1" because — per its own inline comment — "table-total SCOPE shifts between viewport/global/filtered states, so cross-state total comparisons are unreliable." That instability is the smell this issue tracks.

What I could and could NOT verify (static read of explorer.qmd @ 1e27aa2)

  • On clear, clearActiveSearchFilterapplySearchFilterChange() does call refreshSamplesTable() (line ~3714).
  • refreshAll() always applies viewerBboxSQL(latitude, longitude, VIEWPORT_PAD_FACTOR) (line ~2307).
  • So the samples-table path looks correctly viewport-scoped on clear, and I could not reproduce a definite table-scope loss by reading alone.
  • The likelier surface is facet / source counts after clear (cf. explorer: interactive map state can diverge from cold-reload state of the same URL #239's cold-load diagnostic) and/or a timing gap where no moveEnd fires after clear so a viewport-aware recount never re-runs.

What's needed

  1. A concrete repro recipe: zoom to a region → run a world-scoped search → clear it → record which surface (table count, source counts, facet counts) shows global vs. viewport numbers.
  2. Once reproducible, instrument that specific surface's recompute path and identify the event that was expected to fire after clear and didn't.

Acceptance

  • Reproducible repro recipe documented.
  • Root cause traced to a specific surface + event/handler.
  • (Then) clearing a search restores the same viewport-scoped state the user had before searching.

Filed from the PR2 (#11) characterization follow-up; line numbers against explorer.qmd at 1e27aa2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingexplorerInteractive 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