feat: add frontend support for dual-track processing
- Add ProcessingTrack, ProcessingMetadata types to apiV2.ts - Add analyzeDocument, getProcessingMetadata, downloadUnified API methods - Update startTask to support ProcessingOptions - Update TaskDetailPage with: - Processing track badge and description display - Enhanced stats grid (pages, text regions, tables, images, confidence) - UnifiedDocument download option - Translation UI preparation (disabled, awaiting backend) - Mark Section 7 Frontend Updates as completed in tasks.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -44,6 +44,43 @@ export interface SessionInfo {
|
||||
|
||||
export type TaskStatus = 'pending' | 'processing' | 'completed' | 'failed'
|
||||
|
||||
// ==================== Dual-Track Processing ====================
|
||||
|
||||
export type ProcessingTrack = 'ocr' | 'direct' | 'hybrid' | 'auto'
|
||||
|
||||
export interface ProcessingMetadata {
|
||||
processing_track: ProcessingTrack
|
||||
processing_time_seconds: number
|
||||
language: string
|
||||
page_count: number
|
||||
total_elements: number
|
||||
total_text_regions: number
|
||||
total_tables: number
|
||||
total_images: number
|
||||
average_confidence: number | null
|
||||
unified_format: boolean
|
||||
}
|
||||
|
||||
export interface DocumentAnalysisResponse {
|
||||
task_id: string
|
||||
filename: string
|
||||
recommended_track: ProcessingTrack
|
||||
confidence: number
|
||||
reason: string
|
||||
document_info: Record<string, any>
|
||||
is_editable: boolean
|
||||
text_coverage: number | null
|
||||
page_count: number | null
|
||||
}
|
||||
|
||||
export interface ProcessingOptions {
|
||||
use_dual_track?: boolean
|
||||
force_track?: ProcessingTrack
|
||||
language?: string
|
||||
include_layout?: boolean
|
||||
include_images?: boolean
|
||||
}
|
||||
|
||||
export interface TaskCreate {
|
||||
filename?: string
|
||||
file_type?: string
|
||||
@@ -74,6 +111,9 @@ export interface Task {
|
||||
updated_at: string
|
||||
completed_at: string | null
|
||||
file_deleted: boolean
|
||||
// Dual-track processing fields
|
||||
processing_track?: ProcessingTrack
|
||||
processing_metadata?: ProcessingMetadata
|
||||
}
|
||||
|
||||
export interface TaskFile {
|
||||
|
||||
Reference in New Issue
Block a user