From 100c9af72d6677af9aba5c21c931a2cedcf85668 Mon Sep 17 00:00:00 2001 From: sirdave73 Date: Fri, 4 Sep 2026 21:17:23 -0400 Subject: [PATCH] feat(ui): standalone render-mode toggle above upload box + version 2.1.0 - Move High Quality / Fast segmented toggle out of the clickable upload zone into a standalone .render-control so clicking the drop box only uploads - Update JS selector to .render-control; progressive disclosure keeps the toggle hidden for non-office files, visible for .docx/.odt/.rtf - Version bump 2.0.0 -> 2.1.0 (dev-test branch save rule: bump version on save) --- app.py | 2 +- templates/index.html | 45 ++++++++++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/app.py b/app.py index ed1cf56..93ccb4b 100644 --- a/app.py +++ b/app.py @@ -49,7 +49,7 @@ for _d in (UPLOAD_DIR, OUTPUT_DIR, WORK_DIR): MAX_UPLOAD_MB = 400 # Semantic version exposed by /health so the UI can show "vX.Y.Z" in the footer. -APP_VERSION = "2.0.0" +APP_VERSION = "2.1.0" # req 3 (health): supported formats advertised to clients. Additive key — the # existing /health contract asserts only status + max_upload_mb. diff --git a/templates/index.html b/templates/index.html index 047ccc3..29c9bfe 100644 --- a/templates/index.html +++ b/templates/index.html @@ -177,6 +177,8 @@ .drop.over { border-color: transparent; transform: translateY(-2px); background: rgba(139, 92, 246, 0.08); } .drop.over::before { opacity: 1; } .drop input { display: none; } + .render-control { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 26px auto 0; } + .render-caption { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); } .drop-visual { display: grid; @@ -346,6 +348,30 @@
+
+
+ + Rendering style +
+
+ + +
+
+
@@ -480,7 +489,7 @@ if (!OKEXT.test(f.name)) { flashError('Unsupported file type — accepted: .epub .html .htm .txt .log .md .markdown .csv .tsv .json .xml .svg .png .jpg .jpeg .webp .tiff .bmp .pdf .docx .odt .rtf .tex .latex .org .adoc .rst'); return; } // STEP 3: progressive disclosure — toggle only for the office trio (.docx/.odt/.rtf) const isOffice = /\.(docx|odt|rtf)$/i.test(f.name); - const toggle = document.querySelector('.render-modes'); + const toggle = document.querySelector('.render-control'); if (toggle) toggle.style.display = isOffice ? '' : 'none'; var form = new FormData(); form.append('file', f);