Skip to content

Refactor initialization logic#203

Merged
eisukekusachi merged 25 commits intomainfrom
refactor/initialization-logic
Apr 5, 2026
Merged

Refactor initialization logic#203
eisukekusachi merged 25 commits intomainfrom
refactor/initialization-logic

Conversation

@eisukekusachi
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / HandDrawingCanvasView to 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.

Comment thread HandDrawingSwiftMetal.xcodeproj/project.pbxproj Outdated
Comment thread CanvasView/Sources/CanvasView/CanvasViewModel.swift Outdated
Comment thread CanvasView/Sources/CanvasView/CanvasViewModel.swift Outdated
Comment thread HandDrawingSwiftMetal/HandDrawingViewModel.swift Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread CanvasView/Sources/CanvasView/CanvasView.swift Outdated
Comment thread CanvasView/Sources/CanvasView/CanvasView.swift
Comment thread HandDrawingSwiftMetal/HandDrawingViewController.swift Outdated
@eisukekusachi eisukekusachi marked this pull request as ready for review April 5, 2026 11:15
@eisukekusachi eisukekusachi merged commit b95cf2d into main Apr 5, 2026
@eisukekusachi eisukekusachi deleted the refactor/initialization-logic branch April 5, 2026 11:15
@eisukekusachi eisukekusachi self-assigned this Apr 5, 2026
@eisukekusachi eisukekusachi linked an issue Apr 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor HandDrawingCanvasView

2 participants