Skip to content

explorer: be honest that the samples table is not filtered by free-text search (#247)#250

Merged
rdhyee merged 1 commit into
isamplesorg:mainfrom
rdhyee:fix/search-table-meta-honesty
May 29, 2026
Merged

explorer: be honest that the samples table is not filtered by free-text search (#247)#250
rdhyee merged 1 commit into
isamplesorg:mainfrom
rdhyee:fix/search-table-meta-honesty

Conversation

@rdhyee
Copy link
Copy Markdown
Contributor

@rdhyee rdhyee commented May 29, 2026

What

Interim honesty fix for #247: free-text search is not yet a filter on the main samples table. After a search the camera flies and the table fills with whatever is in the new viewport — e.g. searching bucchero (Etruscan pottery) flies to Tuscany and the table then shows 43,803 GEOME marine mollusks while the meta line claims they "match the current filters." The actual search results sit in the side panel.

This PR makes the UI honest about what the table is showing. It does not change any SQL / query / filter behavior — the real fix (search as a global filter across table/globe/counts) is #234 Step 4 / axis A1, deferred because it touches every count surface and may want the FTS substrate (#168–172) first for scale. See the analysis + Claude⇄Codex consensus in #247.

Changes (all in explorer.qmd)

  • summaryText() — when a search is committed, the table meta now reads e.g.

    "43,803 samples in this map view and current non-search filters. Search results for "bucchero" are shown in the panel →"

    instead of "43,803 samples match the current filters." The "non-search filters" wording deliberately marks this as pre-A1 behavior (per Codex review) so it doesn't quietly redefine what A1 will mean. No active search → unchanged copy.

  • doSearch() — maintains window.__explorerActiveSearch (committed term, or null on empty/too-short submit) as the cross-OJS-cell signal summaryText() reads, and nudges window.refreshSamplesTable?.() after commit/clear so the meta updates even for area-scope searches that don't move the camera.

  • Side panel — the search-results heading is now prominent + sticky (within #samplesSection's own scroll box; no page/camera scroll), so it reads unmistakably as the search results the meta points at. A shared heading helper now also paints the zero-result and error panel states, so the "→ panel" pointer is never left pointing at stale/empty content.

Verification

  • quarto render explorer.qmd clean; git diff --check clean.
  • Live on rdhyee staging (canonical repro URL): __explorerActiveSearch="bucchero", search telemetry error:null / 50 of 2,693, side panel shows the 50 real Poggio Civitate hits under the sticky heading, no console errors.
  • Table-meta count is gated only on the (pre-existing, cold-cache-slow) samples_map_lite fetch; the honesty string is deterministic given the committed-search flag, which is confirmed set.

Staging: https://rdhyee.github.io/isamplesorg.github.io/explorer.html?search=bucchero&sources=OPENCONTEXT%2CGEOME%2CSMITHSONIAN#v=1&lat=40.8958&lng=5.2905&alt=3048966

Provenance

Claude; Codex 2-round review — round 1 reached the ship-ad-hoc-fix-now / A1-later consensus on #247; round 2 reviewed this diff and caught that the active-search flag stayed set on zero-result/error searches (the panel pointer would lie), now fixed by painting those panel states + the refresh nudge. Empirically verified on staging.

Closes #247 (interim); real fix tracked under #234 Step 4 / A1.

🤖 Generated with Claude Code

…ples "match the current filters" during a search (isamplesorg#247)

Free-text search is not yet a table/globe predicate (that's isamplesorg#234 Step 4 /
axis A1). Until A1 lands, a committed search (e.g. "bucchero") flies the
camera and the samples table then fills with whatever is in the new
viewport — e.g. 43,803 GEOME marine mollusks — while labeling them "match
the current filters." Actively misleading; the actual search results sit in
the side panel.

Interim honesty fix only — no change to the search substrate or any query:
- summaryText(): when a search is committed, disclose that the table
  reflects the map view + source/facet filters only, and point to the side
  panel ("…Search results for \"X\" are shown in the panel →").
- doSearch(): maintain window.__explorerActiveSearch (committed term, or
  null on empty/too-short submit) as the cross-cell signal summaryText reads.
- samplesSection: make the search-results heading prominent and sticky so it
  reads unmistakably as the search results. No page/camera scroll (per Codex
  review — behavior, not copy).

Real fix (search as a global filter across table/globe/counts) tracked as
isamplesorg#234 Step 4 / A1; may want the FTS substrate (isamplesorg#168-172) first for scale.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

explorer: free-text search does not filter the main samples table — "N match the current filters" shows unrelated samples (A1 gap)

1 participant