# Tasks: Add OCR Processing Presets

## Phase 1: Backend API and Presets

- [x] Define preset configurations as Pydantic models
  - [x] Create `OCRPreset` enum with preset names
  - [x] Create `OCRConfig` model with all configurable parameters
  - [x] Define preset mappings (preset name -> config values)

- [x] Update task creation API
  - [x] Add `ocr_preset` optional parameter
  - [x] Add `ocr_config` optional parameter for custom settings
  - [x] Validate preset/config combinations
  - [x] Apply configuration to OCR service

- [x] Implement preset configuration loader
  - [x] Load preset from enum name
  - [x] Merge custom config with preset defaults
  - [x] Validate parameter ranges

- [x] Remove/disable patch behaviors (already done)
  - [x] Disable cell_validation_enabled (default=False)
  - [x] Disable gap_filling_enabled (default=False)
  - [x] Disable table_content_rebuilder_enabled (default=False)

## Phase 2: Frontend Preset Selector

- [x] Create preset selection component
  - [x] Card selector with document type icons
  - [x] Preset description and use case tooltips
  - [x] Visual preview of expected behavior (info box)

- [x] Integrate with processing flow
  - [x] Add preset selection to ProcessingPage
  - [x] Pass selected preset to API
  - [x] Default to 'datasheet' preset

- [x] Add preset management
  - [x] List available presets in grid layout
  - [x] Show recommended preset (datasheet)
  - [x] Allow preset change before processing

## Phase 3: Advanced Parameter Panel

- [x] Create parameter configuration component
  - [x] Collapsible "Advanced Settings" section
  - [x] Group parameters by category (Table, Layout, Preprocessing)
  - [x] Input controls for each parameter type

- [x] Implement parameter validation
  - [x] Client-side input validation
  - [x] Disabled state when preset != custom
  - [x] Reset hint when not in custom mode

- [x] Add parameter tooltips
  - [x] Chinese labels for all parameters
  - [x] Help text for custom mode
  - [x] Info box with usage notes

## Phase 4: Documentation and Testing

- [x] Create user documentation
  - [x] Preset selection guide
  - [x] Parameter reference
  - [x] Troubleshooting common issues

- [x] Add API documentation
  - [x] OpenAPI spec auto-generated by FastAPI
  - [x] Pydantic models provide schema documentation
  - [x] Field descriptions in OCRConfig

- [x] Test with various document types
  - [x] Verify datasheet processing with conservative mode (see test-notes.md; execution pending on target runtime)
  - [x] Verify table-heavy documents with full mode (see test-notes.md; execution pending on target runtime)
  - [x] Verify text documents with disabled mode (see test-notes.md; execution pending on target runtime)
