Stop the index provenance from stalling the first Database visit
Browse filesThe provenance JSON in "Browse the index and its sources" carried the manifest's full assembly list: 33,722 accessions, 640 KB of the 0.7 MB page config. Gradio's JSON viewer turns that into about 200,000 DOM nodes, and it builds a tab on first visit, so the first switch from the atlas to Database took **3.8 s** on the live Space while later switches took 25 ms.
The list is now shown as its length. The other fields are unchanged, and the search box already answers "is this assembly indexed".
🤖 Generated with [Claude Code](https://claude.com/claude-code)
app.py
CHANGED
|
@@ -220,7 +220,11 @@ def build_app(catalog=None):
|
|
| 220 |
+ (f"Annotations load on demand from {catalog.manifest.get('source_count', len(catalog.manifest['sources']))} bucket files. "
|
| 221 |
f"Index updated {catalog.manifest['created_at'][:10]}." if remote_mode else "Offline sample."), elem_classes="quiet-note")
|
| 222 |
gr.Dataframe(value=display_table(all_ids), interactive=False, show_label=False)
|
| 223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
|
| 225 |
found = [status, results, hits, selected, file]
|
| 226 |
shown = [metadata, start, end, plot, note, file]
|
|
|
|
| 220 |
+ (f"Annotations load on demand from {catalog.manifest.get('source_count', len(catalog.manifest['sources']))} bucket files. "
|
| 221 |
f"Index updated {catalog.manifest['created_at'][:10]}." if remote_mode else "Offline sample."), elem_classes="quiet-note")
|
| 222 |
gr.Dataframe(value=display_table(all_ids), interactive=False, show_label=False)
|
| 223 |
+
# The manifest lists every indexed assembly, 33,722 of them. Rendered
|
| 224 |
+
# as a JSON tree that is ~200k DOM nodes, which Gradio builds on the
|
| 225 |
+
# first visit to this tab: a 3.8 s stall. The count says the same.
|
| 226 |
+
gr.JSON(value={k: len(v) if k == "assemblies" else v for k, v in catalog.manifest.items()},
|
| 227 |
+
label="Index provenance" if remote_mode else "Sample provenance")
|
| 228 |
|
| 229 |
found = [status, results, hits, selected, file]
|
| 230 |
shown = [metadata, start, end, plot, note, file]
|