Skip to content

Searchable + faceted History browser (HIST.7)#28

Merged
NCCU-Schultz-Lab merged 1 commit into
mainfrom
hist7-searchable-history
Jul 23, 2026
Merged

Searchable + faceted History browser (HIST.7)#28
NCCU-Schultz-Lab merged 1 commit into
mainfrom
hist7-searchable-history

Conversation

@NCCU-Schultz-Lab

Copy link
Copy Markdown
Collaborator

Summary

The History tab was a single flat, time-ordered dropdown with no way to find a past calculation. This adds a client-side search + faceted filter above it (HIST.7 — priority 1 in the current milestone order).

  • Text search by chemical name or formula, type-to-narrow. Name→formula resolution (e.g. benzene finds C6H6 results) via a new curated config.COMMON_NAME_TO_FORMULA map plus exact molecule-library name matches. Both sources are deliberately precise — synonym/substring matching is avoided so benzene can't drag in toluene (synonym) or ethylbenzene (name substring).
  • Facet controls: calc-type chips, method/basis dropdowns, date range, converged-status chips. All facets AND together. A live "N of M shown" count and a clear-all button.
  • refresh_results_browser now caches each result's parsed result.json on app._history_entries, so filtering re-narrows an in-memory list with no per-keystroke disk access.
  • filter_history_entries is a pure function; the library/DB lookup for name resolution lives in the impure apply_history_filter layer.
  • Preserves the existing index-0 placeholder + value-preservation contract; shows an explicit "no matches" option when everything is filtered out.

Notable finding

The bundled QM9-derived library names its simplest molecules by formula (benzene is stored as name C6H6, water as H2O), so a name search can't resolve them via the library — hence the curated map. Substituted rings (toluene, aniline) only carry "benzene" in synonyms, so synonym matching was dropped to avoid false positives.

Testing

  • TestHistoryHardeningHist7 in tests/test_app.py22 tests: pure filter across every facet + AND-combinations + edge cases, name→formula resolution (incl. the toluene/ethylbenzene false-positive guards), and apply_history_filter end-to-end.
  • Full suite green locally (exit 0, 1857 tests, PySCF 2.14.0 present); black + ruff clean via pinned pre-commit.
  • Manual Voilà pass confirmed.

🤖 Generated with Claude Code

The History tab was a single flat, time-ordered dropdown with no way to
find a past calculation. Add a client-side search + faceted filter above it.

- Text search by chemical name or formula, type-to-narrow. Name→formula
  resolution (e.g. "benzene" finds C6H6 results) via a new curated
  config.COMMON_NAME_TO_FORMULA map plus exact molecule-library name matches.
  Both sources are precise: synonym/substring matching is deliberately avoided
  so "benzene" can't drag in toluene or ethylbenzene.
- Facet chips/controls for calc type, method, basis, date range, and
  converged status. All facets AND together.
- refresh_results_browser now caches each result's parsed result.json on
  app._history_entries, so filtering re-narrows an in-memory list with no
  per-keystroke disk access. filter_history_entries is a pure function; the
  library/DB lookup for name resolution lives in the impure apply layer.
- Preserves the existing index-0 placeholder + value-preservation contract;
  shows an explicit "no matches" option when every entry is filtered out.

Tests: TestHistoryHardeningHist7 in tests/test_app.py (22 tests) cover the
pure filter across every facet, name→formula resolution (including the
toluene/ethylbenzene false-positive guards), and apply_history_filter
end-to-end.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@NCCU-Schultz-Lab
NCCU-Schultz-Lab merged commit fcf0c08 into main Jul 23, 2026
5 checks passed
@NCCU-Schultz-Lab
NCCU-Schultz-Lab deleted the hist7-searchable-history branch July 23, 2026 16:22
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