feat: unify Direct Track PDF rendering and simplify export options

Backend changes:
- Apply background image + invisible text layer to all Direct Track PDFs
- Add CHART to regions_to_avoid for text extraction
- Improve visual fidelity for native PDFs and Office documents

Frontend changes:
- Remove JSON, UnifiedDocument, Markdown download buttons
- Simplify to 2-column layout with only Layout PDF and Reflow PDF
- Remove translation JSON download and Layout PDF option
- Keep only Reflow PDF for translated document downloads
- Clean up unused imports (FileJson, Database, FileOutput)

Archives two OpenSpec proposals:
- unify-direct-track-pdf-rendering
- simplify-frontend-export-options

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
egg
2025-12-12 07:50:43 +08:00
parent 53bfa88773
commit 24253ac15e
15 changed files with 891 additions and 195 deletions

View File

@@ -0,0 +1,57 @@
# Tasks: Simplify Frontend Export Options
## 1. TaskDetailPage - Download Section
- [x] 1.1 Remove JSON download button
- File: `frontend/src/pages/TaskDetailPage.tsx`
- Remove: Button with `handleDownloadJSON` onClick
- Remove: `handleDownloadJSON` function (lines 245-261)
- [x] 1.2 Remove UnifiedDocument download button
- File: `frontend/src/pages/TaskDetailPage.tsx`
- Remove: Button with `handleDownloadUnified` onClick
- Remove: `handleDownloadUnified` function (lines 263-279)
- [x] 1.3 Remove Markdown download button
- File: `frontend/src/pages/TaskDetailPage.tsx`
- Remove: Button with `handleDownloadMarkdown` onClick
- Remove: `handleDownloadMarkdown` function (lines 227-243)
- [x] 1.4 Update download grid layout
- File: `frontend/src/pages/TaskDetailPage.tsx`
- Change: Grid from 5 columns to 2 columns (only Layout PDF and Reflow PDF)
- Update: `grid-cols-2 md:grid-cols-5``grid-cols-2`
## 2. TaskDetailPage - Translation Section
- [x] 2.1 Remove translation JSON download button
- File: `frontend/src/pages/TaskDetailPage.tsx`
- Remove: Button with `handleDownloadTranslation` onClick in translation list
- Remove: `handleDownloadTranslation` function (lines 322-338)
- [x] 2.2 Simplify translated PDF download (remove Layout option)
- File: `frontend/src/pages/TaskDetailPage.tsx`
- Change: Remove Select dropdown for PDF format
- Change: Replace with single "流式 PDF" download button
- Keep: `handleDownloadTranslatedPdf` function (always use 'reflow' format)
## 3. Cleanup - Remove Unused Imports
- [x] 3.1 Remove unused Lucide icons
- File: `frontend/src/pages/TaskDetailPage.tsx`
- Removed: `FileJson`, `Database`, `FileOutput`
- Keep: Icons still in use
## 4. Verification
- [ ] 4.1 Verify Layout PDF download works
- Test: Click "版面 PDF" button
- Expected: PDF downloads with preserved layout
- [ ] 4.2 Verify Reflow PDF download works
- Test: Click "流式 PDF" button
- Expected: PDF downloads with flowing text
- [ ] 4.3 Verify translated Reflow PDF download works
- Test: Complete a translation, then click download
- Expected: Translated PDF downloads in reflow format