- 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>
1.3 KiB
1.3 KiB
Data Model & Edit Operations
Description
Implement the non-destructive editing data model with operation stack for full undo/redo support.
Acceptance Criteria
EditOperationenum implemented with cases:.mask,.inpaint,.adjustmentMaskOperationstruct with: id, toolType, maskData (compressed R8), timestampInpaintOperationstruct with: id, maskOperationId, patchRadius, featherAmount, timestampToolTypeenum with cases:.person,.object,.wire,.brushProjectmodel that holds:- Original image reference (PHAsset identifier or embedded Data)
- Operation stack (array of EditOperation)
- Current stack position for undo/redo
- All models conform to
Codable - Undo operation decrements stack position
- Redo operation increments stack position
- Project can be serialized to/from JSON
- Unit tests for operation stack logic
Technical Notes
- Original image is NEVER modified
- Mask data should be compressed (R8 texture format)
- Store PHAsset
localIdentifierfor Photos-sourced images - Store embedded image data for Files-imported images
- Cached previews should set
isExcludedFromBackup = true
Edge Cases
- Undo at beginning of stack: no-op, return false
- Redo at end of stack: no-op, return false
- Empty operation stack: valid state, shows original image