Repository navigation
feat(app): persistent results and multi-slot cache in the Streamlit app - #61
Merged
Merged
Conversation
- keep the rendered result in st.session_state["last_render"] instead of writing widgets inside the lookup callback: results now survive plain script re-runs (e.g. websocket reconnects), and clearing the input cleanly removes the result - cache lookups per (identifier, arxiv2doi, format) instead of a single slot: switching between formats of the same identifier no longer re-queries the network, and cached bibtex entries are re-rendered locally when alignment / capitalize_title change - do_lookup() is now a pure session-state writer and rendering happens unconditionally from the stored state; the confirm-flag dance with the divider is gone - add AppTest-based regression tests (test/test_streamlit_app.py) covering enter-to-search, sidebar re-renders without network, format round trips, persistence across re-runs, and the redirect / error / exception paths
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #61 +/- ##
=======================================
Coverage 98.61% 98.61%
=======================================
Files 13 13
Lines 1944 1944
=======================================
Hits 1917 1917
Misses 27 27 ☔ View full report in Codecov by Harness. |
Older streamlit releases (resolved on Python 3.9 in CI) ship streamlit.testing without the v1 submodule; name the full module in importorskip so collection skips cleanly instead of erroring.
- Python 3.9 (EOL 2025-10) and 3.10 (EOL 2026-10) are dropped from requires-python, the classifiers, and the pytest matrix; the current dependency ecosystem (streamlit >= 1.66, pandas 3.x, numpy 2.3) already requires >= 3.11, so 3.9/3.10 users only ever got a stale dependency set - add Python 3.14 to the pytest matrix (it was already claimed in the classifiers but never tested) - keep the streamlit app tests skippable on interpreters whose resolved streamlit lacks streamlit.testing.v1
kjs11
enabled auto-merge
November 1, 2026 03:45
kjs11
approved these changes
Nov 1, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 1, 2026
kjs11
approved these changes
Nov 1, 2026
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 Streamlit app already supported enter-to-search and sidebar changes re-triggering the lookup (via the
confirmed_doiflag pattern from 047bd24), but AppTest-based behavioral testing surfaced four real gaps, all fixed here:Changes (
streamlit_app.py, no package code touched)do_lookup()is now a pure session-state writer: it stores alast_renderdescriptor (success / error / redirect) inst.session_state, and rendering happens unconditionally from that state afterwards. Results survive re-runs; empty input cleanly clears the result.(identifier, arxiv2doi, format)(multi-slot). Cached bibtex entries are re-rendered locally via_to_bib_itemwhen alignment /capitalize_titlechange — zero network calls.BibLookup.__REDIRECT_FLAG__and the"visit: "marker in one place.Support matrix (follow-up to the 3.9 CI failure this PR hit)
Python 3.9 has been EOL since 2025-10 and 3.10 since 2026-10, and the current dependency ecosystem (streamlit ≥ 1.66, pandas 3.x, numpy 2.3) already requires ≥ 3.11 — the 3.9 CI job was resolving a stale streamlit without
streamlit.testing.v1. This PR raises the floor:requires-python = ">=3.11"; classifiers drop 3.9/3.10["3.11", "3.12", "3.13", "3.14"]— 3.14 was already claimed in the classifiers but never tested; now it isTests
New
test/test_streamlit_app.py(8 tests) uses the official Streamlit AppTest framework withBibLookup.__call__stubbed (no network):Full suite: 104 passed (96 + 8 new) locally; the AppTests run in CI (the
devextra already includes streamlit).