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:
@@ -47,8 +47,11 @@ function App() {
|
|||||||
const [commitLoading, setCommitLoading] = useState(false)
|
const [commitLoading, setCommitLoading] = useState(false)
|
||||||
const [commitResult, setCommitResult] = useState(null)
|
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
|
// 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) => {
|
const handleFileTypeChange = useCallback((newType) => {
|
||||||
setImage(null)
|
setImage(null)
|
||||||
@@ -258,7 +261,8 @@ function App() {
|
|||||||
)}
|
)}
|
||||||
<div className="glass rounded-2xl p-4 flex flex-col h-full">
|
<div className="glass rounded-2xl p-4 flex flex-col h-full">
|
||||||
<p className="text-xs text-gray-400 mb-2 flex-shrink-0">
|
<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>
|
</p>
|
||||||
<textarea
|
<textarea
|
||||||
value={editedOcrText}
|
value={editedOcrText}
|
||||||
|
|||||||
Reference in New Issue
Block a user