feat(ui): add browser UI at /ui #45
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Minimal Jinja2 + HTMX + Pico CSS browser UI at
/ui. Drop a PDF, pick a registered use case or define one inline (via the PR 1use_case_inlinefield), tweak options, submit, watch the pretty-JSON result via 2s HTMX polling. LAN-only, no auth.Uploads stream to
{tmp_dir}/ui/<uuid>.pdfvia aiofiles with the existingIX_FILE_MAX_BYTEScap. All submissions go through the samejobs_repo.insert_pendingentry point as the REST adapter — no duplicated logic. REST API paths / shapes unchanged.Tests: 8 integration tests (
tests/integration/test_ui_routes.py) cover index, static mount, registered + custom use-case submissions (asserting storeduse_case_inlinefor custom), HTMX redirect header, malformedfields_jsonrejection, fragment rendering for pending and done jobs. Full integration suite still green (41 passing locally against disposable pg container); unit suite 266 passing; ruff clean.New pinned deps:
jinja2,aiofiles,python-multipart.Minimal Jinja2 + HTMX + Pico CSS UI (all CDN, no build step) that lets a user drop a PDF, pick a registered use case or define one inline, tweak OCR/GenAI/provenance options, submit, and watch the pretty-JSON result come back via 2s HTMX polling. Uploads land in {tmp_dir}/ui/<uuid>.pdf via aiofiles streaming with the existing IX_FILE_MAX_BYTES cap. All submissions go through the same jobs_repo.insert_pending entry point the REST adapter uses — no duplicated logic. The REST surface is unchanged. Tests: tests/integration/test_ui_routes.py — 8 cases covering GET /ui, registered + custom use-case submissions (asserting the stored request carries use_case_inline for the custom path), malformed fields_json rejection, and the fragment renderer for pending vs. done. New deps pinned explicitly in pyproject.toml: jinja2, aiofiles, python-multipart (arrive transitively via FastAPI but we own the import surface now). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>