Skip to content

Reviewer improvements: independent crop boxes, audio waveform, auto-advance#1

Open
glenWaltron wants to merge 5 commits into
mainfrom
feature/reviewer-independent-crop-boxes
Open

Reviewer improvements: independent crop boxes, audio waveform, auto-advance#1
glenWaltron wants to merge 5 commits into
mainfrom
feature/reviewer-independent-crop-boxes

Conversation

@glenWaltron

@glenWaltron glenWaltron commented Jun 13, 2026

Copy link
Copy Markdown

Reviewer UX improvements, in two commits.

1. Independent per-part crop boxes

The reviewer modelled each page as a single 1:3 box sliced into three equal stacked squares — great for an upright workbook character, but unusable for plain / panel-not-detected pages where head, torso, and legs are separate drawings scattered around the sheet. Adds an Independent boxes mode: three colour-coded crop boxes (🔵 top/head · 🟢 middle/torso · 🟠 bottom/legs) that each move and resize freely, anywhere on the page, cropping to their own 1024×1024 opaque tile.

  • scripts/image_ops.py — new retile_boxes() + optional boxes field on ImageState.
  • reviewer/app.py/api/retile accepts {boxes:{top,middle,bottom}} as well as {box:[...]}.
  • reviewer/static/index.html — toggle, 3-box editor (drag/resize each, topmost-wins hit-testing), legend, persistence.

2. Reviewer UX follow-ups

  • Default to independent-box mode on every story (seeded from the single box's equal thirds; single-box toggle still available).
  • Audio waveform drawn behind the splitter timeline so cut points can be placed on the quiet gaps between chapters. New GET /api/waveform/{id} returns a down-sampled, normalised peak envelope, cached to audio/waveform.json (librosa).
  • Auto-advance: "Save & mark reviewed" jumps to the next unreviewed story, and the reviewer opens straight on the first story still left to review.

Compatibility

  • Default deterministic + Claude-escalation pipeline (process.py) unchanged — reviewer-side only.
  • export.py needs no change (it copies the tile PNGs).
  • Backward compatible: existing image_state.json without boxes loads fine; audio without a cached waveform computes on demand.

🤖 Generated with Claude Code

glenWaltron and others added 2 commits June 13, 2026 22:45
The reviewer modelled the image as a single 1:3 box sliced into three equal
stacked squares — great for an upright workbook character, but unusable for
"plain"/panel-not-detected pages where head, torso and legs are separate
drawings scattered around the sheet (you couldn't frame them independently).

Add an opt-in "Independent boxes" mode: three colour-coded crop boxes
(top/middle/bottom) that each move and resize freely, anywhere on the page,
and crop to their own 1024x1024 opaque tile.

- image_ops.py: new retile_boxes() (three independent rects -> three tiles,
  same opaque/raw-paper output as slice_and_resize) + optional `boxes` field
  on ImageState so the choice persists.
- reviewer/app.py: /api/retile now accepts {boxes:{top,middle,bottom}} as well
  as the legacy {box:[...]}; single-box recompute clears `boxes` so state stays
  coherent.
- reviewer/static/index.html: a toggle, a 3-box editor (drag/resize each,
  topmost-wins hit-testing), a colour legend, and persistence on reload.

The default deterministic + Claude-escalation pipeline is unchanged; this is a
reviewer-side override. export.py needs no change (it copies the tile PNGs).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follow-up reviewer improvements on top of the independent-boxes feature:

- Default to independent-box mode on every story (seeded from the single
  box's equal thirds); the single-box toggle still works.
- Audio splitter now draws the full recording's peak-envelope waveform behind
  the timeline so cut points can be placed on the quiet gaps between chapters.
  New GET /api/waveform/{id} returns a down-sampled, normalised envelope,
  cached to audio/waveform.json (computed with librosa).
- "Save & mark reviewed" auto-advances to the next unreviewed story, and the
  reviewer opens straight on the first story still left to review.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@glenWaltron glenWaltron changed the title Reviewer: independent per-part crop boxes for multi-drawing pages Reviewer improvements: independent crop boxes, audio waveform, auto-advance Jun 13, 2026
glenWaltron and others added 3 commits June 15, 2026 08:37
Some pages can't be processed and shouldn't sit in the review queue or be
exported. Add an "Archive" state distinct from "reviewed":

- reviewer/app.py: POST /api/archive/{id} sets archived=True (clears reviewed);
  saving/reviewing clears archived. /api/ids now returns `archived`.
- reviewer/static/index.html: "🗄 Archive (can't process)" button that
  auto-advances; sidebar shows a 🗄 badge; the "next / left to do" queue skips
  both reviewed and archived.
- scripts/export.py: archived ids are never exported (even with
  --include-unreviewed).

Archived state lives in WORK/<id>/status.json, so it's visible and reversible.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The splitter used 4 shared edges, forcing the three clips to be contiguous, so
silence/chatter BETWEEN sections couldn't be removed. Switch to three
independent [start,end] pairs (6 handles) so each clip is framed on its own and
the gaps between them are dropped.

- audio_ops.py: new split_spans() — cuts 3 clips from [b0,b1,m0,m1,e0,e1],
  start<=end per clip, each still silence-trimmed at its own edges.
- reviewer/app.py: /api/resplit accepts {spans:[...6]} (legacy {edges:[...4]}
  still works); stores audio_state.spans.
- reviewer/static/index.html: timeline now shows one band per clip with two
  colour-matched handles each (blue=beginning, green=middle, orange=end);
  handles clamp to neighbours (order kept, gaps allowed); seeded from the
  existing 4 edges; re-split posts spans.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pages photographed at an angle / not scanned flat can't be framed by an
axis-aligned rectangle without losing detail. Add an optional "Free corners"
mode (off by default): each part's 4 corners move independently to trace the
skewed region, which is perspective-warped to a square tile.

- image_ops.py: new retile_quads() (cv2.getPerspectiveTransform + warpPerspective,
  corners TL,TR,BR,BL -> out_size square) + optional `quads` field on ImageState.
- reviewer/app.py: /api/retile accepts {quads:{top,middle,bottom}} (each 4 pts);
  switching back to boxes/box clears quads.
- reviewer/static/index.html: "Free corners" toggle (implies independent mode),
  polygon editor with 4 free corner handles per part, seeded from the rect boxes,
  persisted per id. Rectangles remain the default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant