b045db94

Rotate images by exact degrees in either direction (#10)

## Summary

The Rotate button still turns images 90° clockwise. Its attached dropdown now offers **Exact**, which opens a dialog for degrees and clockwise/counterclockwise direction. Each opening defaults to **90° clockwise**.

- Accept fractional angles and normalize complete turns; canceling or submitting a full turn leaves the image and undo history unchanged.
- Expand the canvas without clipping the rotated image, leaving transparent corners.
- Keep arrows, rectangle outlines, and redactions aligned and independently toggleable/removable through rotation, cropping, and undo.
- Preserve keyboard input, validation, focus restoration, and crop selections when canceling the dialog.
- Keep editor undo working with focused shape checkboxes, while modal controls never undo the image behind the dialog.
- Export transparent corners as white in JPEG, preserve alpha in PNG/WebP/clipboard, and prevent dark fringes when resizing rotated edges.

## Verification

- Full Playwright suite: **29 passed** after review fixes.
- Prettier checks and `git diff --check` passed.
- Inspected desktop (1600px) and narrow (480px) dialog screenshots.
- Tests cover defaults, cancellation, validation, both directions, fractional angles, annotation geometry, undo with focused controls, cropping, PNG download, and clipboard output. Clipboard output uses a stubbed writer to inspect the actual PNG payload.
- Encoding tests cover full-size and resized JPEG backgrounds, PNG/WebP alpha, and partially transparent rotated edges. Regression tests reproduced checkbox undo, black JPEG corners, and dark resized fringes before their fixes.

## Review

Completed Claude's read-only review and collaborative fix/verification loop after initial publication.

- Base: `1d65db2d2fbe1cc9fb32f4eb9ba744bb33b5c222` (`origin/master`).
- Initial reviewed HEAD: `58454d2be9d804dde636e5c991a5c826df4ab44a`.
- Final reviewed HEAD: `6b5237e5dd5bb77144a3c1641aa64eadf85ee589`.
- Implemented agreed undo, crop-interaction, shared-rendering, JPEG-background, and alpha-aware resizing fixes. Removed redundant validation and clarified Undo's image-quality benefit.
- Final reviewer result: **converged; no actionable findings remain**. Deferred only unrelated pre-existing viewport-fit duplication; retained the requested Exact label.

Co-authored-by: Michael Lynch <git@mtlynch.io>
Reviewed-on: https://codefloe.com/mtlynch/pointer-brother/pulls/10

Total

5s

Time to Start Worker time Duration Time to finish Idle
Config 0s 1s 1s 1s 0s
Eval 2s 3s 3s 5s 0s
Build 5s 0s 0s 5s 0s
Suite 0s 5s 5s 5s 0s

Timeline

Config Eval Build
0s