Redesign the API home page as a navigable table directory - #7174
Open
roed-math wants to merge 3 commits into
Open
Redesign the API home page as a navigable table directory#7174roed-math wants to merge 3 commits into
roed-math wants to merge 3 commits into
Conversation
Group the tables on /api into datasets with human-readable names (so hgcwa etc. are explained), show row counts (free: in-memory meta_tables totals) and short table descriptions (one bulk query of the tables.<name> knowls via a new knowldb.get_table_descriptions), add a client-side filter box and a jump-to-dataset strip, collapse the long usage docs into a <details> block, link the stats and access options pages, and actually hide test tables by default (the show_hidden flag and /api/all were dead code). All existing URLs and machine formats are unchanged. Verified with the flask test client (page loads in ~0.16s warm; all 193 table links resolve; JSON/YAML output unchanged), in a live browser on port 38046 (filter, no-match state and details work with no console errors), sage -python -m pytest lmfdb/api/test_api.py (7 passed) and pyflakes. git merge-tree confirms no conflicts with open PRs #17/#18/#22. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Hide the test tables that use the *_test naming convention as well as those named test_*, so the default directory really omits them; both conventions are covered by a regression test, and the page copy now says "test and auxiliary tables" rather than "test tables", since hidden_collection() also matches auxiliary names. Call the fq dataset "Finite fields": fq_fields stores finite fields (characteristic, degree, conway, polynomial), not function fields. Return the current revision of a description knowl. The new bulk lookup and the existing get_table_description/get_column_descriptions all combined DISTINCT ON (id) with an ascending timestamp, which picks the revision a description was written with rather than the latest one: mf_hecke_cc displayed "Hecke eignvalues", ec_nfcurves an outdated description, and gps_subgroup_search the "not yet updated on this server" placeholder. The three now share a _description_selecter helper that sorts revisions newest first, as get_knowl does, so they cannot drift; which statuses are visible is unchanged. Log the exception when the bulk description query fails instead of silently emptying a column of the page, and add a test that a known description reaches both the table row and the filter metadata. Verified with sage -python -m pytest on lmfdb/api/test_api.py, lmfdb/tests/test_dynamic_knowls.py and lmfdb/tests/test_connection_reset.py (22 passed, 1 skipped); every added assertion was checked to fail with its fix reverted; pyflakes, pylint and ruff clean; /api/ still renders in 0.19s warm and the filter still matches names, topics and descriptions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
I did not try any queries but I do like the redesign and added info. |
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.
Closes #4964.
The /api index was a flat dump of hundreds of table names. This turns it into a directory: tables are grouped into datasets with human-readable topic names (so it is clear what e.g. hgcwa stands for), each table shows its row count and its short description (the
tables.<name>knowl), and a small client-side filter box plus a jump-to-dataset strip make the page searchable (it degrades gracefully without JS).The long query-syntax documentation is collapsed into a details block, the stats and access-options pages are linked from the top and the sidebar, and test tables are now really hidden by default:
/api/all(whoseshow_hiddenflag was previously dead code) shows them.The page stays server-rendered and fast: row counts are the in-memory
meta_tablestotals and all descriptions come from a single bulk knowl query, so there are still no per-table queries at page load. All existing URLs and the JSON/YAML output are unchanged.Verified with the api test suite (7 passed, including two new tests), timing and link checks through the flask test client, and a live browser check of the filter;
git merge-treeconfirms it merges cleanly with the other API PRs in this series (#7153, #7154, #7158).Ported from roed-math#40, where the full write-up and comment history live.
🤖 Generated with Claude Code