Side-by-side image/text layout and editable metadata on review

New Job page:
- OCR result now shows source image and editable textarea side by side
- Grounding-box overlay preview moved into the non-commit branch

Browse Jobs / Review page:
- JobDetail uses a 2-column layout: image + read-only info on left,
  all editable fields on right
- Author, book, chapter, and page are now editable inputs (not read-only)
- Text textarea is always editable (for both unreviewed and reviewed jobs)
- Reviewer name pre-filled for reviewed jobs; button becomes "Save Changes"
- Outer grid changed to 1/3 list + 2/3 detail for more review space

Backend:
- PUT /api/jobs/{id}/review now accepts and saves author, book,
  chapter, page alongside reviewed_text and reviewer_name

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Aaron Roberts
2026-06-09 17:38:36 +01:00
parent da7957d7d5
commit 9356ba6d1b
3 changed files with 281 additions and 204 deletions

View File

@@ -603,6 +603,10 @@ async def process_pdf(
class ReviewRequest(BaseModel):
reviewed_text: str
reviewer_name: str
author: Optional[str] = None
book: Optional[str] = None
chapter: Optional[str] = None
page: Optional[str] = None
def _job_row_to_dict(row) -> Dict[str, Any]:
@@ -811,11 +815,23 @@ async def review_job(job_id: str, body: ReviewRequest):
SET status = 'reviewed',
reviewed_text = %s,
reviewer_name = %s,
reviewed_at = NOW()
reviewed_at = NOW(),
author = %s,
book = %s,
chapter = %s,
page = %s
WHERE id = %s
RETURNING *
""",
(body.reviewed_text, body.reviewer_name, job_id),
(
body.reviewed_text,
body.reviewer_name,
body.author or None,
body.book or None,
body.chapter or None,
body.page or None,
job_id,
),
)
row = cur.fetchone()
except Exception as exc: