Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors canvas/texture-layer initialization to be more dependency-injected and to move more setup work into initializers, while updating the HandDrawing app flow to restore-or-initialize texture layers before creating the final canvas.
Changes:
- Make several initializers accept optional injected dependencies (and provide defaults).
- Replace the prior “setup/createCanvas” flow with
initializeCanvas(...)and move setup into initializers. - Update
HandDrawingViewController/HandDrawingCanvasViewto restore-or-initialize texture layers and then initialize the canvas.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| TextureLayerView/Sources/TextureLayerView/TextureLayerViewModel.swift | Adds default nil values for device/commandQueue params to simplify construction. |
| TextureLayerView/Sources/TextureLayerView/TextureLayerViewDependencies.swift | Introduces dependency injection for the documents repository via initializer. |
| HandDrawingSwiftMetal/Views/HandDrawingCanvasView/HandDrawingCanvasViewModel.swift | Refactors restore/init flow for texture layers; adds helper to initialize storage. |
| HandDrawingSwiftMetal/Views/HandDrawingCanvasView/HandDrawingCanvasViewDependencies.swift | Adds injectable repositories with defaults. |
| HandDrawingSwiftMetal/Views/HandDrawingCanvasView/HandDrawingCanvasView.swift | Updates initialization and adds restore-or-initialize canvas entrypoint; switches to initializeCanvas. |
| HandDrawingSwiftMetal/HandDrawingViewModel.swift | Introduces HandDrawingViewDependencies usage for file operations and updates task capture patterns. |
| HandDrawingSwiftMetal/HandDrawingViewController.swift | Updates view/controller initialization flow and wiring to use the new restore/init sequence and updated API naming. |
| HandDrawingSwiftMetal.xcodeproj/project.pbxproj | Adds build references for HandDrawingViewDependencies.swift. |
| CanvasView/Sources/CanvasView/CanvasViewModel.swift | Moves configuration setup into init; introduces initializeCanvas and creates an initial renderer/canvas in init. |
| CanvasView/Sources/CanvasView/CanvasView.swift | Updates init signature to accept CanvasConfiguration; replaces createCanvas with initializeCanvas. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.