From fce71078638e6929001da9e38217154bbcca2774 Mon Sep 17 00:00:00 2001 From: Jim Lancaster <40281233+zoltan57@users.noreply.github.com> Date: Thu, 6 Aug 2026 16:53:21 -0500 Subject: [PATCH] Remove all references to "uploads" page --- src/transcription/ui/__init__.py | 2 -- src/transcription/ui/components/app_shell.py | 2 +- src/transcription/ui/pages/sources_page.py | 2 +- src/transcription/ui/pages/upload_page.py | 20 -------------------- tests/test_ui_theme.py | 1 - tests/ui/test_navigation_and_mounts.py | 1 - tests/ui/test_pages_registration.py | 2 -- tests/ui/test_upload_page.py | 11 ++--------- 8 files changed, 4 insertions(+), 37 deletions(-) delete mode 100644 src/transcription/ui/pages/upload_page.py diff --git a/src/transcription/ui/__init__.py b/src/transcription/ui/__init__.py index e1f17c2..a105398 100644 --- a/src/transcription/ui/__init__.py +++ b/src/transcription/ui/__init__.py @@ -8,7 +8,6 @@ from transcription.ui.pages.documents_page import register_page as register_docu from transcription.ui.pages.jobs_page import register_page as register_jobs_page from transcription.ui.pages.people_page import register_page as register_people_page from transcription.ui.pages.sources_page import register_page as register_sources_page -from transcription.ui.pages.upload_page import register_page as register_upload_page from transcription.ui.resources import read_css from transcription.ui.theme import apply_archival_theme @@ -29,7 +28,6 @@ def register_pages(app: FastAPI) -> None: """Register all NiceGUI pages and mount them onto the FastAPI app.""" _register_global_styles(app) register_home_page() - register_upload_page() register_documents_page() register_people_page() register_sources_page() diff --git a/src/transcription/ui/components/app_shell.py b/src/transcription/ui/components/app_shell.py index e0c18bb..9595b6a 100644 --- a/src/transcription/ui/components/app_shell.py +++ b/src/transcription/ui/components/app_shell.py @@ -50,7 +50,7 @@ def render_app_shell(*, current_path: str | None = None) -> None: normalized_path = _normalize_path(current_path) with ui.header().classes("app-shell"), ui.element("div").classes("app-shell__inner"): - with ui.element("a").props('href="/homepage"').style( + with ui.element("a").props('href="/ui/homepage"').style( "display:flex; align-items:center; gap:0.75rem; text-decoration:none; color:inherit;" ).classes("app-shell__brand no-wrap"): ui.html(VIBESCRIBE_LOGO_SVG).classes("app-shell__brand-mark") diff --git a/src/transcription/ui/pages/sources_page.py b/src/transcription/ui/pages/sources_page.py index 033cc30..8600f51 100644 --- a/src/transcription/ui/pages/sources_page.py +++ b/src/transcription/ui/pages/sources_page.py @@ -61,7 +61,7 @@ async def sources_page( if not sources: with archival_card(title="No Source Assets Found"): ui.label("No source images or pages match the current filter criteria.").classes("text-sm ui-text-muted mb-4") - ui.button("Upload New Documents", on_click=lambda: ui.navigate.to("/upload")).classes("ui-btn-primary") + ui.button("Upload New Documents", on_click=lambda: ui.navigate.to("/jobs/new")).classes("ui-btn-primary") return columns = [ diff --git a/src/transcription/ui/pages/upload_page.py b/src/transcription/ui/pages/upload_page.py deleted file mode 100644 index c510569..0000000 --- a/src/transcription/ui/pages/upload_page.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Upload page registration and handlers.""" - -from __future__ import annotations - -from fastapi import Request -from fastapi.responses import RedirectResponse -from starlette import status -from nicegui import ui - -from transcription.ui.components.app_shell import render_navigation_header - - -def register_page() -> None: - """Register the upload page route.""" - - @ui.page("/upload", title="Upload Document") - def upload_page(request: Request) -> RedirectResponse: - _ = request - render_navigation_header(current_path="/upload") - return RedirectResponse(url="/jobs/new", status_code=status.HTTP_307_TEMPORARY_REDIRECT) diff --git a/tests/test_ui_theme.py b/tests/test_ui_theme.py index 5003d2f..e5bd702 100644 --- a/tests/test_ui_theme.py +++ b/tests/test_ui_theme.py @@ -16,7 +16,6 @@ def test_page_registration_uses_vibescribe_theme(monkeypatch): run_options: dict[str, object] = {} monkeypatch.setattr("transcription.ui.ui.add_css", lambda css, **_kwargs: registered_css.append(css)) - monkeypatch.setattr("transcription.ui.register_upload_page", lambda: None) monkeypatch.setattr("transcription.ui.register_jobs_page", lambda: None) monkeypatch.setattr( "transcription.ui.ui.run_with", diff --git a/tests/ui/test_navigation_and_mounts.py b/tests/ui/test_navigation_and_mounts.py index c3e6c0f..9c612d8 100644 --- a/tests/ui/test_navigation_and_mounts.py +++ b/tests/ui/test_navigation_and_mounts.py @@ -12,7 +12,6 @@ class TestNavigationAndMounts: [ ("/", 307, "/ui/homepage"), ("/ui", 307, "/ui/homepage"), - ("/ui/upload", 307, "/jobs/new"), ], ) def test_entrypoint_redirects(self, app_client, url: str, expected_status: int, expected_redirect: str): diff --git a/tests/ui/test_pages_registration.py b/tests/ui/test_pages_registration.py index cc92b35..2e3ace6 100644 --- a/tests/ui/test_pages_registration.py +++ b/tests/ui/test_pages_registration.py @@ -12,14 +12,12 @@ class TestPageRegistration: _, client = app_client homepage_response = client.get("/ui/homepage") - upload_response = client.get("/ui/upload", follow_redirects=False) documents_response = client.get("/ui/documents") people_response = client.get("/ui/people") sources_response = client.get("/ui/sources") jobs_response = client.get("/ui/jobs") assert homepage_response.status_code == 200 - assert upload_response.status_code == 307 assert documents_response.status_code == 200 assert people_response.status_code == 200 assert sources_response.status_code == 200 diff --git a/tests/ui/test_upload_page.py b/tests/ui/test_upload_page.py index d6e5620..1031bf1 100644 --- a/tests/ui/test_upload_page.py +++ b/tests/ui/test_upload_page.py @@ -1,11 +1,11 @@ -"""Tests for upload and entry-point routes.""" +"""Tests for homepage and entry-point routes.""" import pytest @pytest.mark.integration class TestPageRendering: - """Verify upload-related routes return working pages.""" + """Verify entry-point routes return working pages.""" def test_root_redirects_to_ui(self, app_client): """GET / redirects to the UI mount point.""" @@ -42,10 +42,3 @@ class TestPageRendering: assert "Edit Home Page" in response.text assert "Homepage markdown" in response.text - def test_upload_page_renders_expected_controls(self, app_client): - """GET /ui/upload redirects to the job-create flow.""" - _, client = app_client - response = client.get("/ui/upload", follow_redirects=False) - - assert response.status_code == 307 - assert response.headers["location"] == "/jobs/new"