Files
CheapRetouch/specs/06-canvas-view.md
jared 1049057d7d Add Ralph Wiggum agent setup and project specifications
- Add project constitution with vision, principles, and autonomy settings
- Add 15 feature specifications covering full app scope
- Configure agent entry points (AGENTS.md, CLAUDE.md)
- Add build prompt and speckit command for spec creation
- Include comprehensive .gitignore for iOS development

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 23:19:41 -05:00

1.4 KiB

Canvas View

Description

Main editing canvas with pinch-to-zoom, pan, mask overlay, and before/after comparison.

Acceptance Criteria

  • CanvasView SwiftUI view displaying the current edited image
  • Pinch-to-zoom gesture with smooth animation
  • Pan gesture for navigation when zoomed
  • Zoom limits: 1x to 10x
  • Mask overlay modes:
    • Red tint (50% opacity red on masked areas)
    • Marching ants (animated dashed border)
    • Hidden (no overlay)
  • Toggle between overlay modes via UI control
  • Before/after comparison:
    • Long press shows original image
    • Release returns to edited version
    • Optional toggle button for sticky comparison
  • Renders at appropriate resolution for current zoom level
  • Smooth 60fps interaction on A14 devices
  • UI tests for gesture interactions

Technical Notes

  • Use MagnificationGesture and DragGesture simultaneously
  • Consider using UIKit interop (UIViewRepresentable) for smoother gestures if needed
  • Mask overlay should be composited efficiently (don't re-render full image)
  • Use drawingGroup() or Metal for overlay rendering if performance issues

Edge Cases

  • Zoom at image boundary: clamp pan to keep image visible
  • Very large image: use tiled rendering or lower resolution preview
  • No edits yet: before/after shows same image (no-op)
  • Rapid gesture changes: debounce if needed to prevent jank