Tweak empty page settings to make them more uniform.

This commit is contained in:
Jim Lancaster
2026-08-07 09:10:03 -05:00
parent fce7107863
commit 21a7e83563
5 changed files with 9 additions and 7 deletions
@@ -42,7 +42,7 @@ def render_documents_table(rows: Sequence[DocumentTableRow]) -> None:
"""Render documents table with search filtering and custom type chips.""" """Render documents table with search filtering and custom type chips."""
if not rows: if not rows:
with archival_card(extra_classes="p-8 text-center"): with archival_card(extra_classes="p-8 text-center"):
render_empty_state("No documents in repository yet.") render_empty_state("No documents found in repository.")
return return
table = build_table( table = build_table(
@@ -57,7 +57,7 @@ def render_jobs_table(rows: Sequence[JobTableRow]) -> None:
"""Render jobs table with search filtering and custom status chips.""" """Render jobs table with search filtering and custom status chips."""
if not rows: if not rows:
with archival_card(extra_classes="p-8 text-center"): with archival_card(extra_classes="p-8 text-center"):
render_empty_state("No active or historical processing jobs found.") render_empty_state("No job records found in repository.")
return return
table = build_table( table = build_table(
@@ -48,7 +48,7 @@ def render_sources_table(rows: Sequence[SourceTableRow]) -> None:
"""Render sources table and open detail page when clicking a row.""" """Render sources table and open detail page when clicking a row."""
if not rows: if not rows:
with archival_card(extra_classes="p-8 text-center"): with archival_card(extra_classes="p-8 text-center"):
render_empty_state("No source file records found.") render_empty_state("No source file records found in repository.")
return return
table = build_table( table = build_table(
+4 -4
View File
@@ -13,6 +13,7 @@ from transcription.ui.components.app_shell import render_navigation_header
from transcription.ui.components.cards import archival_card from transcription.ui.components.cards import archival_card
from transcription.ui.components.error_presenter import show_error from transcription.ui.components.error_presenter import show_error
from transcription.ui.components.primitives import section_header_row from transcription.ui.components.primitives import section_header_row
from transcription.ui.components.primitives import render_empty_state
from transcription.ui.theme import page_header from transcription.ui.theme import page_header
from ...db.session import SessionFactoryDep from ...db.session import SessionFactoryDep
@@ -56,12 +57,11 @@ async def sources_page(
with ui.column().classes("w-full max-w-7xl mx-auto p-6 gap-6"): with ui.column().classes("w-full max-w-7xl mx-auto p-6 gap-6"):
with section_header_row(): with section_header_row():
page_header(header_title, subtitle="Manage digitized source pages, raw OCR transcripts, and human revisions.") page_header(header_title)
if not sources: if not sources:
with archival_card(title="No Source Assets Found"): with archival_card(extra_classes="p-8 text-center"):
ui.label("No source images or pages match the current filter criteria.").classes("text-sm ui-text-muted mb-4") render_empty_state("No source file records found in repository.")
ui.button("Upload New Documents", on_click=lambda: ui.navigate.to("/jobs/new")).classes("ui-btn-primary")
return return
columns = [ columns = [
+2
View File
@@ -69,6 +69,8 @@ class TestSourcesPageRendering:
assert response.status_code == 200 assert response.status_code == 200
assert "Source Asset Records" in response.text assert "Source Asset Records" in response.text
assert "No Source Assets Found".upper() in response.text.upper() assert "No Source Assets Found".upper() in response.text.upper()
assert "No source asset records found in repository." in response.text
assert "Upload New Documents" not in response.text
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_sources_page_lists_seeded_sources(self, app_client): async def test_sources_page_lists_seeded_sources(self, app_client):