Repository navigation
feat(flare): fake shapes: drafts, commit, box gestures, duplicate, copy and paste - #736
Closed
prakashUXtech wants to merge 1 commit into
Closed
prakashUXtech wants to merge 1 commit into
prakashUXtech wants to merge 1 commit into
Conversation
Contributor
|
Fast lane: not merged, this PR conflicts with dev at head 3a9d82c. Rebase on origin/dev, rerun scripts/ci, and update the Fast-Check marker. |
Contributor
|
Fast lane: not eligible. touches protected paths: docs/c4/model.json. This PR now needs normal captain review. |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
FakeShapes, theShapeBuildingfake fromdocs/blueprints/flare.mdsection 6.3 (LM-0a2b).FlareServices.fake()now holds it in place ofNotBuilt.aboveLayerID(or on top). It runs oneAddLayerin one group, "Add Rectangle", "Add Ellipse" or "Add Path". It throwslayerLockedabove a locked layer.boxResultgives move, scale and rotate values. A scale keeps the opposite handle fixed, and a middle handle leaves the other axis alone. A rotation turns about the box center.commitBoxwrites those values withSetKeyframein one group, "Move", "Scale" or "Rotate", using section 2's not-animated rule: with one key or none and auto-key off, it edits that one key; otherwise it keys the playhead.AddLayerenvelopes. Paste reads them back only throughCommandRegistry.builtIn, shifts x byoffset, and runs in one group, "Paste". Names follow "Ball copy", then "Ball copy 2" and so on. Anything that isn't a list ofAddLayerenvelopes throws "Nothing to paste.".flare-model-sourcesnow lists FakeShapes.Split
The whole of LM-0a2b went past the 400-line cap, so path edit, item move and delete are split out into #473 (LM-0a2c). Until that lands,
setPath,translateanddeletethrowNotBuilt("Not built yet (LM-0a2c, #473)."). #473 touches onlyFakeShapes.swiftand its test, so it does not block LM-0a3 (#318).Proof
Tests/FlareModelTests/ShapeFakesTests.swiftcovers each line of the acceptance test:aRectangleCommitIsOneEntryUndoAddRectangle: exactly one entry, "Undo Add Rectangle".shiftGivesEqualSidesAndOptionDrawsFromTheCenter: equal sides with Shift.aScaleGestureKeepsTheOppositeCornerFixed: the opposite corner stays within 1e-9.copyThenPasteAddsBallCopyInOneEntry: "Ball copy" in one entry, "Undo Paste".garbagePasteDataThrowsNothingToPaste: garbage data throws "Nothing to paste.".Further tests cover the pen draft, the not-animated rule, the stubbed item edits and the unavailable fake. Model only: no SwiftUI and no snapshots.
Docs: I checked
JSONDecoder.decode(_:from:)with the apple-docs MCP. The rest is FlareCore and the Swift stdlib.make ciprintsCI: PASSon this head.Closes #317
Belt-Run: act-1a1363c7fd0-dmkc
Fast-Check: pass
Head: 3a9d82c
Generated by Claude Code