From 0ef1392b1947c96a468637be09c0b0154a79ed6c Mon Sep 17 00:00:00 2001 From: McElwain Date: Sun, 26 Apr 2026 16:59:23 -0500 Subject: [PATCH] feat: polish mobile detail tabs and persist active tab --- app/static/app.css | 90 +++++++++++++++++++++++++++++ app/templates/base.html | 47 ++++++++++++++- app/templates/documents/detail.html | 82 ++++++++++++++++++++++++-- 3 files changed, 214 insertions(+), 5 deletions(-) diff --git a/app/static/app.css b/app/static/app.css index bd0dbe3..a9430fa 100644 --- a/app/static/app.css +++ b/app/static/app.css @@ -5277,3 +5277,93 @@ table { } } /* ===== end extra json matches OCR editor with line numbers ===== */ + + +/* ===== line items mobile final sizing ===== */ +@media (max-width: 900px) { + .tab-panel[data-panel="line-items"] table { + min-width: 68rem !important; + } + + /* # */ + .tab-panel[data-panel="line-items"] table th:nth-child(1), + .tab-panel[data-panel="line-items"] table td:nth-child(1) { + min-width: 2.4rem !important; + width: 2.4rem !important; + } + + /* Date */ + .tab-panel[data-panel="line-items"] table th:nth-child(2), + .tab-panel[data-panel="line-items"] table td:nth-child(2) { + min-width: 6.2rem !important; + width: 6.2rem !important; + } + + /* Description - larger */ + .tab-panel[data-panel="line-items"] table th:nth-child(3), + .tab-panel[data-panel="line-items"] table td:nth-child(3) { + min-width: 13rem !important; + width: 13rem !important; + } + + /* Qty */ + .tab-panel[data-panel="line-items"] table th:nth-child(4), + .tab-panel[data-panel="line-items"] table td:nth-child(4) { + min-width: 3rem !important; + width: 3rem !important; + } + + /* Unit */ + .tab-panel[data-panel="line-items"] table th:nth-child(5), + .tab-panel[data-panel="line-items"] table td:nth-child(5) { + min-width: 4rem !important; + width: 4rem !important; + } + + /* Total - larger */ + .tab-panel[data-panel="line-items"] table th:nth-child(6), + .tab-panel[data-panel="line-items"] table td:nth-child(6) { + min-width: 6rem !important; + width: 6rem !important; + } + + /* Tax - smaller */ + .tab-panel[data-panel="line-items"] table th:nth-child(7), + .tab-panel[data-panel="line-items"] table td:nth-child(7) { + min-width: 2.8rem !important; + width: 2.8rem !important; + } + + /* Category */ + .tab-panel[data-panel="line-items"] table th:nth-child(8), + .tab-panel[data-panel="line-items"] table td:nth-child(8) { + min-width: 7rem !important; + width: 7rem !important; + } + + /* Notes */ + .tab-panel[data-panel="line-items"] table th:nth-child(9), + .tab-panel[data-panel="line-items"] table td:nth-child(9) { + min-width: 7rem !important; + width: 7rem !important; + } + + .tab-panel[data-panel="line-items"] input { + min-width: 100% !important; + width: 100% !important; + font-size: 0.82rem !important; + padding-left: 0.45rem !important; + padding-right: 0.45rem !important; + } + + /* numeric columns align right */ + .tab-panel[data-panel="line-items"] table td:nth-child(4) input, + .tab-panel[data-panel="line-items"] table td:nth-child(5) input, + .tab-panel[data-panel="line-items"] table td:nth-child(6) input, + .tab-panel[data-panel="line-items"] table td:nth-child(7) input { + text-align: right !important; + font-variant-numeric: tabular-nums !important; + } +} +/* ===== end line items mobile final sizing ===== */ + diff --git a/app/templates/base.html b/app/templates/base.html index 70bfc5b..ef653d5 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -4,7 +4,7 @@ {% block title %}Document Processor{% endblock %} - + @@ -97,5 +97,50 @@ document.addEventListener("DOMContentLoaded", () => { }); + + diff --git a/app/templates/documents/detail.html b/app/templates/documents/detail.html index 4246012..d01f70e 100644 --- a/app/templates/documents/detail.html +++ b/app/templates/documents/detail.html @@ -21,6 +21,43 @@ document.addEventListener("DOMContentLoaded", () => { }); + + + {% endblock %} {% block content %} {% if error == "line_count_mismatch" %} @@ -451,10 +488,10 @@ document.addEventListener("DOMContentLoaded", () => { {{ i + 1 }} - - - - + + + + @@ -652,4 +689,41 @@ document.addEventListener("DOMContentLoaded", () => { }); + + + {% endblock %}