Extend commit workflow to Describe and Freeform modes

All text-output modes (plain_ocr, describe, freeform) now show the
full-screen editable result view with metadata fields and Commit Job
button. The textarea label reflects the active mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Aaron Roberts
2026-06-10 10:38:27 +01:00
parent cc5ce0c6be
commit 4ab87d2e6f

View File

@@ -47,8 +47,11 @@ function App() {
const [commitLoading, setCommitLoading] = useState(false)
const [commitResult, setCommitResult] = useState(null)
// Modes that produce editable text output and can be committed to the DB
const COMMITTABLE_MODES = new Set(['plain_ocr', 'describe', 'freeform'])
// Whether to show the full-screen result view
const showResultView = view === 'new_job' && mode === 'plain_ocr' && !!result
const showResultView = view === 'new_job' && COMMITTABLE_MODES.has(mode) && !!result
const handleFileTypeChange = useCallback((newType) => {
setImage(null)
@@ -258,7 +261,8 @@ function App() {
)}
<div className="glass rounded-2xl p-4 flex flex-col h-full">
<p className="text-xs text-gray-400 mb-2 flex-shrink-0">
OCR Text <span className="text-purple-400">(edit before committing)</span>
{{ plain_ocr: 'OCR Text', describe: 'Description', freeform: 'Result' }[mode] || 'Result'}
<span className="text-purple-400 ml-1">(edit before committing)</span>
</p>
<textarea
value={editedOcrText}