From 76352b8a54c1ead09be22c501abb9a5abd0f5054 Mon Sep 17 00:00:00 2001 From: McElwain Date: Sat, 9 May 2026 15:14:18 -0500 Subject: [PATCH] Persist replica UI and layout OCR integration changes --- app/db/base.py | 1 + app/templates/documents/detail.html | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/db/base.py b/app/db/base.py index 59be703..dbd820b 100644 --- a/app/db/base.py +++ b/app/db/base.py @@ -1,3 +1,4 @@ from sqlalchemy.orm import declarative_base Base = declarative_base() +import app.models.document_analysis_version diff --git a/app/templates/documents/detail.html b/app/templates/documents/detail.html index 810e9b5..b156aa2 100644 --- a/app/templates/documents/detail.html +++ b/app/templates/documents/detail.html @@ -89,7 +89,11 @@ document.addEventListener("DOMContentLoaded", () => {
OCR rerun failed.
{% elif error == "deprecated_pdf_route_disabled" %}
This deprecated PDF save route has been disabled. Use Save Document instead.
- {% elif error == "save_replica_pdf_failed" %} + {% elif error == "clean_replica_requires_layout_ocr" %} +
+ Clean replica could not be generated from the current OCR because this document does not yet have usable positional layout data. Run layout-capable OCR next, then save the replica again. +
+{% elif error == "save_replica_pdf_failed" %}
Could not save replica PDF.
{% elif error == "save_replica_pdf_scan_backed_failed" %}
Could not save scan-backed replica PDF.
@@ -204,12 +208,30 @@ document.addEventListener("DOMContentLoaded", () => { +{% if success == "saved_replica_pdf_scan_backed_fallback" %} +
+ Clean replica could not be generated for this document, so a scan-backed replica was created instead. +
+{% endif %} + {% if error == "storage_unavailable" %}
Storage mount unavailable. Please retry in a moment.
{% endif %} +{% if error == "clean_replica_has_no_renderable_lines" %} +
+ Clean replica could not be generated because this document does not yet have usable text layout data. Save the scan-backed replica for now, or re-run OCR/review first. +
+{% endif %} + +{% if success == "saved_replica_pdf_scan_backed_fallback" %} +
+ Clean replica was unavailable because usable OCR layout boxes were missing. A scan-backed replica was generated instead. +
+{% endif %} +