Searchable + faceted History browser (HIST.7)#28
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).
benzenefindsC6H6results) via a new curatedconfig.COMMON_NAME_TO_FORMULAmap plus exact molecule-library name matches. Both sources are deliberately precise — synonym/substring matching is avoided sobenzenecan't drag intoluene(synonym) orethylbenzene(name substring).refresh_results_browsernow caches each result's parsedresult.jsononapp._history_entries, so filtering re-narrows an in-memory list with no per-keystroke disk access.filter_history_entriesis a pure function; the library/DB lookup for name resolution lives in the impureapply_history_filterlayer.Notable finding
The bundled QM9-derived library names its simplest molecules by formula (benzene is stored as name
C6H6, water asH2O), 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
TestHistoryHardeningHist7intests/test_app.py— 22 tests: pure filter across every facet + AND-combinations + edge cases, name→formula resolution (incl. the toluene/ethylbenzene false-positive guards), andapply_history_filterend-to-end.🤖 Generated with Claude Code